summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: afff3f38605c4f6ea679b528c57117211cba294f (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
72
73
74
75
76
77
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

_android_arch=x86

pkgname=android-${_android_arch}-jasper
pkgver=4.2.4
pkgrel=2
arch=('any')
pkgdesc="Software-based implementation of the codec specified in the emerging JPEG-2000 Part-1 standard (Android ${_android_arch})"
url='https://www.ece.uvic.ca/~frodo/jasper/'
license=('custom:JasPer2.0')
depends=("android-${_android_arch}-libjpeg")
makedepends=('android-cmake'
             "android-${_android_arch}-libjpeg"
             "android-${_android_arch}-libxmu")
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://github.com/mdadams/jasper/archive/version-${pkgver}.tar.gz")
md5sums=('aa4df693b90223fe6848b34cf1208624')

prepare() {
    cd "${srcdir}/jasper-version-${pkgver}"
    source android-env ${_android_arch}

    sed -r 's|(CMAKE_SKIP_BUILD_RPATH) FALSE|\1 TRUE|g' -i CMakeLists.txt
}

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

    android-${_android_arch}-cmake \
        -S . \
        -B ../build-shared \
        -DBUILD_TESTING=OFF \
        -DJAS_ENABLE_OPENGL=OFF \
        -DJAS_ENABLE_LIBJPEG=ON \
        -DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF \
        -DCMAKE_SKIP_RPATH=ON \
        -DJAS_STDC_VERSION=201112L \
        -DJAS_ENABLE_DOC=OFF \
        -DJAS_ENABLE_PROGRAMS=OFF \
        -DJPEG_INCLUDE_DIR="${ANDROID_PREFIX_INCLUDE}" \
        -DJPEG_LIBRARY="${ANDROID_PREFIX_LIB}/libjpeg.so" \
        -DBUILD_SHARED_LIBS=ON \
        -DJAS_ENABLE_SHARED=ON
    make -C ../build-shared $MAKEFLAGS

    android-${_android_arch}-cmake \
        -S . \
        -B ../build-static \
        -DBUILD_TESTING=OFF \
        -DJAS_ENABLE_OPENGL=OFF \
        -DJAS_ENABLE_LIBJPEG=ON \
        -DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF \
        -DCMAKE_SKIP_RPATH=ON \
        -DJAS_STDC_VERSION=201112L \
        -DJAS_ENABLE_DOC=OFF \
        -DJAS_ENABLE_PROGRAMS=OFF \
        -DJPEG_INCLUDE_DIR="${ANDROID_PREFIX_INCLUDE}" \
        -DJPEG_LIBRARY="${ANDROID_PREFIX_LIB}/libjpeg.a" \
        -DBUILD_SHARED_LIBS=OFF \
        -DJAS_ENABLE_SHARED=OFF
    make -C ../build-static $MAKEFLAGS
}

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

    make -C ../build-shared DESTDIR="${pkgdir}" install
    make -C ../build-static DESTDIR="${pkgdir}" install
    rm -rf "${pkgdir}/${ANDROID_PREFIX_SHARE}"
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so
    ${ANDROID_STRIP} -g "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a
}