summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 74535b6ddcaa6e285d57d22d14acfad4540f3e7b (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Andreas Radke <andyrtr@archlinux.org>

_android_arch=x86

pkgname=android-${_android_arch}-libdrm
pkgver=2.4.123
pkgrel=1
arch=('any')
pkgdesc="Userspace interface to kernel DRM services (Android ${_android_arch})"
url="https://dri.freedesktop.org/"
license=('custom')
depends=("android-${_android_arch}-libpciaccess")
makedepends=('android-meson')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://dri.freedesktop.org/libdrm/libdrm-${pkgver}.tar.xz"
        '0001-Disable-open_memstream.patch')
md5sums=('322f5ffe2d3adc2f6ecaab52ae64ba4a'
         'b01f3f9e59e04924adcc3385e634c8dc')

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

    if [ "${ANDROID_MINIMUM_PLATFORM}" -lt 23 ]; then
        patch -Np1 -i ../0001-Disable-open_memstream.patch
    fi
}

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

    android-${_android_arch}-meson build \
        --default-library both \
        -D udev=true \
        -D etnaviv=disabled \
        -D freedreno=enabled \
        -D vc4=disabled \
        -D valgrind=disabled \
        -D install-test-programs=false \
        -D man-pages=disabled \
        -D tests=false
    ninja -C build
}

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

    DESTDIR="${pkgdir}" ninja -C build install
    ${ANDROID_STRIP} -g "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a || true
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so
    ${ANDROID_RANLIB} "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a || true
}