void-packages/srcpkgs/libcxx/template
2016-12-23 19:25:11 +01:00

66 lines
1.8 KiB
Bash

# Template file for 'libcxx'
pkgname=libcxx
version=3.9.1
revision=1
build_style=cmake
case "$XBPS_TARGET_MACHINE" in
arm*)
# libcxxabi doesn't build on arm.
;;
*)
configure_args+=" -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON"
makedepends="llvm-libunwind-devel libcxxabi-devel"
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=25e615e428f60e651ed09ffd79e563864e3f4bc69a9e93ee41505c419d1a7461
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
}
post_configure() {
(
mkdir -p ${wrksrc}/build-static
cd ${wrksrc}/build-static
if [ "$CROSS_BUILD" ]; then
cp ${wrksrc}/build/cross_${XBPS_CROSS_TRIPLET}.cmake .
fi
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \
${configure_args} -DLIBCXX_ENABLE_SHARED=OFF ..
)
}
post_build() {
(
cd ${wrksrc}/build-static
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
)
}
post_install() {
(
cd ${wrksrc}/build-static
${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
)
}
libcxx-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.so"
vmove "usr/lib/*.a"
}
}