# Maintainer: Jesus E. pkgname=graphite pkgver=1.3.14 _debver=$pkgver _debrel=1 pkgrel=2 epoch=1 pkgdesc="Reimplementation of the SIL Graphite text processing engine" arch=('i686' 'x86_64') url='https://github.com/silnrsi/graphite' license=('LGPL-2.1') depends=('gcc-libs') makedepends=('cmake' 'freetype2' 'python' 'asciidoc' 'quilt') options=('!emptydirs') source=("https://github.com/silnrsi/graphite/releases/download/${pkgver}/graphite2-${pkgver}.tgz" "https://deb.debian.org/debian/pool/main/g/graphite2/graphite2_${_debver}-${_debrel}.debian.tar.xz") sha512sums=('14b5eb2ba8158b8b62ffa7fb142100a0af1de0f0c45b2673801b636714a106b46fcd423b05c722d963c9543fafcf10fec811975308211a54f20a3ba322d7b295' '4f9fab5bf556fbfe6ad80560d0e8d48bd0c38d5996beb938f8ed7cdad44b230881eb3a32dd9e7352fca2b185005ecdc2d3915727ef4f40047818f2bac1b58342') prepare() { cd graphite2-${pkgver} if [[ ${pkgver%.*} = ${_debver%.*} ]]; then # Debian patches export QUILT_PATCHES=debian/patches export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index' export QUILT_DIFF_ARGS='--no-timestamps' mv "$srcdir"/debian . # Doesn't apply rm -v debian/patches/python-libgraphite-SONAME.diff || true rm -v debian/patches/reproducible-build.diff || true quilt push -av fi } build() { cmake \ -G "Unix Makefiles" \ -S graphite2-${pkgver} \ -B build \ -DCMAKE_C_FLAGS:STRING="${CFLAGS}" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DGRAPHITE2_COMPARE_RENDERER=OFF \ # fix unwanted -O3 cflag (taken from Debian) find ./build -type f ! -name "rules" ! -name "changelog" -exec sed -i -e 's/\-O3//g' {} \; make -C build make -C build -j1 docs } package() { cd "${srcdir}"/build make DESTDIR="$pkgdir/" install # install doc files mkdir -p "${pkgdir}"/usr/share/doc/graphite2/api cp -vrf doc/{GTF,manual}.html "${pkgdir}"/usr/share/doc/graphite2 # license for i in COPYING LICENSE; do install -Dm644 "${srcdir}"/graphite2-${pkgver}/${i} "${pkgdir}"/usr/share/licenses/${pkgname}/${i} done }