summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6c350599a8dda8cf1c970f8508f86c99547c19fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Maintainer: Robbert van der Helm <mail@robbertvanderhelm.nl>
# Contributor: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
# Contributor: Jan Was < janek.jan@gmail.com >
# Contributor: Dan Vratil <dan@progdan.cz>
# Contributor: andy123 < ajs AT online DOT de >

pkgname=lib32-boost-libs
pkgver=1.76.0
pkgrel=1
_srcname=boost_${pkgver//./_}
pkgdesc="Free peer-reviewed portable C++ source libraries - runtime libraries (32-bit)"
url="http://www.boost.org"
arch=('x86_64')
license=('custom')
groups=('lib32')
makedepends=('lib32-icu' 'lib32-bzip2' 'lib32-zlib' 'lib32-zstd' 'python')
depends=('lib32-bzip2' 'lib32-zlib' 'lib32-icu' 'lib32-zstd')
provides=(libboost_atomic.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_prg_exec_monitor.so libboost_program_options.so
          libboost_random.so libboost_regex.so libboost_serialization.so
          libboost_stacktrace_addr2line.so libboost_stacktrace_basic.so
          libboost_stacktrace_noop.so libboost_system.so libboost_thread.so
          libboost_timer.so libboost_type_erasure.so libboost_unit_test_framework.so
          libboost_wave.so libboost_wserialization.so)
options=('staticlibs')
source=(https://boostorg.jfrog.io/artifactory/main/release/$pkgver/source/$_srcname.tar.gz
        boost-ublas-c++20-iterator.patch::https://github.com/boostorg/ublas/commit/a31e5cffa85f.patch)
sha256sums=('7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca'
            'aa38addb40d5f44b4a8472029b475e7e6aef1c460509eb7d8edf03491dc1b5ee')

# This version of lib32-boost-libs does not include support OpenMPI or the
# Python bindings since there are no (up to date) lib32 packages available for
# them

prepare() {
   cd $_srcname

   # https://github.com/boostorg/ublas/pull/97
   patch -Np2 -i ../boost-ublas-c++20-iterator.patch
}

build() {
  local JOBS="$(sed 's/.*\(-j *[0-9]\+\).*/\1/' <<<$MAKEFLAGS)"

  # We need b2 before we can compile Boost itself, but this should just be built
  # for the native architecture
  pushd $_srcname/tools/build
  ./bootstrap.sh --cxxflags="$CXXFLAGS $LDFLAGS"
  ./b2 install --prefix="$srcdir"/fakeinstall
  ln -s b2 "$srcdir"/fakeinstall/bin/bjam
  popd

  export CC='gcc'
  export CFLAGS+=' -m32'
  export CXX='g++'
  export CXXFLAGS+=' -m32'
  export LDFLAGS+=' -m32'
  export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

  cd $_srcname
  # There are currently no up to date lib32-python packages available
  ./bootstrap.sh --with-toolset=gcc --with-icu --with-python=

  # Same for OpenMPI
  # # 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/

  # Since we're sticking to the original PKGBUILD we'll still do this
  # fakeinstall thing, even though we're generating only one package
  # install to $srcdir/fakeinstall in preparation for split packaging
  ./b2 install \
    variant=release \
    debug-symbols=off \
    threading=multi \
    runtime-link=shared \
    link=shared,static \
    toolset=gcc \
    address-model=32 \
    --without-python \
    --without-mpi \
    cflags="$CPPFLAGS $CFLAGS -fPIC -O3" \
    cxxflags="$CPPFLAGS $CXXFLAGS -fPIC -O3" \
    linkflags="$LDFLAGS" \
    --layout=system \
    $JOBS \
    \
    --prefix="$srcdir"/fakeinstall
}

package() {
  # We're including both static libraries and shared objects here. The regular
  # boost package splits those between the `boost` and `boost-libs` packages.
  install -dm755 "${pkgdir}"/usr/lib32
  cp -a fakeinstall/lib/* "${pkgdir}"/usr/lib32

  # This would be needed if built with Python support
  # # https://github.com/boostorg/mpi/issues/112
  # install -d "$pkgdir"/usr/lib/python3.9/site-packages/boost
  # touch "$pkgdir"/usr/lib/python3.9/site-packages/boost/__init__.py
  # python -m compileall -o 0 -o 1 -o 2 "$pkgdir"/usr/lib/python3.9/site-packages/boost
  # cp fakeinstall/lib/boost-python3.9/mpi.so \
  #   "$pkgdir"/usr/lib32/python3.9/site-packages/boost/mpi.so

  # # https://github.com/boostorg/python/issues/203#issuecomment-391477685
  # for _lib in python numpy; do
  #   ln -srL "$pkgdir"/usr/lib32/libboost_${_lib}3{9,}.so
  # done

  install -Dm644 $_srcname/LICENSE_1_0.txt \
     "${pkgdir}"/usr/share/licenses/lib32-boost-libs/LICENSE_1_0.txt
}