summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d1814c36504fc0c58901accd15eac05f5b0b0d52 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Jakub Klinkovský <lahwaacz at archlinux dot org>
# Contributor: David Runge <dvzrv@archlinux.org>

_android_arch=x86

pkgname=android-${_android_arch}-openpmix
pkgver=5.0.3
pkgrel=1
arch=('any')
pkgdesc="Extended version of the PMI standard (Android ${_android_arch})"
url="https://github.com/openpmix/openpmix"
license=('BSD-3-Clause')
groups=('android-openpmix')
depends=("android-${_android_arch}-hwloc"
         "android-${_android_arch}-libevent"
         "android-${_android_arch}-zlib")
makedepends=("android-${_android_arch}-hwloc"
             "android-${_android_arch}-zlib"
             'android-environment'
             'perl'
             'python')
options=(!strip !buildflags staticlibs !emptydirs)
source=("${url}/releases/download/v${pkgver}/pmix-${pkgver}.tar.gz"
        '0001-Force-32-bits-compile.patch'
        '0002-Unversioned-libs.patch'
        '0003-Add-missing-headers.patch')
md5sums=('456517e3129250a6ec9f9715959087df'
         'd0032b4f6868acb7b3a593f1a76f0eed'
         '47db6b8ab5894753aa4c508f64c75389'
         'a5c7336af3f4abce17ff7ecc1d08573a')

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

    ./autogen.pl

    patch -Np1 -i ../0001-Force-32-bits-compile.patch
    patch -Np1 -i ../0002-Unversioned-libs.patch
    patch -Np1 -i ../0003-Add-missing-headers.patch
    sed -i 's|-lpthread||g' configure
}

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

    # set environment variables for reproducible build
    # see https://docs.openpmix.org/en/latest/release-notes/general.html
    export HOSTNAME=buildhost
    export USER=builduser

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

    ./configure \
        --host="${host}" \
        --prefix="${ANDROID_PREFIX}" \
        --libdir="${ANDROID_PREFIX_LIB}" \
        --includedir="${ANDROID_PREFIX_INCLUDE}" \
        --enable-shared \
        --enable-static \
        --enable-pmix-binaries=no \
        --sysconfdir="${ANDROID_PREFIX_ETC}/openpmix"
    make V=1 $MAKEFLAGS
}

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

    make DESTDIR="${pkgdir}" install
    rm -rf "${pkgdir}/usr"
    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
    rm -f "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so.*
}