void-packages/srcpkgs/libcxx/template

61 lines
1.8 KiB
Bash

# Template file for 'libcxx'
pkgname=libcxx
version=5.0.1
revision=1
build_style=cmake
hostmakedepends="clang llvm python"
makedepends="libcxxabi-devel llvm llvm-libunwind-devel"
case "$XBPS_TARGET_MACHINE" in
arm*)
_broken="libcxxabi doesn't build on arm."
;;
*)
configure_args+="
-DLIBCXX_CXX_ABI=libcxxabi
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON
-DLIBCXX_CXX_ABI_LIBRARY_PATH=${XBPS_CROSS_BASE}/usr/lib
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
"
LDFLAGS="-Wl,--no-as-needed -lunwind -Wl,--as-needed"
esac
case "$XBPS_TARGET_MACHINE" in
*-musl) configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
esac
make_build_args="VERBOSE=1"
short_desc="New implementation of the C++ standard library, targeting C++11"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://libcxx.llvm.org"
license="BSD"
distfiles="http://www.llvm.org/releases/${version}/${pkgname}-${version}.src.tar.xz"
checksum=fa8f99dd2bde109daa3276d529851a3bce5718d46ce1c5d0806f46caa3e57c00
wrksrc=${pkgname}-${version}.src
post_extract() {
case "$XBPS_TARGET_MACHINE" in
*-musl)
patch -Np1 <${FILESDIR}/libcxx-0001-musl-hacks.patch
sed -i 's/!defined(_GCC_MAX_ALIGN_T)/& \&\& !defined(__DEFINED_max_align_t)/' include/stddef.h
esac
}
pre_configure() {
export CC="clang"
export CXX="clang++"
if [ "$CROSS_BUILD" ]; then
for _gccdir in /usr/lib/gcc/$XBPS_CROSS_TRIPLET/*.*.*; do
CFLAGS+=" --target=$XBPS_CROSS_TRIPLET --sysroot=/usr/$XBPS_CROSS_TRIPLET -B$_gccdir"
CXXFLAGS+=" --target=$XBPS_CROSS_TRIPLET --sysroot=/usr/$XBPS_CROSS_TRIPLET -B$_gccdir"
LDFLAGS+=" -L$_gccdir"
done
fi
}
libcxx-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.so"
vmove "usr/lib/*.a"
}
}