1 # Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
2 # Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
3 # Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
4 # Contributor: Marius Knaust <marius.knaust@gmail.com>
5 # Contributor: Ionut Biru <ibiru@archlinux.org>
6 # Contributor: Stéphane Gaudreault <stephane@archlinux.org>
7 # Contributor: kevin <kevin@archlinux.org>
8 # Contributor: Giovanni Scafora <giovanni@archlinux.org>
9 # Contributor: Kritoke <kritoke@gamebox.net>
10 # Contributor: Luca Roccia <little_rock@users.sourceforge.net>
12 pkgname=('boost' 'boost-libs')
15 _srcname=boost_${pkgver//./_}
16 pkgdesc="Free peer-reviewed portable C++ source libraries"
18 url="https://www.boost.org/"
20 makedepends=('icu' 'python' 'python-numpy' 'bzip2' 'zlib' 'openmpi' 'zstd')
21 source=(https://boostorg.jfrog.io/artifactory/main/release/$pkgver/source/$_srcname.tar.gz
22 $pkgname-locale-empty-vector.patch::https://github.com/boostorg/locale/commit/1ff0ead837b3.patch
23 $pkgname-ublas-c++20-iterator.patch::https://github.com/boostorg/ublas/commit/a31e5cffa85f.patch)
24 sha256sums=('273f1be93238a068aba4f9735a4a2b003019af067b9c183ed227780b8f36062c'
25 '6c05bd362bc18908a7e23eec3b4a714f82c15c722bda4c340778e2f5b1a9bf25'
26 'aa38addb40d5f44b4a8472029b475e7e6aef1c460509eb7d8edf03491dc1b5ee')
31 # https://github.com/boostorg/locale/issues/52
32 patch -Np1 -d libs/locale <../$pkgname-locale-empty-vector.patch
34 # https://github.com/boostorg/ublas/pull/97
35 patch -Np2 -i ../$pkgname-ublas-c++20-iterator.patch
39 local JOBS="$(sed 's/.*\(-j *[0-9]\+\).*/\1/' <<<$MAKEFLAGS)"
41 pushd $_srcname/tools/build
42 ./bootstrap.sh --cxxflags="$CXXFLAGS $LDFLAGS"
43 ./b2 install --prefix="$srcdir"/fakeinstall
44 ln -s b2 "$srcdir"/fakeinstall/bin/bjam
48 ./bootstrap.sh --with-toolset=gcc --with-icu --with-python=python3
51 echo "using mpi ;" >>project-config.jam
53 # boostbook is needed by quickbook
54 install -dm755 "$srcdir"/fakeinstall/share/boostbook
55 cp -a tools/boostbook/{xsl,dtd} "$srcdir"/fakeinstall/share/boostbook/
57 # install to $srcdir/fakeinstall in preparation for split packaging
66 cflags="$CPPFLAGS $CFLAGS -fPIC -O3 -ffat-lto-objects" \
67 cxxflags="$CPPFLAGS $CXXFLAGS -fPIC -O3 -ffat-lto-objects" \
68 linkflags="$LDFLAGS" \
72 --prefix="$srcdir"/fakeinstall
76 pkgdesc+=' (development headers)'
77 depends=("boost-libs=$pkgver")
78 optdepends=('python: for python bindings')
79 options=('staticlibs')
81 install -d "$pkgdir"/usr/lib
82 cp -a fakeinstall/lib/*.a "$pkgdir"/usr/lib/
83 cp -a fakeinstall/lib/cmake "$pkgdir"/usr/lib/
84 cp -a fakeinstall/{bin,include,share} "$pkgdir"/usr/
86 install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" $_srcname/LICENSE_1_0.txt
89 package_boost-libs() {
90 pkgdesc+=' (runtime libraries)'
91 depends=('bzip2' 'zlib' 'icu' 'zstd')
92 optdepends=('openmpi: for mpi support')
93 provides=(libboost_atomic.so libboost_chrono.so libboost_container.so
94 libboost_context.so libboost_contract.so libboost_coroutine.so
95 libboost_date_time.so libboost_fiber.so libboost_filesystem.so
96 libboost_graph.so libboost_graph_parallel.so libboost_iostreams.so
97 libboost_json.so libboost_locale.so libboost_log.so libboost_log_setup.so
98 libboost_math_c99.so libboost_math_c99f.so libboost_math_c99l.so
99 libboost_math_tr1.so libboost_math_tr1f.so libboost_math_tr1l.so
100 libboost_mpi.so libboost_numpy310.so
101 libboost_prg_exec_monitor.so libboost_program_options.so
102 libboost_python310.so libboost_random.so
103 libboost_regex.so libboost_serialization.so
104 libboost_stacktrace_addr2line.so libboost_stacktrace_basic.so
105 libboost_stacktrace_noop.so libboost_system.so libboost_thread.so
106 libboost_timer.so libboost_type_erasure.so libboost_unit_test_framework.so
107 libboost_wave.so libboost_wserialization.so)
109 install -dm755 "$pkgdir"/usr/lib
110 cp -a fakeinstall/lib/*.so* "$pkgdir"/usr/lib/
112 # https://github.com/boostorg/mpi/issues/112
113 install -d "$pkgdir"/usr/lib/python3.10/site-packages/boost
114 touch "$pkgdir"/usr/lib/python3.10/site-packages/boost/__init__.py
115 python -m compileall -o 0 -o 1 -o 2 "$pkgdir"/usr/lib/python3.10/site-packages/boost
116 cp fakeinstall/lib/boost-python3.10/mpi.so \
117 "$pkgdir"/usr/lib/python3.10/site-packages/boost/mpi.so
119 # https://github.com/boostorg/python/issues/203#issuecomment-391477685
120 for _lib in python numpy; do
121 ln -srL "$pkgdir"/usr/lib/libboost_${_lib}3{10,}.so
124 install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" $_srcname/LICENSE_1_0.txt
127 # vim:set ts=2 sw=2 et: