aboutsummaryrefslogtreecommitdiffstats
path: root/main/graphite2/APKBUILD
blob: 031bd9663fdafde0c02566a0bfa3ff1adaf3e943 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=graphite2
_realname=${pkgname/2/}
pkgver=1.3.12
pkgrel=1
pkgdesc="reimplementation of the SIL Graphite text processing engine"
url="http://graphite.sil.org/"
arch="all"
options="!check"  # Test suite requires Graphite 1 and py2-fonttools
license="LGPL-2.1+ OR MPL-2.0+ OR GPL-2.0+"
depends=""
depends_dev="freetype-dev"
makedepends="$depends_dev cmake"
install=""
subpackages="$pkgname-static $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/silnrsi/$_realname/archive/$pkgver.tar.gz
	cmake.patch
	"

builddir="$srcdir"/$_realname-$pkgver

build() {
	cd "$builddir"

	# static and shared version needs to be build in separated dirs
	# See https://github.com/silnrsi/graphite/pull/12#issuecomment-311756732

	# shared
	mkdir build && cd build
	cmake -G "Unix Makefiles" .. \
		-DCMAKE_C_FLAGS:STRING="${CFLAGS}" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE:STRING=Release \
		-DGRAPHITE2_COMPARE_RENDERER=OFF \
		-DGRAPHITE2_NFILEFACE=ON \
		-DGRAPHITE2_NSEGCACHE=ON

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

	# static
	cd ..
	mkdir build-static && cd build-static
	cmake -G "Unix Makefiles" .. \
		-DCMAKE_C_FLAGS:STRING="${CFLAGS}" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE:STRING=Release \
		-DGRAPHITE2_COMPARE_RENDERER=OFF \
		-DGRAPHITE2_NFILEFACE=ON \
		-DGRAPHITE2_NSEGCACHE=ON \
		-DBUILD_SHARED_LIBS=OFF

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

static() {
	pkgdesc="$pkgname static libraries"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$builddir"/build-static/src/libgraphite2.a "$subpkgdir"/usr/lib/
}

package() {
	cd "$builddir"/build
	make DESTDIR="$pkgdir/" install
}

sha512sums="d0aed05b54445a9664435d5aef9d78fc07a89be23d18b7b1339d37412b09faca6da3dc1e72524e4b114724b76aa6f36934e8ab1a01bd0752e353efa075c9e643  graphite2-1.3.12.tar.gz
ed1edb48adcaf29fd630d039b9436510cd7116a1a2d976a17912068e5446b17c33c099d0a3ac890f138126d80c2e0f3b56b8a4a28999486705e77f519a16adb3  cmake.patch"