summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7d95afc332eb58a7f7835cf25ef7a4590d970a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pkgname=mingw-w64-graphite
pkgver=1.3.8
pkgrel=1
arch=(any)
pkgdesc="reimplementation of the SIL Graphite text processing engine (mingw-w64)"
license=("LGPL" "GPL" "custom")
depends=(mingw-w64-crt)
makedepends=(mingw-w64-cmake python2)
options=(staticlibs !strip !buildflags)
url="https://github.com/silnrsi/graphite"
source=("https://github.com/silnrsi/graphite/releases/download/${pkgver}/graphite2-${pkgver}.tgz"
"001-graphite2-1.3.8-win64.patch"
"002-graphite2-1.2.1-pkgconfig.patch"
"003-graphite2-1.3.8-staticbuild.patch"
"004-graphite2-1.3.8-dllimport-fix.patch")
sha1sums=('0c802628dacf3bfa2c1654d7d72b76e20e1adc97'
          '68c7b3c1c9e38f357a95e5b3b266d4afcfe78329'
          '4460d61e238892c421ae7771e3b36dc0b21d682c'
          'da2c20e50cd50a6cac422fd69459060a02311988'
          'd872ba0db6040865cfb1227e83f0f02cbdbe083a')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

prepare() {
	cd graphite2-$pkgver
	patch -p1 -i "${srcdir}"/001-graphite2-1.3.8-win64.patch
  patch -p1 -i "${srcdir}"/002-graphite2-1.2.1-pkgconfig.patch
  patch -p1 -i "${srcdir}"/003-graphite2-1.3.8-staticbuild.patch
  patch -p1 -i "${srcdir}"/004-graphite2-1.3.8-dllimport-fix.patch
  sed -i "s:\/usr\/bin\/python:\/usr\/bin\/python2:" tests/{corrupt.py,defuzz,fnttxtrender,fuzzbidi,fuzztest,hbspeeds,jsoncmp}
}

build() {
	cd graphite2-$pkgver
	for _arch in ${_architectures}; do
    unset LDFLAGS
    mkdir "build-${_arch}" && pushd "build-${_arch}"
    ${_arch}-cmake \
      -DCMAKE_BUILD_TYPE=Release \
      -DGRAPHITE2_COMPARE_RENDERER=OFF \
      ..
    make
    popd
  done
}

package() {
	for _arch in ${_architectures}; do
    cd "${srcdir}/${pkgname#mingw-w64-}2-$pkgver/build-${_arch}"
    make DESTDIR="$pkgdir" install
    find "$pkgdir/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip {} \;
    find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
    find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
  done
}