# Maintainer: Integral <integral@member.fsf.org>

pkgname=goldendict-ng
pkgver=26.8.0
pkgrel=1
pkgdesc="The next generation GoldenDict (Supports Qt WebEngine & Qt6)."
arch=('i686' 'x86_64' 'aarch64')
url="https://github.com/xiaoyifang/${pkgname}"
license=('GPL-3.0-or-later')
depends=(
	'hunspell'
	'libvorbis'
	'libxtst'
	'lzo'
	'zlib'
	'xz'
	'libeb'
	'tomlplusplus'
	'fmt'
	'opencc'
	'xapian-core'
	'libzim'
	'qt6-base'
	'qt6-svg'
	'qt6-multimedia'
	'qt6-webengine'
	'qt6-speech'
	'qt6-5compat'
)
optdepends=('hunspell-dictionary: Dictionary files for Hunspell support')
makedepends=('cmake' 'qt6-tools')
conflicts=('goldendict')
provides=('goldendict')
replaces=('goldendict-svn' 'goldendict-git-opt' 'goldendict-webengine-git')
_commit_hash=ea1a9803
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('181534c827ca7939cb310df2013b084e4274b64f621821a4f825219f2dc888e3')

build() {
	cmake -B build \
		-S "${pkgname}-${pkgver}" \
		-D CMAKE_BUILD_TYPE=None \
		-D CMAKE_INSTALL_PREFIX=/usr

	cmake --build build
}

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