# Maintainer: CharOfString <root@charofstring.cc>
pkgname=gxde-editor-git
pkgver=2.0.10
pkgrel=1
pkgdesc='DTK based text editor'
arch=('x86_64' 'aarch64')
url="https://github.com/GXDE-OS/gxde-editor"
license=('GPL-3.0-or-later')
# 与 Debian 相同启用可选的 Qt WebEngine（Markdown 预览） ・ Like Debian, enable the optional Qt WebEngine (Markdown preview).
depends=('dtk2widget-qt6-git' 'dtk6core-git' 'qt6-base' 'qt6-5compat' 'wayland' 'qt6-webengine'
         'qt6-webchannel' 'syntax-highlighting' 'kcodecs' 'libgcc' 'libstdc++' 'glibc')
makedepends=('git' 'cmake' 'ninja' 'pkgconf' 'qt6-tools' 'qt6-wayland')
optdepends=('gxde-qt6integration-git: GXDE Qt6 style')
provides=('gxde-editor')
conflicts=('gxde-editor')
source=()
sha512sums=()

# 直接使用 PKGBUILD 所在的 git 仓库作为源码 ・ Build from the git checkout this PKGBUILD lives in.
_srcroot() {
  git -C "$startdir" rev-parse --show-toplevel
}

build() {
  # 与 debian/rules 相同 ・ Same as debian/rules.
  cmake -B build -S "$(_srcroot)" -GNinja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DVERSION="$pkgver"
  ninja -C build
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}
