# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=fontforge
pkgver=20251009
pkgrel=1
pkgdesc='Outline and bitmap font editor'
url='https://fontforge.github.io/'
arch=('x86_64' 'aarch64')
license=('BSD')
makedepends=('cmake' 'git' 'python-setuptools' 'python-sphinx')
depends=('libtool' 'pango' 'giflib' 'libtiff' 'libxml2' 'libspiro' 'python'
         'potrace' 'woff2' 'gtk3' 'gtkmm3' 'libuninameslist')
source=("https://github.com/${pkgname}/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz")
sha256sums=('69046500185a5581b58139dfad30c0b3d8128f00ebbfddc31f2fcf877e329e52')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	cmake \
		-B build -S . \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DENABLE_MAINTAINER_TOOLS=TRUE \
		-DENABLE_FONTFORGE_EXTRAS=TRUE \
		-DUNIX=TRUE \
		..
	make -C build
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}/build"

	make DESTDIR="${pkgdir}" install
	install -Dm644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
