archrelease: copy trunk to testing-x86_64
[arch-packages.git] / boost / trunk / PKGBUILD
blobcc9af55dd5ba5d7d4ab39ca3d2d9ee563505adf9
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')
13 pkgver=1.81.0
14 pkgrel=5
15 _srcname=boost_${pkgver//./_}
16 pkgdesc="Free peer-reviewed portable C++ source libraries"
17 arch=('x86_64')
18 url="https://www.boost.org/"
19 license=('custom')
20 makedepends=('icu' 'python' 'python-numpy' 'bzip2' 'zlib' 'openmpi' 'zstd')
21 source=(https://boostorg.jfrog.io/artifactory/main/release/$pkgver/source/$_srcname.tar.bz2
22         boost-1.81.0-phoenix-multiple-definitions.patch
23         $pkgname-ublas-c++20-iterator.patch::https://github.com/boostorg/ublas/commit/a31e5cffa85f.patch)
24 sha256sums=('71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa'
25             '3ebf428ef6be090a7b56a233330375539ac429333b83708e28fe5db049cfecdb'
26             'aa38addb40d5f44b4a8472029b475e7e6aef1c460509eb7d8edf03491dc1b5ee')
28 prepare() {
29   cd $_srcname
31   # https://github.com/boostorg/phoenix/issues/111
32   patch -Np1 -i ../boost-1.81.0-phoenix-multiple-definitions.patch
34   # https://github.com/boostorg/ublas/pull/97
35   patch -Np2 -i ../$pkgname-ublas-c++20-iterator.patch
38 build() {
39   local JOBS="$(sed 's/.*\(-j *[0-9]\+\).*/\1/' <<<$MAKEFLAGS)"
40   local python_version=$(
41     python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
43   pushd $_srcname/tools/build
44   ./bootstrap.sh --cxxflags="$CXXFLAGS $LDFLAGS"
45   ./b2 install --prefix="$srcdir"/fakeinstall
46   ln -s b2 "$srcdir"/fakeinstall/bin/bjam
47   popd
49   cd $_srcname
50   ./bootstrap.sh --with-toolset=gcc --with-icu --with-python=python3
52   # support for OpenMPI
53   echo "using mpi ;" >>project-config.jam
55   # boostbook is needed by quickbook
56   install -dm755 "$srcdir"/fakeinstall/share/boostbook
57   cp -a tools/boostbook/{xsl,dtd} "$srcdir"/fakeinstall/share/boostbook/
59   # install to $srcdir/fakeinstall in preparation for split packaging
60   ./b2 install \
61     variant=release \
62     debug-symbols=off \
63     threading=multi \
64     runtime-link=shared \
65     link=shared,static \
66     toolset=gcc \
67     python=$python_version \
68     cflags="$CPPFLAGS $CFLAGS -fPIC -O3 -ffat-lto-objects" \
69     cxxflags="$CPPFLAGS $CXXFLAGS -fPIC -O3 -ffat-lto-objects" \
70     linkflags="$LDFLAGS" \
71     --layout=system \
72     $JOBS \
73     \
74     --prefix="$srcdir"/fakeinstall
77 package_boost() {
78   local python_version=$(
79     python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
81   pkgdesc+=' (development headers)'
82   depends=("boost-libs=$pkgver")
83   optdepends=('python: for python bindings')
84   options=('staticlibs')
86   install -d "$pkgdir"/usr/lib
87   cp -a fakeinstall/lib/*.{a,so} "$pkgdir"/usr/lib/
88   cp -a fakeinstall/lib/cmake "$pkgdir"/usr/lib/
89   cp -a fakeinstall/{bin,include,share} "$pkgdir"/usr/
91   # https://github.com/boostorg/python/issues/203#issuecomment-391477685
92   for _lib in python numpy; do
93     ln -srL "$pkgdir"/usr/lib/libboost_${_lib}{${python_version/.},${python_version%.*}}.so
94   done
96   install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" $_srcname/LICENSE_1_0.txt
99 package_boost-libs() {
100   local python_version=$(
101     python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
103   pkgdesc+=' (runtime libraries)'
104   depends=('bzip2' 'zlib' 'icu' 'zstd')
105   optdepends=('openmpi: for mpi support')
106   provides=(libboost_atomic.so libboost_chrono.so libboost_container.so
107     libboost_context.so libboost_contract.so libboost_coroutine.so
108     libboost_date_time.so libboost_fiber.so libboost_filesystem.so
109     libboost_graph.so libboost_graph_parallel.so libboost_iostreams.so
110     libboost_json.so libboost_locale.so libboost_log.so libboost_log_setup.so
111     libboost_math_c99.so libboost_math_c99f.so libboost_math_c99l.so
112     libboost_math_tr1.so libboost_math_tr1f.so libboost_math_tr1l.so
113     libboost_mpi{,_python${python_version/.}}.so libboost_nowide.so
114     libboost_numpy${python_version/.}.so libboost_prg_exec_monitor.so
115     libboost_program_options.so libboost_python${python_version/.}.so
116     libboost_random.so libboost_regex.so libboost_serialization.so
117     libboost_stacktrace_addr2line.so libboost_stacktrace_basic.so
118     libboost_stacktrace_noop.so libboost_system.so libboost_thread.so
119     libboost_timer.so libboost_type_erasure.so libboost_unit_test_framework.so
120     libboost_url.so libboost_wave.so libboost_wserialization.so)
122   install -dm755 "$pkgdir"/usr/lib
123   cp -a fakeinstall/lib/*.so.* "$pkgdir"/usr/lib/
125   # https://github.com/boostorg/mpi/issues/112
126   local site_packages=$(python -c 'import site; print(site.getsitepackages()[0])')
127   install -d "$pkgdir"$site_packages/boost
128   touch "$pkgdir"$site_packages/boost/__init__.py
129   python -m compileall -o 0 -o 1 -o 2 "$pkgdir"$site_packages/boost
130   cp fakeinstall/lib/boost-python*/mpi.so "$pkgdir"$site_packages/boost/mpi.so
132   install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" $_srcname/LICENSE_1_0.txt
135 # vim:set ts=2 sw=2 et: