PKGBUILD 1.8 KB
Newer Older
1
# Contributions from Arch: https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/graphite
philm's avatar
philm committed
2

3
pkgname=graphite
4
pkgver=1.3.5
philm's avatar
philm committed
5
pkgrel=1
6
arch=('x86_64')
7
url="https://github.com/silnrsi/graphite"
8
pkgdesc='reimplementation of the SIL Graphite text processing engine'
9
license=('LGPL' 'GPL' 'custom')
10
depends=('gcc-libs')
11 12 13 14 15 16 17
makedepends=('cmake' 'freetype2' 'python2'
             # for documentation
             'doxygen' 'dblatex' 'graphviz' 'asciidoc')
checkdepends=('python2-fonttools')
options=('!emptydirs')
source=(https://github.com/silnrsi/graphite/releases/download/${pkgver}/graphite2-${pkgver}.tgz)
md5sums=('5b8d22a8bbf031838e31432868c0109c')
philm's avatar
philm committed
18

19
prepare() {
20
  cd "${srcdir}"
21 22 23 24 25 26

  # python2 fixes
  sed -i "s:\/usr\/bin\/python:\/usr\/bin\/python2:" graphite2-${pkgver}/tests/{corrupt.py,defuzz,fnttxtrender,fuzzbidi,fuzztest,hbspeeds,jsoncmp}
}

build() {
27 28 29
  mkdir build
  cd build
  cmake -G "Unix Makefiles" ../graphite2-${pkgver} \
30 31 32 33 34 35 36 37 38 39
	-DCMAKE_C_FLAGS:STRING="${CFLAGS}" \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_BUILD_TYPE:STRING=Release \
	-DGRAPHITE2_COMPARE_RENDERER=OFF \

  # fix unwanted -O3 cflag (taken form Debian)
  find . -type f ! -name "rules" ! -name "changelog" -exec sed -i -e 's/\-O3//g' {} \;

  make 
  make -j1 docs
philm's avatar
philm committed
40 41
}

42 43
check() {
  cd "${srcdir}"/build
44 45 46
  # python2 fixes
  sed -i "s:python:python2:g" tests/CTestTestfile.cmake
  ctest || true
47
}
philm's avatar
philm committed
48

49 50 51
package() {
  cd "${srcdir}"/build
  make DESTDIR="$pkgdir/" install
52 53 54 55
  # install doc files
  mkdir -p "${pkgdir}"/usr/share/doc/graphite2/api
  cp -vrf doc/doxygen/{html,latex/refman.pdf} "${pkgdir}"/usr/share/doc/graphite2/api
  cp -vrf doc/{GTF,manual}.html "${pkgdir}"/usr/share/doc/graphite2
philm's avatar
philm committed
56 57 58

  # licenses
  mkdir -p "${pkgdir}"/usr/share/licenses/${pkgname}
59
  install -m644 "${srcdir}"/graphite2-${pkgver}/COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/
60
}