2.42.9-1
[arch-packages.git] / harfbuzz / trunk / PKGBUILD
blob0082dcf4e820e098fbcbf8c2c3e4630645c3b490
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Jan de Groot <jgc@archlinux.org>
4 pkgbase=harfbuzz
5 pkgname=(harfbuzz harfbuzz-icu)
6 pkgver=5.1.0
7 pkgrel=1
8 pkgdesc="OpenType text shaping engine"
9 url="https://www.freedesktop.org/wiki/Software/HarfBuzz"
10 arch=(x86_64)
11 license=(MIT)
12 makedepends=(glib2 freetype2 graphite cairo icu gobject-introspection gtk-doc
13              ragel git python meson chafa)
14 checkdepends=(python-fonttools python-setuptools)
15 options=(debug)
16 _commit=f1f2be776bcd994fa9262622e1a7098a066e5cf7  # tags/5.1.0^0
17 source=("git+https://github.com/harfbuzz/harfbuzz#commit=$_commit")
18 sha256sums=('SKIP')
20 pkgver() {
21   cd harfbuzz
22   git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
25 prepare() {
26   cd harfbuzz
29 build() {
30   # Harfbuzz wants no exceptions
31   CFLAGS="${CFLAGS/-fexceptions/}"
32   CXXFLAGS="${CXXFLAGS/-fexceptions/}"
34   arch-meson harfbuzz build \
35     -D graphite2=enabled
36   meson compile -C build
39 check() {
40   mkdir -p tmp
41   TMPDIR="$PWD/tmp" meson test -C build --print-errorlogs
42   rm -r tmp
45 _pick() {
46   local p="$1" f d; shift
47   for f; do
48     d="$srcdir/$p/${f#$pkgdir/}"
49     mkdir -p "$(dirname "$d")"
50     mv "$f" "$d"
51     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
52   done
55 package_harfbuzz() {
56   depends=(glib2 freetype2 graphite libglib-2.0.so libfreetype.so
57            libgobject-2.0.so)
58   provides=(libharfbuzz.so libharfbuzz-subset.so libharfbuzz-gobject.so)
59   optdepends=('cairo: hb-view program'
60               'chafa: hb-view program')
62   meson install -C build --destdir "$pkgdir"
64   ( cd "$pkgdir"
66     _pick hb-icu usr/lib/libharfbuzz-icu*
67     _pick hb-icu usr/lib/pkgconfig/harfbuzz-icu.pc
68     _pick hb-icu usr/include/harfbuzz/hb-icu.h
69   )
71   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 harfbuzz/COPYING
74 package_harfbuzz-icu() {
75   pkgdesc+=" - ICU integration"
76   depends=("harfbuzz=$pkgver-$pkgrel" libicuuc.so libharfbuzz.so)
77   provides=(libharfbuzz-icu.so)
79   mv hb-icu/* "$pkgdir"
81   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 harfbuzz/COPYING