summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 72510b3f991e0c56b1b78bb4bb42647151626e80 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Daniel Kirchner <daniel AT ekpyron DOT org>

_android_arch=x86

pkgname=android-${_android_arch}-libpng
pkgver=1.6.44
pkgrel=1
pkgdesc="A collection of routines used to create PNG format graphics (Android ${_android_arch})"
arch=('any')
url="http://www.libpng.org/pub/png/libpng.html"
license=('custom')
depends=("android-${_android_arch}-zlib")
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("http://downloads.sourceforge.net/sourceforge/libpng/libpng-${pkgver}.tar.xz"
        '0001-Disable-zlib-version-check.patch')
md5sums=('e40b61660dcc807e1bcc4df9de8389ce'
         '02be00cae20d83569e60fffd98047d1b')

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

    patch -Np1 -i ../0001-Disable-zlib-version-check.patch
}

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

    export CFLAGS="${CFLAGS} -fPIC"
    export CXXFLAGS="${CXXFLAGS} -fPIC"

    android-${_android_arch}-configure \
        --disable-tests \
        --disable-tools \
        --enable-hardware-optimizations
    make $MAKEFLAGS
}

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

    make DESTDIR="${pkgdir}" install
    rm -r "${pkgdir}/${ANDROID_PREFIX_SHARE}"
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so
    ${ANDROID_STRIP} -g "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a
}