1 |
|
# Copyright 1999-2023 Gentoo Authors
|
|
1 |
# Copyright 1999-2022 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit flag-o-matic multilib-minimal multilib toolchain-funcs
|
7 |
|
|
8 |
|
PV1="$(ver_cut 1)"
|
9 |
|
PV2="$(ver_cut 2)"
|
10 |
|
MY_PV="${PV1}_U${PV2}"
|
|
6 |
inherit cmake-multilib
|
11 |
7 |
|
12 |
8 |
DESCRIPTION="High level abstract threading library"
|
13 |
9 |
HOMEPAGE="https://github.com/oneapi-src/oneTBB"
|
14 |
|
SRC_URI="https://github.com/intel/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
|
15 |
|
LICENSE="Apache-2.0"
|
16 |
|
SLOT="0"
|
17 |
|
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux"
|
18 |
|
IUSE="debug examples"
|
19 |
|
|
20 |
|
S="${WORKDIR}/oneTBB-${MY_PV}"
|
|
10 |
SRC_URI="https://github.com/oneapi-src/oneTBB/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
11 |
S="${WORKDIR}/oneTBB-${PV}"
|
21 |
12 |
|
22 |
|
DOCS=( CHANGES README README.md doc/Release_Notes.txt )
|
|
13 |
LICENSE="Apache-2.0"
|
|
14 |
# https://github.com/oneapi-src/oneTBB/blob/master/CMakeLists.txt#L53
|
|
15 |
# libtbb<SONAME>-libtbbmalloc<SONAME>-libtbbbind<SONAME>
|
|
16 |
SLOT="0/12.5-2.5-3.5"
|
|
17 |
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
|
|
18 |
IUSE="test"
|
|
19 |
RESTRICT="!test? ( test )"
|
|
20 |
|
|
21 |
RDEPEND="!kernel_Darwin? ( sys-apps/hwloc:= )"
|
|
22 |
DEPEND="${RDEPEND}"
|
|
23 |
BDEPEND="virtual/pkgconfig"
|
23 |
24 |
|
24 |
25 |
PATCHES=(
|
25 |
|
"${FILESDIR}"/${PN}-2020.1-makefile-debug.patch
|
26 |
|
"${FILESDIR}"/${PN}-2020.3-gcc13.patch
|
27 |
|
)
|
28 |
|
|
29 |
|
src_prepare() {
|
30 |
|
default
|
31 |
|
|
32 |
|
find include -name \*.html -delete || die
|
33 |
|
|
34 |
|
# Give it a soname on FreeBSD
|
35 |
|
echo 'LIB_LINK_FLAGS += -Wl,-soname=$(BUILDING_LIBRARY)' >> build/FreeBSD.gcc.inc
|
36 |
|
# Set proper versionning on FreeBSD
|
37 |
|
sed -i -e '/.DLL =/s/$/.1/' build/FreeBSD.inc || die
|
38 |
|
|
39 |
|
use debug || sed -i -e '/_debug/d' Makefile
|
40 |
|
}
|
41 |
|
|
42 |
|
multilib_src_configure() {
|
43 |
|
# pc files are for debian and fedora compatibility
|
44 |
|
# some deps use them
|
45 |
|
cat <<-EOF > ${PN}.pc.template
|
46 |
|
prefix=${EPREFIX}/usr
|
47 |
|
libdir=\${prefix}/$(get_libdir)
|
48 |
|
includedir=\${prefix}/include
|
49 |
|
Name: ${PN}
|
50 |
|
Description: ${DESCRIPTION}
|
51 |
|
Version: ${PV}
|
52 |
|
URL: ${HOMEPAGE}
|
53 |
|
Cflags: -I\${includedir}
|
54 |
|
EOF
|
55 |
|
cp ${PN}.pc.template ${PN}.pc || die
|
56 |
|
cat <<-EOF >> ${PN}.pc
|
57 |
|
Libs: -L\${libdir} -ltbb
|
58 |
|
Libs.private: -lm -lrt
|
59 |
|
EOF
|
60 |
|
cp ${PN}.pc.template ${PN}malloc.pc || die
|
61 |
|
cat <<-EOF >> ${PN}malloc.pc
|
62 |
|
Libs: -L\${libdir} -ltbbmalloc
|
63 |
|
Libs.private: -lm -lrt
|
64 |
|
EOF
|
65 |
|
cp ${PN}.pc.template ${PN}malloc_proxy.pc || die
|
66 |
|
cat <<-EOF >> ${PN}malloc_proxy.pc
|
67 |
|
Libs: -L\${libdir} -ltbbmalloc_proxy
|
68 |
|
Libs.private: -lrt
|
69 |
|
Requires: tbbmalloc
|
70 |
|
EOF
|
71 |
|
}
|
|
26 |
# should be in.. 2022?
|
|
27 |
"${FILESDIR}"/${PN}-2021.4.0-lto.patch
|
|
28 |
"${FILESDIR}"/${PN}-2021.5.0-musl-deepbind.patch
|
|
29 |
# bug 827883
|
|
30 |
"${FILESDIR}"/${PN}-2021.4.0-missing-TBB_machine_fetchadd4.patch
|
|
31 |
# need to verify this is in master
|
|
32 |
"${FILESDIR}"/${PN}-2021.5.0-musl-mallinfo.patch
|
|
33 |
# musl again, should be in.. 2022?
|
|
34 |
"${FILESDIR}"/${PN}-2021.5.0-musl-setcontext.patch
|
|
35 |
# should be in.. 2022?
|
|
36 |
"${FILESDIR}"/${PN}-2021.5.0-x86-mwaitpkg.patch
|
72 |
37 |
|
73 |
|
local_src_compile() {
|
74 |
|
cd "${S}"
|
75 |
|
|
76 |
|
local comp arch
|
77 |
|
local bt buildtypes
|
78 |
|
|
79 |
|
case ${MULTILIB_ABI_FLAG} in
|
80 |
|
abi_x86_64) arch=x86_64 ;;
|
81 |
|
abi_x86_32) arch=ia32 ;;
|
82 |
|
# abi_ppc_64) arch=ppc64 ;;
|
83 |
|
# abi_ppc_32) arch=ppc32 ;;
|
84 |
|
esac
|
85 |
|
|
86 |
|
case "$(tc-getCXX)" in
|
87 |
|
*clang*) comp="clang" ;;
|
88 |
|
*g++*) comp="gcc" ;;
|
89 |
|
*ic*c) comp="icc" ;;
|
90 |
|
*) die "compiler $(tc-getCXX) not supported by build system" ;;
|
91 |
|
esac
|
92 |
|
|
93 |
|
if use debug ; then
|
94 |
|
buildtypes="release debug"
|
95 |
|
else
|
96 |
|
buildtypes="release"
|
97 |
|
fi
|
98 |
|
|
99 |
|
for bt in ${buildtypes}; do
|
100 |
|
CXX="$(tc-getCXX)" \
|
101 |
|
CC="$(tc-getCC)" \
|
102 |
|
AS="$(tc-getAS)" \
|
103 |
|
arch=${arch} \
|
104 |
|
CPLUS_FLAGS="${CXXFLAGS}" \
|
105 |
|
emake compiler=${comp} work_dir="${BUILD_DIR}" tbb_root="${S}" cfg=${bt} $@
|
106 |
|
done
|
107 |
|
}
|
108 |
|
|
109 |
|
multilib_src_compile() {
|
110 |
|
local_src_compile tbb tbbmalloc
|
111 |
|
}
|
112 |
|
|
113 |
|
multilib_src_test() {
|
114 |
|
local_src_compile test
|
115 |
|
}
|
116 |
|
|
117 |
|
multilib_src_install() {
|
118 |
|
local bt
|
119 |
|
local buildtypes
|
120 |
|
if use debug ; then
|
121 |
|
buildtypes="release debug"
|
122 |
|
else
|
123 |
|
buildtypes="release"
|
124 |
|
fi
|
125 |
|
for bt in ${buildtypes}; do
|
126 |
|
cd "${BUILD_DIR}_${bt}" || die
|
127 |
|
local l
|
128 |
|
for l in $(find . -name lib\*$(get_libname \*)); do
|
129 |
|
dolib.so ${l}
|
130 |
|
local bl=$(basename ${l})
|
131 |
|
dosym ${bl} /usr/$(get_libdir)/${bl%%.*}$(get_libname)
|
132 |
|
done
|
133 |
|
done
|
134 |
|
|
135 |
|
cd "${BUILD_DIR}" || die
|
136 |
|
insinto /usr/$(get_libdir)/pkgconfig
|
137 |
|
doins *.pc
|
138 |
|
}
|
139 |
|
|
140 |
|
multilib_src_install_all() {
|
141 |
|
doheader -r include/*
|
|
38 |
"${FILESDIR}"/${PN}-2021.5.0-flags-stripping.patch
|
|
39 |
)
|
142 |
40 |
|
143 |
|
einstalldocs
|
|
41 |
src_configure() {
|
|
42 |
local mycmakeargs=(
|
|
43 |
-DTBB_TEST=$(usex test)
|
|
44 |
-DTBB_ENABLE_IPO=OFF
|
|
45 |
-DTBB_STRICT=OFF
|
|
46 |
)
|
144 |
47 |
|
145 |
|
if use examples ; then
|
146 |
|
dodoc -r examples
|
147 |
|
docinto examples/build
|
148 |
|
dodoc build/*.inc
|
149 |
|
docompress -x /usr/share/doc/${PF}/examples
|
150 |
|
fi
|
|
48 |
cmake-multilib_src_configure
|
151 |
49 |
}
|