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

Generated by cgit