summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 24f6e9fb8ee4576c2b3b6ca7d3f7d198b6e8f597 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: damir <damir@archlinux.org>

_android_arch=armv7a-eabi

pkgname=android-${_android_arch}-libcdio
pkgver=2.1.0
pkgrel=1
arch=('any')
pkgdesc="GNU Compact Disc Input and Control Library (Android ${_android_arch})"
url="https://www.gnu.org/software/libcdio/"
license=('GPL3')
depends=("android-${_android_arch}-ncurses")
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("http://git.savannah.gnu.org/cgit/libcdio.git/snapshot/libcdio-release-${pkgver}.tar.gz"
        '0001-Disable-version-script.patch')
md5sums=('bb5d6c98858777fa087c8557fba347fe'
         '525e9b67c213cdd524837c70401712d2')
validpgpkeys=('DAA63BC2582034A02B923D521A8DE5008275EC21') # R. Bernstein

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

    patch -Np1 -i ../0001-Disable-version-script.patch

    autoreconf -fiv
}

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

    # Platform specific patches
    case "${_android_arch}" in
        aarch64)
             host=armv8-android-linux
            ;;
        armv7a-eabi)
             host=armv7-android-linux
            ;;
        x86)
             host=x86-android-linux
            ;;
        x86-64)
             host=x86_64-android-linux
            ;;
        *)
            ;;
    esac

    if [[ "${_android_arch}" = armv7a-eabi || "${_android_arch}" = x86 ]]; then
        export ac_cv_func_fseeko=no
        export ac_cv_func_fseeko64=no
    fi

    if [ "${ANDROID_MINIMUM_PLATFORM}" -lt 28 ]; then
        export ac_cv_header_glob_h=no
    fi

    ./configure \
        --host=${host} \
        --prefix="${ANDROID_PREFIX}" \
        --sysconfdir="${ANDROID_PREFIX_ETC}" \
        --localstatedir="${ANDROID_PREFIX_VAR}" \
        --disable-rpath \
        --disable-example-progs \
        --without-cd-drive \
        --without-cd-info \
        --without-cdda-player \
        --without-cd-read \
        --without-iso-info \
        --without-iso-read \
        --disable-vcd-info \
        --disable-cddb \
        --enable-maintainer-mode \
        --without-versioned-libs
    sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
    make $MAKEFLAGS
}

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

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

    sed -e "/define CDIO_LIBCDIO_SOURCE_PATH/s|.*|/* #undef CDIO_LIBCDIO_SOURCE_PATH */|" \
        -i "${pkgdir}/${ANDROID_PREFIX_INCLUDE}/cdio/cdio_config.h"
}