summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2b841f77564ea4fd97056a22ebe6069910753519 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Caleb Maclennan <caleb@alerque.com>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Denis Martinez <deuns.martinez AT gmail.com>
# Contributor: Bogdan Burlacu <bogdan.burlacu AT pm.me>

_android_arch=armv7a-eabi

pkgname=android-${_android_arch}-onetbb
pkgver=2021.13.0
pkgrel=2
arch=('any')
pkgdesc="High level abstract threading library (oneAPI Threading Building Blocks) (Android ${_android_arch})"
url='https://oneapi-src.github.io/oneTBB/'
license=('Apache')
groups=(android-onetbb)
depends=("android-${_android_arch}-hwloc")
makedepends=('android-cmake')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://github.com/oneapi-src/oneTBB/archive/v${pkgver}/onetbb-${pkgver}.tar.gz")
md5sums=('f287cd007240a838286ff13e7deaee12')

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

    sed -i '/ LINK_FLAGS /d' src/tbbmalloc_proxy/CMakeLists.txt
    sed -i '/ LINK_DEPENDS /d' src/tbbmalloc_proxy/CMakeLists.txt

    files=(cmake/compilers/Clang.cmake
           cmake/compilers/GNU.cmake)

    for f in "${files[@]}"; do
        sed -i '/--version-script/d' $f
        sed -i 's|set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})|set(TBB_DEF_FILE_PREFIX "")|g' $f
    done
}

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

    android-${_android_arch}-cmake \
        -S . \
        -B build-shared \
        -DBUILD_SHARED_LIBS=ON \
        -DTBB_STRICT=OFF \
        -DTBB_TEST=OFF  \
        -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=OFF
    make -C build-shared $MAKEFLAGS

    android-${_android_arch}-cmake \
        -S . \
        -B build-static \
        -DBUILD_SHARED_LIBS=OFF \
        -DTBB_STRICT=OFF \
        -DTBB_TEST=OFF  \
        -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=OFF
    make -C build-static $MAKEFLAGS
}

package() {
    cd "${srcdir}/oneTBB-${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
}