2019-09-18 18:01:38 +02:00
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
|
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
|
|
# you also find the URL of a binary repository.
|
|
|
|
|
|
|
|
_pkgname=boost
|
|
|
|
_pkg_arch=x86-64
|
|
|
|
_android_arch=x86_64
|
2020-05-02 18:33:31 +02:00
|
|
|
_boost_arch=x86
|
2019-09-18 18:01:38 +02:00
|
|
|
_boost_address_model=64
|
|
|
|
|
|
|
|
pkgname=android-$_pkg_arch-$_pkgname
|
2023-02-02 21:27:46 +01:00
|
|
|
pkgver=1.81.0
|
2021-06-12 00:31:34 +02:00
|
|
|
_srcname=boost_${pkgver//./_}
|
|
|
|
pkgrel=1
|
2019-09-18 18:01:38 +02:00
|
|
|
url='https://www.boost.org/'
|
|
|
|
arch=('any')
|
|
|
|
license=('custom')
|
|
|
|
pkgdesc="Free peer-reviewed portable C++ source libraries (Android, $_pkg_arch)"
|
|
|
|
depends=("android-$_pkg_arch-libiconv")
|
|
|
|
options=(!buildflags staticlibs !strip !emptydirs)
|
2023-03-25 21:14:04 +01:00
|
|
|
makedepends=('bzip2' 'zlib' 'android-ndk' 'android-sdk' 'android-environment')
|
2019-09-18 18:01:38 +02:00
|
|
|
conflicts=("android-$_pkgname-$_android_arch")
|
|
|
|
replaces=("android-$_pkgname-$_android_arch")
|
2021-06-12 00:31:34 +02:00
|
|
|
source=(https://boostorg.jfrog.io/artifactory/main/release/$pkgver/source/$_srcname.tar.gz
|
2023-02-02 21:27:46 +01:00
|
|
|
boost-1.81.0-phoenix-multiple-definitions.patch
|
2021-06-12 00:31:34 +02:00
|
|
|
$_pkgname-ublas-c++20-iterator.patch::https://github.com/boostorg/ublas/commit/a31e5cffa85f.patch
|
2023-02-02 21:27:46 +01:00
|
|
|
no-versioned-shlibs.patch
|
|
|
|
disable-version-check.patch)
|
2023-03-25 21:14:04 +01:00
|
|
|
sha256sums=('205666dea9f6a7cfed87c7a6dfbeb52a2c1b9de55712c9c1a87735d7181452b6'
|
2023-02-02 21:27:46 +01:00
|
|
|
'3ebf428ef6be090a7b56a233330375539ac429333b83708e28fe5db049cfecdb'
|
2021-06-12 00:31:34 +02:00
|
|
|
'aa38addb40d5f44b4a8472029b475e7e6aef1c460509eb7d8edf03491dc1b5ee'
|
2023-02-02 21:27:46 +01:00
|
|
|
'd82d0f15064812dcabb3456a7bcb1db0e0f6145980e4728e638372e0fd35af23'
|
2023-03-25 21:14:04 +01:00
|
|
|
'63d12e7d703b471882608b4225c489f6a35ab425602783a4f9c4ea99a10f9c4b')
|
2019-09-18 18:01:38 +02:00
|
|
|
|
|
|
|
prepare() {
|
2021-06-12 00:31:34 +02:00
|
|
|
cd ${_srcname}
|
2023-02-02 21:27:46 +01:00
|
|
|
# https://github.com/boostorg/phoenix/issues/111
|
|
|
|
patch -Np1 -i ../boost-1.81.0-phoenix-multiple-definitions.patch
|
|
|
|
|
2021-06-12 00:31:34 +02:00
|
|
|
# https://github.com/boostorg/ublas/pull/97
|
|
|
|
patch -Np2 -i ../$_pkgname-ublas-c++20-iterator.patch
|
|
|
|
|
2019-09-18 18:01:38 +02:00
|
|
|
patch -i ../no-versioned-shlibs.patch
|
2023-03-25 21:14:04 +01:00
|
|
|
patch -p1 -i ../disable-version-check.patch
|
2019-09-18 18:01:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2023-03-25 21:14:04 +01:00
|
|
|
source android-env ${_pkg_arch}
|
|
|
|
|
2019-09-18 18:01:38 +02:00
|
|
|
local _stagedir="${srcdir}/stagedir"
|
|
|
|
local jobs="$(sed -e 's/.*\(-j *[0-9]\+\).*/\1/' <<< ${MAKEFLAGS})"
|
|
|
|
local target_flags=" \
|
2023-03-25 21:14:04 +01:00
|
|
|
--target=${_pkg_arch}-linux-android$ANDROID_MINIMUM_PLATFORM --sysroot=$ANDROID_SYSROOT"
|
2019-09-18 18:01:38 +02:00
|
|
|
local common_flags=" \
|
|
|
|
$target_flags \
|
2020-10-06 16:38:15 +02:00
|
|
|
-fexceptions \
|
2023-03-25 21:14:04 +01:00
|
|
|
-DANDROID \
|
|
|
|
-O3 -DNDEBUG \
|
|
|
|
-D_FORTIFY_SOURCE=2 -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4 -fPIC \
|
2019-09-18 18:01:38 +02:00
|
|
|
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1"
|
|
|
|
local ld_flags=" \
|
|
|
|
$target_flags \
|
2023-03-25 21:14:04 +01:00
|
|
|
-fexceptions"
|
2019-09-18 18:01:38 +02:00
|
|
|
|
2021-06-12 00:31:34 +02:00
|
|
|
cd ${_srcname}
|
2019-09-18 18:01:38 +02:00
|
|
|
|
2023-03-25 21:14:04 +01:00
|
|
|
msg2 'Bootstrapping b2'
|
2019-09-18 18:01:38 +02:00
|
|
|
./bootstrap.sh --with-toolset=gcc
|
|
|
|
|
|
|
|
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
|
2023-03-25 21:14:04 +01:00
|
|
|
# and installs includes in $ANDROID_PREFIX/include/boost.
|
2019-09-18 18:01:38 +02:00
|
|
|
# --layout=system no longer adds the -mt suffix for multi-threaded libs.
|
|
|
|
# install to ${_stagedir} for consistency with regular boost package
|
2023-03-25 21:14:04 +01:00
|
|
|
msg2 'Invoking build via b2'
|
|
|
|
export PATH=$ANDROID_CROSS_PREFIX:$PATH
|
2019-09-18 18:01:38 +02:00
|
|
|
"${_stagedir}"/bin/b2 \
|
|
|
|
--with-atomic \
|
|
|
|
--with-chrono \
|
|
|
|
--with-container \
|
|
|
|
--with-date_time \
|
|
|
|
--with-exception \
|
|
|
|
--with-fiber \
|
|
|
|
--with-filesystem \
|
|
|
|
--with-graph \
|
|
|
|
--with-graph_parallel \
|
|
|
|
--with-iostreams \
|
|
|
|
--with-locale \
|
|
|
|
--with-log \
|
|
|
|
--with-math \
|
|
|
|
--with-mpi \
|
|
|
|
--with-program_options \
|
|
|
|
--with-random \
|
|
|
|
--with-regex \
|
|
|
|
--with-serialization \
|
|
|
|
--with-system \
|
|
|
|
--with-test \
|
|
|
|
--with-thread \
|
|
|
|
--with-timer \
|
|
|
|
--with-type_erasure \
|
|
|
|
--with-wave \
|
|
|
|
--with-stacktrace \
|
|
|
|
variant=release \
|
|
|
|
debug-symbols=off \
|
|
|
|
threading=multi \
|
|
|
|
runtime-link=shared \
|
|
|
|
link=shared,static \
|
|
|
|
target-os=android \
|
|
|
|
toolset=clang-android \
|
|
|
|
architecture=$_boost_arch \
|
|
|
|
address-model=$_boost_address_model \
|
2023-03-25 21:14:04 +01:00
|
|
|
-sICONV_PATH="$ANDROID_PREFIX" \
|
2019-09-18 18:01:38 +02:00
|
|
|
cflags="$common_flags" \
|
2023-03-25 21:14:04 +01:00
|
|
|
cxxflags="$common_flags -frtti -std=gnu++17" \
|
2019-09-18 18:01:38 +02:00
|
|
|
linkflags="$ld_flags" \
|
|
|
|
--layout=system \
|
|
|
|
${jobs} \
|
|
|
|
\
|
|
|
|
--prefix="${_stagedir}" \
|
|
|
|
install
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2023-03-25 21:14:04 +01:00
|
|
|
source android-env ${_pkg_arch}
|
|
|
|
|
2019-09-18 18:01:38 +02:00
|
|
|
local _stagedir="${srcdir}/stagedir"
|
2023-03-25 21:14:04 +01:00
|
|
|
install -dm755 "${pkgdir}$ANDROID_PREFIX"
|
|
|
|
cp -a "${_stagedir}"/{include,share} "${pkgdir}$ANDROID_PREFIX"
|
2019-09-18 18:01:38 +02:00
|
|
|
|
2023-03-25 21:14:04 +01:00
|
|
|
local libdir="${pkgdir}$ANDROID_PREFIX"/lib
|
2019-09-18 18:01:38 +02:00
|
|
|
install -d "${libdir}"
|
|
|
|
cp -a "${_stagedir}"/lib/*.a "${libdir}"/
|
|
|
|
|
2023-03-25 21:14:04 +01:00
|
|
|
install -dm755 "${pkgdir}$ANDROID_PREFIX"
|
|
|
|
cp -a "${_stagedir}"/lib "${pkgdir}$ANDROID_PREFIX"
|
2019-09-18 18:01:38 +02:00
|
|
|
|
2021-06-12 00:31:34 +02:00
|
|
|
install -Dm644 "${srcdir}/"${_srcname}/LICENSE_1_0.txt \
|
2023-03-25 21:14:04 +01:00
|
|
|
"${pkgdir}"/usr/share/licenses/$pkgname/LICENSE_1_0.txt
|
2019-09-18 18:01:38 +02:00
|
|
|
|
2023-03-25 21:14:04 +01:00
|
|
|
find "${libdir}" -iname '*.a' -exec $ANDROID_STRIP -g {} \;
|
|
|
|
find "${libdir}" -iname '*.so' -exec $ANDROID_STRIP --strip-unneeded {} \;
|
2019-09-18 18:01:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# vim: ts=2 sw=2 et:
|