#!/bin/bash ulimit -s unlimited shopt -s extglob # boost.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter for Slackware ARM. # # Copyright 2007, 2008, 2012 Eric Hameleers, Eindhoven, NL # Copyright 2007-2008, 2013, 2014, 2017 Heinz Wiesinger, Amsterdam, NL # Copyright 2008-2024 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # bjam-build system mostly taken from SlackBuild by Eric Hameleers # Script modified by Robby Workman - no copyright claims or added terms # Modified 2012 by Eric Hameleers for ARM port. ICU=${ICU:-no} # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: slackset_var_cwds # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD PYTHON3_VERSION=$(python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))') # Determine the CFLAGS for the known architectures: case $ARCH in arm) export SLKARMFLAGS="--disable-long-double" ;; esac # Extract source: echo "Extracting source.." tar xf $CWD/boost_*.tar.!(*sign|*asc|*sig) #tar xvvf $PORTCWD/sources/boost_$VERSION.tar.!(*sign|*asc|*sig) cd boost*/ || failextract slackhousekeeping # Apply patches: # Fix hardcorded python: zcat $CWD/boost.bootstrap.python3.diff.gz | patch -p1 --verbose || exit 1 # Avoid hardcoded /tmp/package-boost/ paths in the cmake files: cat $CWD/boost-1.73.0-cmakedir.patch | patch -p1 --verbose || exit 1 echo "****** Building bjam ********" # First build bjam, the boost build system: ./bootstrap.sh \ --with-toolset=gcc \ --with-icu \ --with-python=/usr/bin/python3 || failmake # Next, we build boost using bjam: echo "****** Building boost ********" ./b2 \ $NUMJOBS \ --layout=system \ --build-dir=tmp-build-directory \ --prefix=/usr \ --libdir=/usr/lib$LIBDIRSUFFIX \ --build-type=minimal \ toolset=gcc \ variant=release \ debug-symbols=off \ link=shared \ threading=multi \ runtime-link=shared \ python=$PYTHON3_VERSION \ cflags="$SLKCFLAGS" \ cxxflags="$SLKCFLAGS $EXTRA_CXXFLAGS" \ stage || failmake # And then install boost: echo "****** Installing boost ********" ./b2 \ $NUMJOBS \ --layout=system \ --build-dir=tmp-build-directory \ --prefix=$PKG/usr \ --libdir=$PKG/usr/lib$LIBDIRSUFFIX \ --build-type=minimal \ toolset=gcc \ variant=release \ debug-symbols=off \ link=shared \ threading=multi \ runtime-link=shared \ python=$PYTHON3_VERSION \ cflags="$SLKCFLAGS" \ cxxflags="$SLKCFLAGS $EXTRA_CXXFLAGS" \ install || failinstall # Copy documentation: mkdir -p $PKG/usr/doc/$PKGNAM-$PKG_VERSION # Do not copy 44MB of developer 'doc/html' into our package... cp -fav \ LICENSE* index.html \ $PKG/usr/doc/$PKGNAM-$PKG_VERSION # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slack_delete_lafiles # delete usr/lib{,64}/*.la slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh export VERSION="$( echo $VERSION | sed 's?_?.?g' )" export SLACKPACKAGE=$PKGNAM-$VERSION-$PKGARCH-$BUILD.txz slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links