aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libtbb/APKBUILD
blob: 4da0704e2726719a01eee14452f8bae913dc184b (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
# Contributor: David Huffman <storedbox@outlook.com>
# Maintainer: David Huffman <storedbox@outlook.com>

pkgname=libtbb
pkgver=4.4.4
_pkgverstr=tbb44_20160413oss
pkgrel=0
pkgdesc="Intel® TBB, a widely used C++ template library for task parallelism"
url="https://threadingbuildingblocks.org"
arch="x86 x86_64"
license="GPL2"
subpackages="$pkgname-debug $pkgname-dev $pkgname-doc"
source="https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/${_pkgverstr}_src.tgz"

_builddir="$srcdir/$_pkgverstr"
prepare() {
	local i
	cd "$_builddir"
	for i in "$startdir"/*; do
		case $i in
		*.patch) msg $i; patch --verbose -p1 -i $i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	make || return 1
}

_install_libs() {
	local buildtype libsuffix lib builddir
	buildtype="_$1"
	libsuffix="$2"
	lib="${3:-$subpkgdir}/usr/lib"
	builddir=$(find "$_builddir/build" -maxdepth 1 -name "*$buildtype" -type d) || return 1
	[ "$buildtype" != "_debug" ] && buildtype=''
	mkdir -p "$lib" || return 1
	mv "$builddir/libtbb${buildtype}.so$libsuffix" \
	   "$builddir/libtbbmalloc${buildtype}.so$libsuffix" \
	   "$builddir/libtbbmalloc_proxy${buildtype}.so$libsuffix" \
	   "$lib/" || return 1
}

package() {
	_install_libs release .2 "$pkgdir" || return 1
}

debug() {
	pkgdesc="$pkgdesc (debug symbols)"
	
	_install_libs debug .2 || return 1
}

dev() {
	pkgdesc="$pkgdesc (development files)"
	
	local prefix
	prefix="$subpkgdir/usr"
	cd "$_builddir"
	mkdir -p "$prefix" || return 1
	rm include/index.html && mv include "$prefix/" || return 1
	_install_libs release && _install_libs debug || return 1
}

doc() {
	arch="noarch"
	pkgdesc="$pkgdesc (documentation)"
	
	local share doc licenses
	share="$subpkgdir/usr/share"
	doc="$share/doc"
	licensesdir="$share/licenses/$pkgname"
	cd "$_builddir"
	mkdir -p "$doc" "$licensesdir" || return 1
	mv doc/ "$doc/$pkgname-$pkgver" || return 1
	mv COPYING "$licensesdir/" || return 1
}

md5sums="95999ccff3470f6565c516e67fb37019  tbb44_20160413oss_src.tgz"
sha256sums="3fecffef5e42f9f22e51a81a1bfa89ea40cefb439d168c285c9d5f0128353644  tbb44_20160413oss_src.tgz"
sha512sums="93424dbb42da10dc2ffdcc0c04738112bc0c96bc9c8563b3aa931b1f118fcec480957447673d85f8a6ea0e9f0b233460036204ad6e4dad815203375b45679943  tbb44_20160413oss_src.tgz"