Files
extra/boost/PKGBUILD
2025-06-22 20:39:04 -05:00

128 lines
4.6 KiB
Bash

# Maintainer: Jesus E. <heckyel@riseup.net>
pkgbase=boost
pkgname=('boost-libs' 'boost')
pkgver=1.71.0
_debver=$pkgver
_debrel=7
_boostver=${pkgver//./_}
pkgrel=4
pkgdesc="Free and libre peer-reviewed portable C++ source libraries"
url='https://www.boost.org/'
arch=('i686' 'x86_64')
license=('Boost-1.0')
makedepends=('icu' 'python' 'python-numpy' 'bzip2' 'zlib' 'openmpi' 'findutils' 'quilt')
source=("https://repo.hyperbola.info:50000/sources/${pkgbase}/boost_${_boostver}.tar.bz2"{,.sig}
"https://repo.hyperbola.info:50000/sources/${pkgbase}/boost1.71_${_debver}-${_debrel}.debian.tar.xz"{,.sig})
sha512sums=('b7937d50c4512cf13cadd0ca829de36cf2cbc6fb788f45b1d4565ad0753e2b206c545125a5862016c2f16016f2e4a6b687928963b466fff17c3e0a4437142c20'
'SKIP'
'e08c46914bfc9945c4a351d6fcae9621d07886246c31f8b4930bc3b9ce4074749f56779e8671e06e9e22c8eab273e2226cf4a5cbbcb2413eab0c69c9a2d0e4e5'
'SKIP')
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
prepare() {
cd ${pkgbase}_${_boostver}
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
# Doesn't apply and seems unimportant
rm -v debian/patches/36a81359f0af5607872d20d4fdc94e9bccdd0911.patch || true
rm -v debian/patches/92e1131fb00c5fd16911ea98777b872dbd0181b1.patch || true
rm -v debian/patches/b90917eaedf5ef977dea8ab0f11a92e3e09a4cbb.patch || true
rm -v debian/patches/e0ba57928d681c9f8e0b28eef2a17973950b9e8b.patch || true
rm -v debian/patches/boostorg-program_options-pull-59.patch || true
rm -v debian/patches/context-s390x.patch || true
rm -v debian/patches/fix_linux_detection.patch || true
rm -v debian/patches/fix-riscv64-non-pic.patch || true
rm -v debian/patches/hppa-long-double-config.patch || true
rm -v debian/patches/make-docs-use-offline-resources-only.patch || true
rm -v debian/patches/ppc64el-fp_traits-ibm-long-double.patch || true
rm -v debian/patches/s390x-arch.patch || true
quilt push -av
fi
}
build() {
export _stagedir="${srcdir}/stagedir"
local JOBS="$(sed -e 's/.*\(-j *[0-9]\+\).*/\1/' <<< ${MAKEFLAGS})"
cd ${pkgbase}_${_boostver}
./bootstrap.sh --with-toolset=gcc --with-icu
install -Dm755 tools/build/src/engine/b2 "${_stagedir}"/bin/b2
# Support for OpenMPI
echo "using mpi ;" >> project-config.jam
# boostbook is needed by quickbook
install -dm755 "${_stagedir}"/share/boostbook
cp -a tools/boostbook/{xsl,dtd} "${_stagedir}"/share/boostbook/
# default "minimal" install: "release link=shared,static
# runtime-link=shared threading=single,multi"
# --layout=tagged will add the "-mt" suffix for multithreaded libraries
# and installs includes in /usr/include/boost.
# --layout=system no longer adds the -mt suffix for multi-threaded libs.
# install to ${_stagedir} in preparation for split packaging
"${_stagedir}"/bin/b2 \
variant=release \
debug-symbols=off \
threading=multi \
runtime-link=shared \
link=shared,static \
toolset=gcc \
cflags="${CPPFLAGS} ${CFLAGS} -fPIC -O3" \
cxxflags="${CPPFLAGS} ${CXXFLAGS} -std=c++14 -fPIC -O3" \
linkflags="${LDFLAGS}" \
--layout=system \
${JOBS} \
\
--prefix="${_stagedir}" \
install
}
package_boost() {
pkgdesc+=' - development headers'
depends=("boost-libs=${pkgver}")
optdepends=('python: for python bindings')
options=('staticlibs')
install -dm755 "${pkgdir}"/usr
cp -a "${_stagedir}"/{bin,include,share} "${pkgdir}"/usr
install -d "${pkgdir}"/usr/lib
cp -a "${_stagedir}"/lib/*.a "${pkgdir}"/usr/lib/
cp -a "${_stagedir}"/lib/cmake "${pkgdir}"/usr/lib/
install -Dm644 "${srcdir}/"${pkgbase}_${_boostver}/LICENSE_1_0.txt \
"${pkgdir}"/usr/share/licenses/boost/LICENSE_1_0.txt
ln -s /usr/bin/b2 "$pkgdir"/usr/bin/bjam
}
package_boost-libs() {
pkgdesc+=' - runtime libraries'
depends=('bzip2' 'zlib' 'icu')
optdepends=('openmpi: for mpi support')
install -dm755 "${pkgdir}"/usr
cp -a "${_stagedir}"/lib "${pkgdir}"/usr
rm "${pkgdir}"/usr/lib/*.a
rm -r "${pkgdir}"/usr/lib/cmake
# https://github.com/boostorg/python/issues/203#issuecomment-391477685
for _lib in python numpy; do
ln -srL "${pkgdir}"/usr/lib/libboost_${_lib}3{8,}.so
done
install -Dm644 "${srcdir}/"${pkgbase}_${_boostver}/LICENSE_1_0.txt \
"${pkgdir}"/usr/share/licenses/boost-libs/LICENSE_1_0.txt
}