summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b05f6bbaa249621ec873bc800594dd31eb711739 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: drakkan <nicola.murino at gmail dot com>
# Contributor: Chris Kitching <chriskitching@linux.com>
# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>

_android_arch=x86-64

pkgname=android-${_android_arch}-cairo
pkgver=1.18.2
pkgrel=1
arch=('any')
pkgdesc="2D graphics library with support for multiple output devices (Android ${_android_arch})"
license=("LGPL"
         "MPL")
url="http://cairographics.org/"
conflicts=("android-${_android_arch}-cairo")
depends=("android-${_android_arch}-fontconfig"
         "android-${_android_arch}-glib2"
         "android-${_android_arch}-libpng"
         "android-${_android_arch}-lzo"
         "android-${_android_arch}-pixman"
         "android-${_android_arch}-zlib")
provides=("android-${_android_arch}-cairo")
makedepends=('android-meson'
             "android-${_android_arch}-librsvg"
             "android-${_android_arch}-poppler")
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://gitlab.freedesktop.org/cairo/cairo/-/archive/${pkgver}/cairo-${pkgver}.tar.gz"
        "0001-Added-missing-headers-and-symbols.patch"
        "0002-ipc-rmid-deferred-release.patch"
        "0026-create-argb-fonts.all.patch")
md5sums=('d31c3a866bfdfcd3e97e1bf4ed4bafba'
         'f56d559a886e4f6cf2c0aa567a0b8645'
         'ee5b94e1591fe0e1b8cc035f9a699b16'
         'b4d8fac687dd2b01879ca62452c15732')

prepare() {
    cd "${srcdir}/cairo-${pkgver}"
    patch -Np1 -i ../0001-Added-missing-headers-and-symbols.patch
    patch -Np1 -i ../0002-ipc-rmid-deferred-release.patch
    patch -Np1 -i ../0026-create-argb-fonts.all.patch
}

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

    mkdir -p build
    cd build
    android-${_android_arch}-meson \
        -D spectre=disabled \
        -D dwrite=disabled \
        -D freetype=enabled \
        -D fontconfig=enabled \
        -D tests=disabled \
        -D symbol-lookup=disabled \
        -D gtk_doc=false \
        -D xcb=disabled \
        -D xlib=disabled \
        -D xlib-xcb=disabled \
        --buildtype=release \
        --default-library=both
    echo '#define HAVE_CTIME_R 1'$'\n' >> config.h
    ninja
}

package() {
    DESTDIR="${pkgdir}" ninja -C "${srcdir}/cairo-${pkgver}/build" install
    ${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_PREFIX_LIB}/*.a || true
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so
}