blob: 451ea8a65c0499cb3a194be1db325e7e0fd201ec (
plain)
1 # Description: Free peer-reviewed portable C++ source libraries.
2 # URL: https://www.boost.org/
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Depends on: bzip2 zstd
5 # Optional: icu openmpi python3-numpy
6
7 name=boost
8 version=1.81.0
9 release=1
10 source=(https://boostorg.jfrog.io/artifactory/main/release/$version/source/${name}_${version//./_}.tar.bz2
11 boost-ublas-c++20-iterator.patch)
12
13 build() {
14 cd ${name}_${version//./_}
15
16 # https://github.com/boostorg/ublas/pull/97
17 patch -p2 -i $SRC/boost-ublas-c++20-iterator.patch
18
19 # Boost.Build does not allow for disabling of numpy
20 # extensions, thereby leading to automagic numpy
21 # https://github.com/boostorg/python/issues/111#issuecomment-280447482
22 prt-get isinst python3-numpy || sed \
23 -e 's/\[ unless \[ python\.numpy \] : <build>no \]/<build>no/g' \
24 -i libs/python/build/Jamfile
25
26 pushd tools/build
27 ./bootstrap.sh --cxxflags="$CXXFLAGS $LDFLAGS"
28 ./b2 install --prefix=$PKG/usr
29 ln -s b2 $PKG/usr/bin/bjam
30 popd
31
32 # Boost.Build does not allow for disabling of numpy
33 # extensions, thereby leading to automagic numpy
34 # https://github.com/boostorg/python/issues/111#issuecomment-280447482
35 prt-get isinst python3-numpy || sed \
36 -e 's/\[ unless \[ python\.numpy \] : <build>no \]/<build>no/g' \
37 -i libs/python/build/Jamfile
38
39 ./bootstrap.sh --with-toolset=gcc --with-python=/usr/bin/python3
40
41 # support for OpenMPI
42 prt-get isinst openmpi && echo "using mpi ;" >>project-config.jam || PKGMK_BOOST+=' --without-mpi --without-graph_parallel'
43 prt-get isinst icu || PKGMK_BOOST+=' --disable-icu boost.locale.icu=off'
44
45 ./b2 install ${PKGMK_BOOST} \
46 --prefix=$PKG/usr \
47 --layout=system \
48 --without-stacktrace \
49 -j ${JOBS-1} \
50 variant=release \
51 debug-symbols=off \
52 threading=multi \
53 runtime-link=shared \
54 link=shared,static \
55 toolset=gcc \
56 python=$(/usr/bin/python3 -c 'import sys; print("%s.%s" % sys.version_info[:2])') \
57 cflags="$CPPFLAGS $CFLAGS -fPIC -O3 -ffat-lto-objects" \
58 cxxflags="$CPPFLAGS $CXXFLAGS -fPIC -O3 -ffat-lto-objects" \
59 linkflags="$LDFLAGS"
60
61 prt-get isinst python3-numpy || rm -r $PKG/usr/include/boost/python/numpy*
62 prt-get isinst openmpi || rm -r $PKG//usr/include/boost/mpi/python*
63 }
|