Add android-boost-arm64-v8a
This commit is contained in:
parent
fb7d66642b
commit
b0b1cc38c0
|
@ -0,0 +1,155 @@
|
|||
# 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
|
||||
_android_arch=arm64-v8a
|
||||
_android_toolchain=aarch64-linux-android
|
||||
_android_prefix=/opt/android-libs/$_android_arch
|
||||
_android_ndk_path=/opt/android-ndk
|
||||
_android_api_level=21
|
||||
_android_platform=android-28/arch-arm64
|
||||
_boost_arch=arm
|
||||
_boost_address_model=64
|
||||
|
||||
pkgname=android-$_pkgname-$_android_arch
|
||||
pkgver=1.68.0
|
||||
_boostver=${pkgver//./_}
|
||||
pkgrel=1
|
||||
url='http://www.boost.org/'
|
||||
arch=('any')
|
||||
license=('custom')
|
||||
pkgdesc="Free peer-reviewed portable C++ source libraries (Android, $_android_arch)"
|
||||
depends=("boost-libs=${pkgver}" "android-libiconv-$_android_arch")
|
||||
options=(!buildflags staticlibs !strip !emptydirs)
|
||||
makedepends=('bzip2' 'zlib' 'android-ndk' 'android-sdk')
|
||||
source=(https://downloads.sourceforge.net/project/${_pkgname}/${_pkgname}/${pkgver}/${_pkgname}_${_boostver}.tar.bz2
|
||||
no-versioned-shlibs.patch)
|
||||
sha256sums=('7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7'
|
||||
'd82d0f15064812dcabb3456a7bcb1db0e0f6145980e4728e638372e0fd35af23')
|
||||
|
||||
prepare() {
|
||||
cd ${_pkgname}_${_boostver}
|
||||
patch -i ../no-versioned-shlibs.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
local _stagedir="${srcdir}/stagedir"
|
||||
local jobs="$(sed -e 's/.*\(-j *[0-9]\+\).*/\1/' <<< ${MAKEFLAGS})"
|
||||
local target_flags=" \
|
||||
--target=$_android_toolchain \
|
||||
--gcc-toolchain=$_android_ndk_path/toolchains/$_android_toolchain-4.9/prebuilt/linux-x86_64 \
|
||||
--sysroot=$_android_ndk_path/platforms/$_android_platform/usr"
|
||||
local common_flags=" \
|
||||
$target_flags \
|
||||
-isystem $_android_ndk_path/sources/android/support/include \
|
||||
-isystem $_android_ndk_path/sources/cxx-stl/llvm-libc++/include \
|
||||
-isystem $_android_ndk_path/sources/cxx-stl/llvm-libc++abi/include \
|
||||
-isystem $_android_ndk_path/sysroot/usr/include \
|
||||
-isystem $_android_ndk_path/sysroot/usr/include/$_android_toolchain \
|
||||
-funwind-tables \
|
||||
-no-canonical-prefixes \
|
||||
-D__ANDROID_API__=$_android_api_level \
|
||||
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1 \
|
||||
-D_FORTIFY_SOURCE=2 \
|
||||
-pipe \
|
||||
-fstack-protector-strong \
|
||||
--param=ssp-buffer-size=4 \
|
||||
-fPIE -fPIC -O3"
|
||||
local ld_flags=" \
|
||||
$target_flags \
|
||||
-Wl,-O1,--sort-common,--as-needed,-z,relro,-pie \
|
||||
$_android_ndk_path/sources/cxx-stl/llvm-libc++/libs/$_android_arch/libc++_shared.so"
|
||||
|
||||
cd ${_pkgname}_${_boostver}
|
||||
|
||||
./bootstrap.sh --with-toolset=gcc
|
||||
|
||||
_bindir="bin.linuxx86"
|
||||
[[ "${CARCH}" = "x86_64" ]] && _bindir="bin.linuxx86_64"
|
||||
install -Dm755 tools/build/src/engine/$_bindir/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/
|
||||
|
||||
export PATH=$_android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
|
||||
|
||||
# default "minimal" install: "release link=shared,static
|
||||
# runtime-link=shared threading=single,multi"
|
||||
# --layout=tagged will add the "-mt" suffix for multithreaded libraries
|
||||
# and installs includes in $_android_prefix/include/boost.
|
||||
# --layout=system no longer adds the -mt suffix for multi-threaded libs.
|
||||
# install to ${_stagedir} for consistency with regular boost package
|
||||
"${_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-signals \
|
||||
--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 \
|
||||
-sICONV_PATH="/opt/android-libs/$_android_arch" \
|
||||
cflags="$common_flags" \
|
||||
cxxflags="$common_flags -fexceptions -frtti -std=c++14 -stdlib=libc++" \
|
||||
linkflags="$ld_flags" \
|
||||
--layout=system \
|
||||
${jobs} \
|
||||
\
|
||||
--prefix="${_stagedir}" \
|
||||
install
|
||||
}
|
||||
|
||||
package() {
|
||||
local _stagedir="${srcdir}/stagedir"
|
||||
install -dm755 "${pkgdir}"$_android_prefix
|
||||
cp -a "${_stagedir}"/{include,share} "${pkgdir}"$_android_prefix
|
||||
|
||||
local libdir="${pkgdir}"$_android_prefix/lib
|
||||
install -d "${libdir}"
|
||||
cp -a "${_stagedir}"/lib/*.a "${libdir}"/
|
||||
|
||||
install -dm755 "${pkgdir}"$_android_prefix
|
||||
cp -a "${_stagedir}"/lib "${pkgdir}"$_android_prefix
|
||||
|
||||
install -Dm644 "${srcdir}/"${_pkgname}_${_boostver}/LICENSE_1_0.txt \
|
||||
"${pkgdir}"$_android_prefix/share/licenses/boost/LICENSE_1_0.txt
|
||||
|
||||
local strip=$_android_ndk_path/toolchains/$_android_toolchain-4.9/prebuilt/linux-x86_64/bin/$_android_toolchain-strip
|
||||
find "${libdir}" -iname '*.a' -exec $strip -g {} \;
|
||||
find "${libdir}" -iname '*.so' -exec $strip --strip-unneeded {} \;
|
||||
}
|
||||
|
||||
# vim: ts=2 sw=2 et:
|
|
@ -0,0 +1,11 @@
|
|||
--- boostcpp.jam.old 2018-08-01 22:50:40.000000000 +0200
|
||||
+++ boostcpp.jam 2018-10-07 01:48:30.175912524 +0200
|
||||
@@ -154,7 +154,7 @@
|
||||
# libFoo.1.2.3.dylib format. AIX linkers do not accept version suffixes
|
||||
# either. Pgi compilers can not accept a library with version suffix.
|
||||
if $(type) = SHARED_LIB &&
|
||||
- ! [ $(property-set).get <target-os> ] in windows cygwin darwin aix &&
|
||||
+ ! [ $(property-set).get <target-os> ] in windows cygwin darwin aix android &&
|
||||
! [ $(property-set).get <toolset> ] in pgi
|
||||
{
|
||||
result = $(result).$(BOOST_VERSION) ;
|
|
@ -0,0 +1,136 @@
|
|||
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
|
||||
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
|
||||
# Contributor: Marius Knaust <marius.knaust@gmail.com>
|
||||
# Contributor: Ionut Biru <ibiru@archlinux.org>
|
||||
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
|
||||
# Contributor: kevin <kevin@archlinux.org>
|
||||
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
|
||||
# Contributor: Kritoke <kritoke@gamebox.net>
|
||||
# Contributor: Luca Roccia <little_rock@users.sourceforge.net>
|
||||
|
||||
pkgbase=boost
|
||||
pkgname=('boost-libs' 'boost')
|
||||
pkgver=1.68.0
|
||||
_boostver=${pkgver//./_}
|
||||
pkgrel=1
|
||||
url='http://www.boost.org/'
|
||||
arch=('x86_64')
|
||||
license=('custom')
|
||||
makedepends=('icu' 'python' 'python2' 'python-numpy' 'python2-numpy' 'bzip2' 'zlib' 'openmpi')
|
||||
source=(https://downloads.sourceforge.net/project/${pkgbase}/${pkgbase}/${pkgver}/${pkgbase}_${_boostver}.tar.bz2)
|
||||
sha256sums=('7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7')
|
||||
|
||||
build() {
|
||||
export _stagedir="${srcdir}/stagedir"
|
||||
local JOBS="$(sed -e 's/.*\(-j *[0-9]\+\).*/\1/' <<< ${MAKEFLAGS})"
|
||||
|
||||
cd ${pkgbase}_${_boostver}
|
||||
|
||||
./bootstrap.sh --with-toolset=gcc --with-icu --with-python=/usr/bin/python2
|
||||
|
||||
_bindir="bin.linuxx86"
|
||||
[[ "${CARCH}" = "x86_64" ]] && _bindir="bin.linuxx86_64"
|
||||
install -Dm755 tools/build/src/engine/$_bindir/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
|
||||
# and installs includes in /usr/include/boost.
|
||||
# --layout=system no longer adds the -mt suffix for multi-threaded libs.
|
||||
# install to ${_stagedir} in preparation for split packaging
|
||||
"${_stagedir}"/bin/b2 \
|
||||
variant=release \
|
||||
debug-symbols=off \
|
||||
threading=multi \
|
||||
runtime-link=shared \
|
||||
link=shared,static \
|
||||
toolset=gcc \
|
||||
python=2.7 \
|
||||
cflags="${CPPFLAGS} ${CFLAGS} -fPIC -O3" \
|
||||
cxxflags="${CPPFLAGS} ${CXXFLAGS} -std=c++14 -fPIC -O3" \
|
||||
linkflags="${LDFLAGS}" \
|
||||
--layout=system \
|
||||
${JOBS} \
|
||||
\
|
||||
--prefix="${_stagedir}" \
|
||||
install
|
||||
|
||||
# because b2 in boost 1.62.0 doesn't seem to respect python parameter, we
|
||||
# need another run for liboost_python3.so
|
||||
sed -e '/using python/ s@;@: /usr/include/python${PYTHON_VERSION/3*/${PYTHON_VERSION}m} ;@' \
|
||||
-i bootstrap.sh
|
||||
|
||||
./bootstrap.sh --with-toolset=gcc --with-icu --with-python=/usr/bin/python3 \
|
||||
--with-libraries=python
|
||||
|
||||
"${_stagedir}"/bin/b2 clean
|
||||
"${_stagedir}"/bin/b2 \
|
||||
variant=release \
|
||||
debug-symbols=off \
|
||||
threading=multi \
|
||||
runtime-link=shared \
|
||||
link=shared,static \
|
||||
toolset=gcc \
|
||||
python=3.7 \
|
||||
cflags="${CPPFLAGS} ${CFLAGS} -fPIC -O3" \
|
||||
cxxflags="${CPPFLAGS} ${CXXFLAGS} -std=c++14 -fPIC -O3" \
|
||||
linkflags="${LDFLAGS}" \
|
||||
--layout=system \
|
||||
${JOBS} \
|
||||
\
|
||||
--prefix="${_stagedir}/python3" \
|
||||
--with-python \
|
||||
install
|
||||
}
|
||||
|
||||
package_boost() {
|
||||
pkgdesc='Free peer-reviewed portable C++ source libraries - development headers'
|
||||
depends=("boost-libs=${pkgver}")
|
||||
optdepends=('python: for python bindings'
|
||||
'python2: for python2 bindings')
|
||||
options=('staticlibs')
|
||||
|
||||
install -dm755 "${pkgdir}"/usr
|
||||
cp -a "${_stagedir}"/{bin,include,share} "${pkgdir}"/usr
|
||||
|
||||
install -d "${pkgdir}"/usr/lib
|
||||
cp -a "${_stagedir}"/lib/*.a "${pkgdir}"/usr/lib/
|
||||
|
||||
install -Dm644 "${srcdir}/"${pkgbase}_${_boostver}/LICENSE_1_0.txt \
|
||||
"${pkgdir}"/usr/share/licenses/boost/LICENSE_1_0.txt
|
||||
|
||||
install -Dm644 "${_stagedir}"/python3/lib/libboost_*.a \
|
||||
"${pkgdir}"/usr/lib/
|
||||
|
||||
ln -s /usr/bin/b2 "$pkgdir"/usr/bin/bjam
|
||||
}
|
||||
|
||||
package_boost-libs() {
|
||||
pkgdesc='Free peer-reviewed portable C++ source libraries - runtime libraries'
|
||||
depends=('bzip2' 'zlib' 'icu')
|
||||
optdepends=('openmpi: for mpi support')
|
||||
provides=('libboost_context.so')
|
||||
|
||||
install -dm755 "${pkgdir}"/usr
|
||||
cp -a "${_stagedir}"/lib "${pkgdir}"/usr
|
||||
cp -a "${_stagedir}"/python3/lib/libboost_* "${pkgdir}"/usr/lib
|
||||
rm "${pkgdir}"/usr/lib/*.a
|
||||
|
||||
# https://github.com/boostorg/python/issues/203#issuecomment-391477685
|
||||
for _lib in python numpy; do
|
||||
ln -srL "${pkgdir}"/usr/lib/libboost_${_lib}{27,}.so
|
||||
ln -srL "${pkgdir}"/usr/lib/libboost_${_lib}3{7,}.so
|
||||
done
|
||||
|
||||
install -Dm644 "${srcdir}/"${pkgbase}_${_boostver}/LICENSE_1_0.txt \
|
||||
"${pkgdir}"/usr/share/licenses/boost-libs/LICENSE_1_0.txt
|
||||
}
|
||||
|
||||
# vim: ts=2 sw=2 et:
|
Loading…
Reference in New Issue