summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 60499e30b5a1716c0b12da3ca6c2e2dea0747c31 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Fabian Bornschein <fabiscafe@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

_android_arch=armv7a-eabi

pkgname=android-${_android_arch}-librsvg
pkgver=2.59.2
pkgrel=1
arch=('any')
pkgdesc="SVG rendering library (Android ${_android_arch})"
url="https://wiki.gnome.org/Projects/LibRsvg"
license=('LGPL-2.1-or-later')
groups=('android-librsvg')
depends=("android-${_android_arch}-cairo"
         "android-${_android_arch}-freetype2"
         "android-${_android_arch}-gdk-pixbuf2"
         "android-${_android_arch}-glib2"
         "android-${_android_arch}-harfbuzz"
         "android-${_android_arch}-libxml2"
         "android-${_android_arch}-pango")
makedepends=('android-meson'
             'android-rust')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://gitlab.gnome.org/GNOME/librsvg/-/archive/${pkgver}/librsvg-${pkgver}.tar.bz2")
md5sums=('f899eab00948aea436debd1e392db1ba')

prepare() {
    cd "${srcdir}/librsvg-${pkgver}"
    source android-rust-env ${_android_arch}
    android_rust_prepare
}

# Use LTO
export CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1

# Use debug
export CARGO_PROFILE_RELEASE_DEBUG=2

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

    android-${_android_arch}-meson build \
        -D triplet=${RUST_TARGET} \
        -D introspection=disabled \
        -D pixbuf-loader=disabled \
        -D docs=disabled \
        -D tests=false
    ninja -C build
}

package() {
    cd "${srcdir}/librsvg-${pkgver}"
    source android-rust-env ${_android_arch}

    DESTDIR="${pkgdir}" ninja -C build install
    rm -rf "${pkgdir}/${ANDROID_PREFIX_BIN}"
    rm -rf "${pkgdir}/${ANDROID_PREFIX_SHARE}/"{doc,man}
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so
    ${ANDROID_STRIP} -g "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a
}