PKGBUILDs/extra/boost/PKGBUILD

174 lines
5.8 KiB
Bash
Raw Normal View History

2024-09-02 19:25:17 +00:00
# Maintainer: Evangelos Foutras <foutrelis@archlinux.org>
# Maintainer: Christian Heusel <gromit@archlinux.org>
2021-06-10 12:48:30 +00:00
# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
2018-09-21 18:59:40 +00:00
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
2017-07-13 12:46:49 +00:00
# Contributor: Marius Knaust <marius.knaust@gmail.com>
2015-12-23 18:59:16 +00:00
# Contributor: Ionut Biru <ibiru@archlinux.org>
2014-09-07 14:39:43 +00:00
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
2013-03-26 21:59:17 +00:00
# Contributor: kevin <kevin@archlinux.org>
2011-01-19 05:10:54 +00:00
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Kritoke <kritoke@gamebox.net>
2011-01-19 05:10:54 +00:00
# Contributor: Luca Roccia <little_rock@users.sourceforge.net>
2012-07-23 16:34:01 +00:00
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2015-07-11 04:21:02 +00:00
# - specify arm architecture to b2 for aarch64
2011-01-19 05:10:54 +00:00
2021-06-10 12:48:30 +00:00
pkgname=('boost' 'boost-libs')
2024-09-02 19:25:17 +00:00
pkgver=1.86.0
2024-09-07 01:45:16 +00:00
pkgrel=2
2021-06-10 12:48:30 +00:00
_srcname=boost_${pkgver//./_}
pkgdesc="Free peer-reviewed portable C++ source libraries"
2017-11-17 23:24:12 +00:00
arch=('x86_64')
2021-06-10 12:48:30 +00:00
url="https://www.boost.org/"
2024-09-02 19:25:17 +00:00
license=('BSL-1.0')
2021-06-10 12:48:30 +00:00
makedepends=('icu' 'python' 'python-numpy' 'bzip2' 'zlib' 'openmpi' 'zstd')
2024-09-07 01:45:16 +00:00
source=(
https://boostorg.jfrog.io/artifactory/main/release/$pkgver/source/$_srcname.tar.bz2
$pkgname-numpy-2.0.patch::https://github.com/boostorg/python/commit/0474de0f6cc9.patch
$pkgname-1_86_0-fix-compute-header_patch_1.patch::https://github.com/boostorg/compute/commit/79452d5279831ee59a650c17b71259a821f1a554.patch
$pkgname-1_86_0-fix-compute-header_patch_2.patch::https://github.com/boostorg/compute/commit/f8e5e3543723379bb6a9dd9d88415a993653e70a.patch
)
2024-09-02 19:25:17 +00:00
sha256sums=('1bed88e40401b2cb7a1f76d4bab499e352fa4d0c5f31c0dbae64e24d34d7513b'
2024-09-07 01:45:16 +00:00
'ccda8ef8126c93f4c8d29ba43b5f301952e5eacdc7fecb2ae3d01115a2222c53'
'20e8017cd5d237157af578d4279c264418bb8f92471ba2efa1dc2e8e980addd8'
'a8c2b93129cb9c39c1ab30a6f3140e21f3fbfa23ededa039ab328331498293c7')
2020-12-09 22:43:50 +00:00
prepare() {
2021-06-10 12:48:30 +00:00
cd $_srcname
2020-12-09 22:43:50 +00:00
2024-06-26 09:16:05 +00:00
# support building against NumPy 2.0
patch -Np1 -d libs/python <../$pkgname-numpy-2.0.patch
2024-09-07 01:45:16 +00:00
# https://gitlab.archlinux.org/archlinux/packaging/packages/boost/-/issues/3
patch -Np2 < ../$pkgname-1_86_0-fix-compute-header_patch_1.patch
patch -Np2 < ../$pkgname-1_86_0-fix-compute-header_patch_2.patch
2020-12-09 22:43:50 +00:00
}
2014-01-09 22:37:29 +00:00
build() {
2021-06-10 12:48:30 +00:00
local JOBS="$(sed 's/.*\(-j *[0-9]\+\).*/\1/' <<<$MAKEFLAGS)"
2023-01-22 20:29:43 +00:00
local python_version=$(
python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
2021-06-10 12:48:30 +00:00
pushd $_srcname/tools/build
./bootstrap.sh --cxxflags="$CXXFLAGS $LDFLAGS"
./b2 install --prefix="$srcdir"/fakeinstall
ln -s b2 "$srcdir"/fakeinstall/bin/bjam
popd
cd $_srcname
./bootstrap.sh --with-toolset=gcc --with-icu --with-python=python3
# support for OpenMPI
echo "using mpi ;" >>project-config.jam
# boostbook is needed by quickbook
install -dm755 "$srcdir"/fakeinstall/share/boostbook
cp -a tools/boostbook/{xsl,dtd} "$srcdir"/fakeinstall/share/boostbook/
# install to $srcdir/fakeinstall in preparation for split packaging
./b2 install \
architecture=arm \
variant=release \
debug-symbols=off \
threading=multi \
runtime-link=shared \
link=shared,static \
toolset=gcc \
2023-01-22 20:29:43 +00:00
python=$python_version \
2021-06-10 12:48:30 +00:00
cflags="$CPPFLAGS $CFLAGS -fPIC -O3" \
cxxflags="$CPPFLAGS $CXXFLAGS -fPIC -O3" \
linkflags="$LDFLAGS" \
--layout=system \
$JOBS \
\
--prefix="$srcdir"/fakeinstall
2011-01-19 05:10:54 +00:00
}
package_boost() {
2023-05-03 23:23:20 +00:00
local python_version=$(
python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
2021-06-10 12:48:30 +00:00
pkgdesc+=' (development headers)'
depends=("boost-libs=$pkgver")
optdepends=('python: for python bindings')
options=('staticlibs')
2014-01-09 22:37:29 +00:00
2021-06-10 12:48:30 +00:00
install -d "$pkgdir"/usr/lib
2022-09-19 01:29:09 +00:00
cp -a fakeinstall/lib/*.{a,so} "$pkgdir"/usr/lib/
2021-06-10 12:48:30 +00:00
cp -a fakeinstall/lib/cmake "$pkgdir"/usr/lib/
cp -a fakeinstall/{bin,include,share} "$pkgdir"/usr/
2014-01-09 22:37:29 +00:00
2022-09-19 23:50:57 +00:00
# https://github.com/boostorg/python/issues/203#issuecomment-391477685
for _lib in python numpy; do
2023-05-03 23:23:20 +00:00
ln -srL "$pkgdir"/usr/lib/libboost_${_lib}{${python_version/.},${python_version%.*}}.so
2022-09-19 23:50:57 +00:00
done
2011-01-19 05:10:54 +00:00
}
package_boost-libs() {
2023-05-03 23:23:20 +00:00
local python_version=$(
python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
2021-06-10 12:48:30 +00:00
pkgdesc+=' (runtime libraries)'
depends=('bzip2' 'zlib' 'icu' 'zstd')
optdepends=('openmpi: for mpi support')
2024-09-02 19:25:17 +00:00
provides=(
libboost_atomic.so
libboost_charconv.so
libboost_chrono.so
libboost_container.so
libboost_context.so
libboost_contract.so
libboost_coroutine.so
libboost_date_time.so
libboost_fiber.so
libboost_filesystem.so
libboost_graph.so
libboost_graph_parallel.so
libboost_iostreams.so
libboost_json.so
libboost_locale.so
libboost_log.so
libboost_log_setup.so
libboost_math_c99.so
libboost_math_c99f.so
libboost_math_c99l.so
libboost_math_tr1.so
libboost_math_tr1f.so
libboost_math_tr1l.so
libboost_mpi{,_python${python_version/.}}.so
libboost_nowide.so
libboost_numpy${python_version/.}.so
libboost_prg_exec_monitor.so
libboost_process.so
libboost_program_options.so
libboost_python${python_version/.}.so
libboost_random.so
libboost_regex.so
libboost_serialization.so
libboost_stacktrace_addr2line.so
libboost_stacktrace_basic.so
libboost_stacktrace_from_exception.so
libboost_stacktrace_noop.so
libboost_system.so
libboost_thread.so
libboost_timer.so
libboost_type_erasure.so
libboost_unit_test_framework.so
libboost_url.so
libboost_wave.so
libboost_wserialization.so
)
2021-06-10 12:48:30 +00:00
install -dm755 "$pkgdir"/usr/lib
2022-09-19 01:29:09 +00:00
cp -a fakeinstall/lib/*.so.* "$pkgdir"/usr/lib/
2021-06-10 12:48:30 +00:00
# https://github.com/boostorg/mpi/issues/112
2023-01-22 20:29:43 +00:00
local site_packages=$(python -c 'import site; print(site.getsitepackages()[0])')
install -d "$pkgdir"$site_packages/boost
touch "$pkgdir"$site_packages/boost/__init__.py
python -m compileall -o 0 -o 1 -o 2 "$pkgdir"$site_packages/boost
cp fakeinstall/lib/boost-python*/mpi.so "$pkgdir"$site_packages/boost/mpi.so
2011-01-19 05:10:54 +00:00
}
2018-09-21 18:59:40 +00:00
2021-06-10 12:48:30 +00:00
# vim:set ts=2 sw=2 et: