summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3321c25289314d9adcb24113e339a44eaa00ab90 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Sylvain HENRY <hsyl20@yahoo.fr>
# Contributor: Hervé YVIQUEL <elldekaa@gmail.com>

_android_arch=armv7a-eabi

pkgname=android-${_android_arch}-hwloc
pkgver=2.10.0
pkgrel=4
arch=('any')
pkgdesc="Portable Hardware Locality is a portable abstraction of hierarchical architectures (Android, ${_android_arch})"
url='https://www.open-mpi.org/projects/hwloc/'
license=('BSD')
depends=("android-${_android_arch}-libtool"
         "android-${_android_arch}-libpciaccess")
makedepends=("android-${_android_arch}-cairo"
             "android-${_android_arch}-libxml2"
             "android-${_android_arch}-pciutils"
             "android-${_android_arch}-libx11"
             'android-configure')
optdepends=("android-${_android_arch}-cairo"
            "android-${_android_arch}-libxml2"
            "android-${_android_arch}-pciutils"
            "android-${_android_arch}-libx11")
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://www.open-mpi.org/software/hwloc/v${pkgver%.*}/downloads/hwloc-${pkgver}.tar.bz2")
sha256sums=('0305dd60c9de2fbe6519fe2a4e8fdc6d3db8de574a0ca7812b92e80c05ae1392')

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

    # Remove all references to -lpthread

    sed -i 's|-lpthread||g' hwloc/Makefile.am
    sed -i 's|-lpthread||g' hwloc/Makefile.in
    sed -i 's|HWLOC_LIBS_PRIVATE -lpthread|HWLOC_LIBS_PRIVATE|g' configure
    sed -i 's|LIBS -lpthread|LIBS|g' configure
    sed -i 's|HWLOC_LIBS -lpthread|HWLOC_LIBS|g' configure
    sed -i 's|LIBS="-lpthread|LIBS="|g' configure
    sed -i 's|-lpthread||g' tests/hwloc/Makefile.am
    sed -i 's|-lpthread||g' tests/hwloc/Makefile.in
    sed -i 's|HWLOC_LIBS_PRIVATE -lpthread|HWLOC_LIBS_PRIVATE|g' config/hwloc.m4
    sed -i 's|LIBS -lpthread|LIBS|g' config/hwloc.m4
    sed -i 's|HWLOC_LIBS -lpthread|HWLOC_LIBS|g' config/hwloc.m4
}

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

    android-${_android_arch}-configure \
        --enable-plugins
    make -C "${PWD}/hwloc" $MAKEFLAGS
    make -C "${PWD}/include" $MAKEFLAGS
    make hwloc.pc $MAKEFLAGS
}

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

    make -C "${PWD}/hwloc" DESTDIR="${pkgdir}" install
    make -C "${PWD}/include" DESTDIR="${pkgdir}" install
    make DESTDIR="${pkgdir}" install-hwlocpkgconfigDATA
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so
    ${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_PREFIX_LIB}/*.a
}