From faf1bfcbbbce89efb048be6aa7705006a0befa4f Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 7 Jul 2020 16:09:09 +0200 Subject: [PATCH] boost: Provide developer packages with libraries Sometimes older C++ software won't build with the newest boost, so 1.63 from December 2016 was added too. --- boost-1.63.0-0.build.sh | 67 +++++++++++++++++++++++++++++++++++++++++ boost-1.73.0-0.build.sh | 67 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100755 boost-1.63.0-0.build.sh create mode 100755 boost-1.73.0-0.build.sh diff --git a/boost-1.63.0-0.build.sh b/boost-1.63.0-0.build.sh new file mode 100755 index 0000000..2063028 --- /dev/null +++ b/boost-1.63.0-0.build.sh @@ -0,0 +1,67 @@ +#! /bin/bash + +# COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 1; exec bash /dev/shm/runme-$COOKIE.sh +# TESTING=1 + +PKG=boost +VERSION=1.63.0 +VERSION_USCORED=1_63_0 +BUILD=0 +PYTHONPKG=python-3.6.6-1 + +PREFIX=/pkg/$PKG-$VERSION-$BUILD +if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi + +PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin + +set -xe +umask 022 + +BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp +test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) +mkdir -p $BUILD_TMPDIR/home +export TMPDIR=$BUILD_TMPDIR +export HOME=$BUILD_TMPDIR/home + +exec $PREFIX/profile <<-EOF + if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi +EOF + +source $PREFIX/profile + +B2FLAGS="-j $(($(nproc)*4/5+1))" + +BUILDDIR=$PREFIX/build + +mkdir -p $BUILDDIR +cd $BUILDDIR + +test -e boost_$VERSION_USCORED.tar.gz || wget --no-verbose https://beehive.molgen.mpg.de/7b493c08bc9557bbde7e29091f28b605/boost_1_63_0.tar.gz +test -d boost_$VERSION_USCORED || tar -xf boost_$VERSION_USCORED.tar.gz +cd boost_$VERSION_USCORED + +# since --with-python-version=3.Xm doesn't work, +# cram the right include into the jam file... (nerve) +sed -i -e '/^\s\+includes.*prefix.*include.*python/ s/python$(version)/python3.6m/' ./tools/build/src/tools/python.jam + +./bootstrap.sh \ + --prefix=${PREFIX} \ + --with-python=/pkg/$PYTHONPKG/bin/python3 + +./b2 \ + $B2FLAGS \ + --prefix=$PREFIX \ + --enable-shared \ + --without-mpi \ + install + +# someday I'll find out how to set LDFLAGS in boost +cd $PREFIX/lib +for SO in *$VERSION ; do + patchelf --set-rpath $PREFIX/lib $SO +done + +exit diff --git a/boost-1.73.0-0.build.sh b/boost-1.73.0-0.build.sh new file mode 100755 index 0000000..c79bd58 --- /dev/null +++ b/boost-1.73.0-0.build.sh @@ -0,0 +1,67 @@ +#! /bin/bash + +# COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 1; exec bash /dev/shm/runme-$COOKIE.sh +# TESTING=1 + +PKG=boost +VERSION=1.73.0 +VERSION_USCORED=1_73_0 +BUILD=0 +PYTHONPKG=python-3.7.7-0 + +PREFIX=/pkg/$PKG-$VERSION-$BUILD +if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi + +PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin + +set -xe +umask 022 + +BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp +test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) +mkdir -p $BUILD_TMPDIR/home +export TMPDIR=$BUILD_TMPDIR +export HOME=$BUILD_TMPDIR/home + +exec $PREFIX/profile <<-EOF + if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi +EOF + +source $PREFIX/profile + +B2FLAGS="-j $(($(nproc)*4/5+1))" + +BUILDDIR=$PREFIX/build + +mkdir -p $BUILDDIR +cd $BUILDDIR + +test -e boost_$VERSION_USCORED.tar.gz || wget --no-verbose https://beehive.molgen.mpg.de/4036cd27ef7548b8d29c30ea10956196/boost_1_73_0.tar.gz +test -d boost_$VERSION_USCORED || tar -xf boost_$VERSION_USCORED.tar.gz +cd boost_$VERSION_USCORED + +# since --with-python-version=3.Xm doesn't work, +# cram the right include into the jam file... (nerve) +sed -i -e '/^\s\+includes.*prefix.*include.*python/ s/python$(version)/python3.7m/' ./tools/build/src/tools/python.jam + +./bootstrap.sh \ + --prefix=${PREFIX} \ + --with-python=/pkg/$PYTHONPKG/bin/python3 + +./b2 \ + $B2FLAGS \ + --prefix=$PREFIX \ + --enable-shared \ + --without-mpi \ + install + +# someday I'll find out how to set LDFLAGS in boost +cd $PREFIX/lib +for SO in *$VERSION ; do + patchelf --set-rpath $PREFIX/lib $SO +done + +exit