# Maintainer: Natanael Copa pkgname=boost pkgver=1.71.0 _pkgver="${pkgver//./_}" pkgrel=1 pkgdesc="Free peer-reviewed portable C++ source libraries" url="http://www.boost.org/" arch="all" license="custom" depends="$pkgname-libs" depends_dev="$pkgname linux-headers" makedepends="$depends_dev python2-dev>=2.6 python3-dev>=3.8 flex bison bzip2-dev icu-dev xz-dev zlib-dev" subpackages="$pkgname-static $pkgname-dev $pkgname-doc" source="https://dl.bintray.com/boostorg/release/$pkgver/source/boost_$_pkgver.tar.bz2 boost-1.57.0-python-abi_letters.patch boost-1.57.0-python-libpython_dep.patch " options="!checkroot" builddir="$srcdir/${pkgname}_$_pkgver" _enginedir="tools/build/src/engine" _bjam="$builddir"/$_enginedir/b2 _libs=" atomic chrono container context contract coroutine date_time fiber filesystem graph iostreams locale log_setup log math prg_exec_monitor program_options python3 python2 random regex serialization stacktrace_basic stacktrace_noop system thread timer type_erasure unit_test_framework wave wserialization " for _lib in $_libs; do subpackages="$subpackages $pkgname-${_lib}:_boostlib" done; unset -v _lib subpackages="$subpackages $pkgname-libs" _set_options() { [ -n "$PY2_VERSION" ] || PY2_VERSION="$(_pyversion python2)" [ -n "$PY3_VERSION" ] || PY3_VERSION="$(_pyversion python3)" local _options_python="${PY2_VERSION:+$PY2_VERSION,}$PY3_VERSION" [ -z "$_options_python" ] || _options_python="python=$_options_python" _options=" --user-config=\"$builddir/user-config.jam\" --prefix=\"$pkgdir/usr\" release $_options_python toolset=gcc debug-symbols=off threading=multi runtime-link=shared link=shared,static cflags=-fno-strict-aliasing --layout=system -q -j${JOBS:-2} $_options_carch " } prepare() { default_prepare _set_options local abiflags="$(python3-config --abiflags)" # create user-config.jam cat > user-config.jam <<-__EOF__ using gcc : : $CC : "$CXXFLAGS" "$LDFLAGS" ; using python : ${PY2_VERSION:+$PY2_VERSION }: /usr/bin/python2 : ${PY2_VERSION:+/usr/include/python${PY2_VERSION} }: : : : ; using python : ${PY3_VERSION:+$PY3_VERSION }: /usr/bin/python3 : ${PY3_VERSION:+/usr/include/python${PY3_VERSION}${abiflags} }: : : : ${abiflags:+$abiflags }; __EOF__ } build() { export BOOST_ROOT="$builddir" msg "Building bjam" cd "$builddir"/$_enginedir CC= ./build.sh gcc msg "Building bcp" cd "$builddir"/tools/bcp "$_bjam" -j${JOBS:-2} msg "Building boost" cd "$builddir" _set_options "$_bjam" $_options } check() { cd "$builddir"/tools/build/test PATH="${_bjam%/*}:$PATH" python2 test_all.py --default-bjam } package() { export BOOST_ROOT="$builddir" _set_options install -Dm755 "$_bjam" \ "$pkgdir"/usr/bin/b2 ln -s b2 "$pkgdir"/usr/bin/bjam # old name for b2 binary install -Dm755 dist/bin/bcp "$pkgdir"/usr/bin/bcp install -Dm644 LICENSE_1_0.txt \ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE_1_0.txt "$pkgdir"/usr/bin/bjam $_options \ --includedir="$pkgdir"/usr/include \ --libdir="$pkgdir"/usr/lib \ install } static() { pkgdesc="Boost static libraries" depends="$depends_static" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/lib*.a "$subpkgdir"/usr/lib/ } _boostlib() { local name="${subpkgname#$pkgname-}" pkgdesc="Boost $name shared library" depends="$depends__boostlib" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libboost_$name*.so.[0-9]* "$subpkgdir"/usr/lib/ } libs() { default_libs pkgdesc="Boost shared libraries" depends="$depends_libs" local _pkg; for _pkg in $origsubpackages; do case "$_pkg" in *:_boostlib) depends="$depends ${_pkg%%:*}" ;; esac done mkdir -p "$subpkgdir" rmdir "$pkgdir"/usr/lib >/dev/null 2>&1 || : } _pyversion() { "$1" -c 'import sys; print("%i.%i" % (sys.version_info.major, sys.version_info.minor))' } sha512sums="b7937d50c4512cf13cadd0ca829de36cf2cbc6fb788f45b1d4565ad0753e2b206c545125a5862016c2f16016f2e4a6b687928963b466fff17c3e0a4437142c20 boost_1_71_0.tar.bz2 d96d4d37394a31764ed817d0bc4a99cffa68a75ff1ecfd4417b9e1e5ae2c31a96ed24f948c6f2758ffdac01328d2402c4cf0d33a37107e4f5f721e636daebd66 boost-1.57.0-python-abi_letters.patch 132c4b62815d605c2d3c9038427fa4f422612a33711d47b2862f2311516af8a371d6b75bf078a7bffe20be863f8d21fb9fe74dc1a1bac3a10d061e9768ec3e02 boost-1.57.0-python-libpython_dep.patch"