From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B5660138330 for ; Wed, 7 Sep 2016 07:36:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 29D7421C264; Wed, 7 Sep 2016 07:36:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8D3AA21C264 for ; Wed, 7 Sep 2016 07:35:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CEB6A33D3CF for ; Wed, 7 Sep 2016 07:35:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DCDD5247B for ; Wed, 7 Sep 2016 07:35:51 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1473233743.edbcba87f78cc4b316e7fa1a3db36fb34bd11486.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-libs/libcxx/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: sys-libs/libcxx/Manifest sys-libs/libcxx/libcxx-3.8.1.ebuild sys-libs/libcxx/metadata.xml X-VCS-Directories: sys-libs/libcxx/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: edbcba87f78cc4b316e7fa1a3db36fb34bd11486 X-VCS-Branch: master Date: Wed, 7 Sep 2016 07:35:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8620733c-1529-4333-bb54-767bf322661b X-Archives-Hash: 8dc6d87a9b180264ec60cc81d0b304be commit: edbcba87f78cc4b316e7fa1a3db36fb34bd11486 Author: Fabian Groffen gentoo org> AuthorDate: Wed Sep 7 07:33:59 2016 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Wed Sep 7 07:35:43 2016 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=edbcba87 sys-libs/libcxx: sync to 3.8.1 version Package-Manager: portage-2.2.28-prefix sys-libs/libcxx/Manifest | 1 + sys-libs/libcxx/libcxx-3.8.1.ebuild | 240 ++++++++++++++++++++++++++++++++++++ sys-libs/libcxx/metadata.xml | 5 +- 3 files changed, 245 insertions(+), 1 deletion(-) diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest index 11bf65d..507db25 100644 --- a/sys-libs/libcxx/Manifest +++ b/sys-libs/libcxx/Manifest @@ -1,2 +1,3 @@ DIST libcxx-3.5.1.src.tar.xz 912248 SHA256 a16d0ae0c0cf2c8cebb94fafcb907022cd4f8579ebac99a4c9919990a37ad475 SHA512 3be33787c79aa5d03a3f507be20ef986215d6008e4f0370e3c5906d76a620bf27c9ed4c35f4561c1ac507a1b217fa7fc7577611e7205f3f2433c677bf86b8632 WHIRLPOOL 725892f113a918168b8ae8b5e93401130ccb1080c207445ba943c4fc06e481002939d37cfbbb59dc2791f91ccd7c673274ee523ec96418ed04ca22c8d11e2bec DIST libcxx-3.7.1.src.tar.xz 995724 SHA256 357fbd4288ce99733ba06ae2bec6f503413d258aeebaab8b6a791201e6f7f144 SHA512 08d2399a8b36aa15290733256c896c9fa43f1a1223bc5c73bbcd014fddf8880e514d2a6dcc456bcf18b537c01fb6911b092e6d9958bccd8e64e9f375ed7a1ab9 WHIRLPOOL 19f77946abf48cbdd3e7ea21fd009ca3cc5f607dfe0512a44b102847044bb1d5ae4b16f503f18b14ebd9ea115256e87af07409907ba2a65f6061e217a502a359 +DIST libcxx-3.8.1.src.tar.xz 1074164 SHA256 77d7f3784c88096d785bd705fa1bab7031ce184cd91ba8a7008abf55264eeecc SHA512 782ff3cdb85d02e92404e943474d0266ff601725c202f0667d60e7807f1ba3cfdebbdb062e27a52fec96be1c99339044be93a88ba7e396682f98d99c9ac175b2 WHIRLPOOL a729c44060972edee79b0019fd4c6c23fa56dd625e564f4c5965682d9fc79be4094df0643f67c5d2ffa3ae3c743c892c3c9ba19719b2307aada35775f64ed104 diff --git a/sys-libs/libcxx/libcxx-3.8.1.ebuild b/sys-libs/libcxx/libcxx-3.8.1.ebuild new file mode 100644 index 0000000..10fac31 --- /dev/null +++ b/sys-libs/libcxx/libcxx-3.8.1.ebuild @@ -0,0 +1,240 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id $ + +EAPI=5 + +ESVN_REPO_URI="http://llvm.org/svn/llvm-project/libcxx/trunk" + +[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM="" + +inherit ${SCM} flag-o-matic toolchain-funcs multilib multilib-minimal + +DESCRIPTION="New implementation of the C++ standard library, targeting C++11" +HOMEPAGE="http://libcxx.llvm.org/" +if [ "${PV%9999}" = "${PV}" ] ; then + SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz" + S="${WORKDIR}/${P}.src" +else + SRC_URI="" +fi + +LICENSE="|| ( UoI-NCSA MIT )" +SLOT="0" +if [ "${PV%9999}" = "${PV}" ] ; then + KEYWORDS="~x64-macos ~x86-macos" +else + KEYWORDS="" +fi +IUSE="elibc_glibc +libcxxrt static-libs test" + +REQUIRED_USE="kernel_Darwin? ( libcxxrt !static-libs )" +RDEPEND=" + !kernel_Darwin? ( + libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[static-libs?,${MULTILIB_USEDEP}] ) + !libcxxrt? ( >=sys-devel/gcc-4.7[cxx] ) + ) + kernel_Darwin? ( + =sys-libs/libcxx-headers-${PV} + =sys-libs/libcxxabi-${PV} + sys-devel/clang + )" +DEPEND="${RDEPEND} + test? ( sys-devel/clang ) + app-arch/xz-utils" + +DOCS=( CREDITS.TXT ) + +pkg_setup() { + if [[ ${CHOST} == *darwin* ]] ; then + MY_CC=$(tc-getCC) + MY_CXX=$(tc-getCXX) + if [[ ${MY_CC} != *clang* || ${MY_CXX} != *clang++* ]] ; then + eerror "${PN} needs to be built with clang++. Please do not override" + eerror "CC ($MY_CC) and CXX ($MY_CXX)" + eerror "or point them at clang and clang++ respectively." + die + fi + return + fi + if ! use libcxxrt ; then + ewarn "You have disabled USE=libcxxrt. This will build ${PN} against" + ewarn "libsupc++. Please note that this is not well supported." + ewarn "In particular, static linking will not work." + fi + if [[ $(gcc-version) < 4.7 ]] && [[ $(tc-getCXX) != *clang++* ]] ; then + eerror "${PN} needs to be built with clang++ or gcc-4.7 or later." + eerror "Please use gcc-config to switch to gcc-4.7 or later version." + die + fi +} + +src_prepare() { + cp -f "${FILESDIR}/Makefile" lib/ || die + + if [[ ${CHOST} == *darwin* ]] ; then + epatch "${FILESDIR}"/${PN}-3.5.1-olddarwin.patch + + [[ "${CHOST##*-darwin}" -le 10 ]] && \ + epatch "${FILESDIR}"/${PN}-3.5.1-cmath-conv.patch + + # libc++abi needs stack unwinding functions provided by libSystem on + # Mac OS X >= 10.6. On < 10.6 they're in libgcc_s. So force link + # against that. Additionally, the crt1.o provided by our gcc-apple + # toolchain isn't universal. Since that's needed for linking any + # program on OS X < 10.7, universal support is effectively broken on + # those older OS Xes even if clang and libc++{,abi} were to support it. + # So we can just disable universal compilation. + gcc_s=gcc_s.1 + [[ "${CHOST##*-darwin}" -eq 9 ]] && gcc_s=gcc_s.10.5 + [[ "${CHOST##*-darwin}" -eq 8 ]] && gcc_s=gcc_s.10.4 + [[ "${CHOST##*-darwin}" -le 9 ]] && \ + sed -i -e "s,/usr/lib/libSystem.B.dylib,-lSystem -l${gcc_s},g" \ + -e "s,-arch i386 -arch x86_64,,g" \ + lib/buildit + + if [[ "${CHOST##*-darwin}" -le 8 ]] ; then + epatch "${FILESDIR}"/${PN}-3.5.1-availability.patch + epatch "${FILESDIR}"/${PN}-3.5.1-eprintf.patch + fi + + # fix library install names + sed -i \ + -e "s,/usr/lib/libc++abi\.dylib,${EPREFIX}/usr/lib/libc++abi.dylib,g" \ + -e "s,/usr/lib/libc++\.1\.dylib,${EPREFIX}/usr/lib/libc++.1.dylib,g" \ + lib/buildit + fi + + multilib_copy_sources +} + +src_configure() { + tc-export AR CC CXX + + # on Darwin we're all set + [[ ${CHOST} == *darwin* ]] && return + + export LIBS="-lpthread -lrt -lc -lgcc_s" + if use libcxxrt ; then + append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/" + LIBS="-lcxxrt ${LIBS}" + cp "${EPREFIX}/usr/include/libcxxrt/"*.h "${S}/include" + else + # Very hackish, see $HOMEPAGE + # If someone has a clever idea, please share it! + local includes="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | sed -e 's/^ /-I/' | tr '\n' ' ')" + local libcxx_gcc_dirs="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | tr '\n' ' ')" + append-cppflags -D__GLIBCXX__ ${includes} + LIBS="-lsupc++ ${LIBS}" + local libsupcxx_includes="cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h bits/cxxabi_tweaks.h bits/cxxabi_forced.h" + for i in ${libsupcxx_includes} ; do + local found="" + [ -d "${S}/include/$(dirname ${i})/" ] || mkdir -p "${S}/include/$(dirname ${i})" + for j in ${libcxx_gcc_dirs} ; do + if [ -f "${j}/${i}" ] ; then + cp "${j}/${i}" "${S}/include/$(dirname ${i})/" || die + found=yes + fi + done + [ -n "${found}" ] || die "Header not found: ${i}" + done + fi + + append-ldflags "-Wl,-z,defs" # make sure we are not underlinked +} + +multilib_src_compile() { + cd "${BUILD_DIR}/lib" || die + if [[ ${CHOST} == *darwin* ]] ; then + TRIPLE=-apple- ./buildit || die + return + fi + + emake shared + use static-libs && emake static +} + +# Tests fail for now, if anybody is able to fix them, help is very welcome. +multilib_src_test() { + cd "${BUILD_DIR}/test" + LD_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}" \ + CC="clang++ $(get_abi_CFLAGS) ${CXXFLAGS}" \ + HEADER_INCLUDE="-I${BUILD_DIR}/include" \ + SOURCE_LIB="-L${BUILD_DIR}/lib" \ + LIBS="-lm $(usex libcxxrt -lcxxrt "")" \ + ./testit || die + # TODO: fix link against libsupc++ +} + +# Usage: deps +gen_ldscript() { + local output_format + output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') + [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" + + cat <<-END_LDSCRIPT +/* GNU ld script + Include missing dependencies +*/ +${output_format} +GROUP ( $@ ) +END_LDSCRIPT +} + +gen_static_ldscript() { + if use libcxxrt ; then + # Move it first. + mv "${ED}/usr/$(get_libdir)/libc++.a" "${ED}/usr/$(get_libdir)/libc++_static.a" || die + + # Generate libc++.a ldscript for inclusion of its dependencies so that + # clang++ -stdlib=libc++ -static works out of the box. + local deps="${EPREFIX}/usr/$(get_libdir)/libc++_static.a ${EPREFIX}/usr/$(get_libdir)/libcxxrt.a" + # On Linux/glibc it does not link without libpthread or libdl. It is + # fine on FreeBSD. + use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a" + + gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a" + fi + # TODO: Generate a libc++.a ldscript when building against libsupc++ +} + +gen_shared_ldscript() { + if use libcxxrt ; then + mv "${ED}/usr/$(get_libdir)/libc++.so" "${ED}/usr/$(get_libdir)/libc++_shared.so" || die + local deps="${EPREFIX}/usr/$(get_libdir)/libc++_shared.so ${EPREFIX}/usr/$(get_libdir)/libcxxrt.so" + gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so" + fi + # TODO: Generate the linker script for other confiurations too. +} + +multilib_src_install() { + cd "${BUILD_DIR}/lib" + if [[ ${CHOST} == *darwin* ]] ; then + dolib.so libc++*dylib + return + fi + + if use static-libs ; then + dolib.a libc++.a + gen_static_ldscript + fi + dolib.so libc++.so* + gen_shared_ldscript +} + +multilib_src_install_all() { + einstalldocs + # libc++abi needs the libc++ headers and we need libc++abi so the headers + # are already installed + [[ ${CHOST} == *darwin* ]] && return + insinto /usr/include/c++/v1 + doins -r include/* +} + +pkg_postinst() { + elog "This package (${PN}) is mainly intended as a replacement for the C++" + elog "standard library when using clang." + elog "To use it, instead of libstdc++, use:" + elog " clang++ -stdlib=libc++" + elog "to compile your C++ programs." +} diff --git a/sys-libs/libcxx/metadata.xml b/sys-libs/libcxx/metadata.xml index 6795d17..4269b68 100644 --- a/sys-libs/libcxx/metadata.xml +++ b/sys-libs/libcxx/metadata.xml @@ -1,7 +1,10 @@ - prefix + + prefix@gentoo.org + Prefix Project + Build against sys-libs/libcxxr