Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxxabi/
Date: Wed, 05 Oct 2016 13:38:23
Message-Id: 1475674688.96e204a1d586f8e3bf563141dd9a6edd2bad3a1c.mgorny@gentoo
1 commit: 96e204a1d586f8e3bf563141dd9a6edd2bad3a1c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 3 10:53:56 2016 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 5 13:38:08 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96e204a1
7
8 sys-libs/libcxxabi: Initial live ebuild
9
10 sys-libs/libcxxabi/libcxxabi-9999.ebuild | 93 ++++++++++++++++++++++++++++++++
11 sys-libs/libcxxabi/metadata.xml | 10 ++++
12 2 files changed, 103 insertions(+)
13
14 diff --git a/sys-libs/libcxxabi/libcxxabi-9999.ebuild b/sys-libs/libcxxabi/libcxxabi-9999.ebuild
15 new file mode 100644
16 index 00000000..66de8aa
17 --- /dev/null
18 +++ b/sys-libs/libcxxabi/libcxxabi-9999.ebuild
19 @@ -0,0 +1,93 @@
20 +# Copyright 1999-2016 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +# $Id$
23 +
24 +EAPI=6
25 +
26 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
27 +EGIT_REPO_URI="http://llvm.org/git/libcxxabi.git
28 + https://github.com/llvm-mirror/libcxxabi.git"
29 +CMAKE_MIN_VERSION=3.4.3
30 +PYTHON_COMPAT=( python2_7 )
31 +
32 +inherit cmake-multilib git-r3 python-any-r1
33 +
34 +DESCRIPTION="Low level support for a standard C++ library"
35 +HOMEPAGE="http://libcxxabi.llvm.org/"
36 +SRC_URI=""
37 +
38 +LICENSE="|| ( UoI-NCSA MIT )"
39 +SLOT="0"
40 +KEYWORDS=""
41 +IUSE="libunwind +static-libs test"
42 +
43 +RDEPEND="
44 + libunwind? (
45 + || (
46 + >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
47 + sys-libs/llvm-libunwind[static-libs?,${MULTILIB_USEDEP}]
48 + )
49 + )"
50 +DEPEND="${RDEPEND}
51 + >=sys-devel/llvm-3.9.0
52 + test? ( >=sys-devel/clang-3.9.0
53 + ~sys-libs/libcxx-${PV}[libcxxabi(-)]
54 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )"
55 +
56 +python_check_deps() {
57 + has_version "dev-python/lit[${PYTHON_USEDEP}]"
58 +}
59 +
60 +pkg_setup() {
61 + use test && python-any-r1_pkg_setup
62 +}
63 +
64 +src_unpack() {
65 + # we need the headers
66 + git-r3_fetch "http://llvm.org/git/libcxx.git
67 + https://github.com/llvm-mirror/libcxx.git"
68 + git-r3_fetch
69 +
70 + git-r3_checkout http://llvm.org/git/libcxx.git \
71 + "${WORKDIR}"/libcxx
72 + git-r3_checkout
73 +}
74 +
75 +src_configure() {
76 + NATIVE_LIBDIR=$(get_libdir)
77 + cmake-multilib_src_configure
78 +}
79 +
80 +multilib_src_configure() {
81 + local libdir=$(get_libdir)
82 + local mycmakeargs=(
83 + -DLLVM_LIBDIR_SUFFIX=${NATIVE_LIBDIR#lib}
84 + -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib}
85 + -DLIBCXXABI_ENABLE_SHARED=ON
86 + -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
87 + -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind)
88 + -DLLVM_INCLUDE_TESTS=$(usex test)
89 +
90 + -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
91 + )
92 + if use test; then
93 + mycmakeargs+=(
94 + -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
95 + )
96 + fi
97 + cmake-utils_src_configure
98 +}
99 +
100 +multilib_src_test() {
101 + local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
102 +
103 + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
104 + sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
105 +
106 + cmake-utils_src_make check-libcxxabi
107 +}
108 +
109 +multilib_src_install_all() {
110 + insinto /usr/include/libcxxabi
111 + doins -r include/.
112 +}
113
114 diff --git a/sys-libs/libcxxabi/metadata.xml b/sys-libs/libcxxabi/metadata.xml
115 new file mode 100644
116 index 00000000..78c7d7d
117 --- /dev/null
118 +++ b/sys-libs/libcxxabi/metadata.xml
119 @@ -0,0 +1,10 @@
120 +<?xml version="1.0" encoding="UTF-8"?>
121 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
122 +<pkgmetadata>
123 + <maintainer type="project">
124 + <email>llvm@g.o</email>
125 + </maintainer>
126 + <use>
127 + <flag name="libunwind">Use libunwind instead of libgcc_s for stack unwinding, thus avoiding dependency on gcc</flag>
128 + </use>
129 +</pkgmetadata>