summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 85fb39723f6a9a5acb7fe693de5c7c9fa9ec3fdb (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Martchus <martchus@gmx.net>

_android_arch=aarch64

pkgname=android-${_android_arch}-freetype2
pkgver=2.13.3
pkgrel=2
arch=('any')
pkgdesc="Font rasterization library (Android ${_android_arch})"
url='https://www.freetype.org/'
license=('GPL')
groups=('android-freetype2')
depends=("android-ndk"
         "android-${_android_arch}-zlib"
         "android-${_android_arch}-brotli"
         "android-${_android_arch}-libpng"
         "android-${_android_arch}-harfbuzz")
# FIXME: It does not properly locate bzip2, disabling for now.
#depends+=("android-${_android_arch}-bzip2")
provides=("android-${_android_arch}-freetype2-boostrap")
conflicts=("android-${_android_arch}-freetype2-boostrap")
makedepends=('android-meson')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${pkgver}.tar.xz"{,.sig}
        '0001-Enable-table-validation-modules.patch'
        '0002-Enable-subpixel-rendering.patch'
        '0003-Enable-long-PCF-family-names.patch')
md5sums=('f3b4432c4212064c00500e1ad63fbc64'
         'SKIP'
         'edae0c9068cd60c4edde79e89534726e'
         '699b3c133ce7006e0e3f2a2f84982acb'
         'b7e77530b5a4197a26729f7d9e535258')
validpgpkeys=(
  'E30674707856409FF1948010BE6C3AAC63AD8E3F'  # Werner Lemberg <wl@gnu.org>
)

prepare() {
    cd "${srcdir}/freetype-${pkgver}"

    patch -Np1 -i ../0001-Enable-table-validation-modules.patch
    patch -Np1 -i ../0002-Enable-subpixel-rendering.patch
    patch -Np1 -i ../0003-Enable-long-PCF-family-names.patch
}

build() {
    cd "${srcdir}/freetype-${pkgver}"
    source android-env ${_android_arch}

    android-${_android_arch}-meson build \
        -D zlib=enabled \
        -D bzip2=disabled \
        -D png=enabled \
        -D harfbuzz=enabled \
        -D brotli=enabled \
        -D b_lto=false
    ninja -C build
}

package() {
    cd "${srcdir}/freetype-${pkgver}"

    DESTDIR="${pkgdir}" ninja -C build install
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so
    ${ANDROID_STRIP} -g "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a || true
    ${ANDROID_RANLIB} "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a || true
}