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: dev-util/lldb/
Date: Wed, 03 Jan 2018 22:22:32
Message-Id: 1515018099.1742e5f90c62e76898802dcb1710ed683ab77ae0.mgorny@gentoo
1 commit: 1742e5f90c62e76898802dcb1710ed683ab77ae0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 3 21:23:48 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 3 22:21:39 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1742e5f9
7
8 dev-util/lldb: Add a live ebuild for 6.0 branch
9
10 dev-util/lldb/lldb-6.0.9999.ebuild | 122 +++++++++++++++++++++++++++++++++++++
11 1 file changed, 122 insertions(+)
12
13 diff --git a/dev-util/lldb/lldb-6.0.9999.ebuild b/dev-util/lldb/lldb-6.0.9999.ebuild
14 new file mode 100644
15 index 00000000000..002f1571b63
16 --- /dev/null
17 +++ b/dev-util/lldb/lldb-6.0.9999.ebuild
18 @@ -0,0 +1,122 @@
19 +# Copyright 1999-2018 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +
22 +EAPI=6
23 +
24 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
25 +# (needed due to CMAKE_BUILD_TYPE != Gentoo)
26 +CMAKE_MIN_VERSION=3.7.0-r1
27 +PYTHON_COMPAT=( python2_7 )
28 +
29 +inherit cmake-utils git-r3 llvm python-single-r1 toolchain-funcs
30 +
31 +DESCRIPTION="The LLVM debugger"
32 +HOMEPAGE="https://llvm.org/"
33 +SRC_URI=""
34 +EGIT_REPO_URI="https://git.llvm.org/git/lldb.git
35 + https://github.com/llvm-mirror/lldb.git"
36 +EGIT_BRANCH="release_60"
37 +
38 +LICENSE="UoI-NCSA"
39 +SLOT="0"
40 +KEYWORDS=""
41 +IUSE="libedit ncurses python test"
42 +RESTRICT="!test? ( test )"
43 +
44 +RDEPEND="
45 + libedit? ( dev-libs/libedit:0= )
46 + ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
47 + python? ( dev-python/six[${PYTHON_USEDEP}]
48 + ${PYTHON_DEPS} )
49 + ~sys-devel/clang-${PV}[xml]
50 + ~sys-devel/llvm-${PV}
51 + !<sys-devel/llvm-4.0"
52 +# swig-3.0.9+ generates invalid wrappers, #598708
53 +# upstream: https://github.com/swig/swig/issues/769
54 +DEPEND="${RDEPEND}
55 + python? ( <dev-lang/swig-3.0.9 )
56 + test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
57 + ${PYTHON_DEPS}"
58 +
59 +REQUIRED_USE=${PYTHON_REQUIRED_USE}
60 +
61 +# least intrusive of all
62 +CMAKE_BUILD_TYPE=RelWithDebInfo
63 +
64 +pkg_setup() {
65 + llvm_pkg_setup
66 + python-single-r1_pkg_setup
67 +}
68 +
69 +src_unpack() {
70 + if use test; then
71 + # needed for patched gtest
72 + git-r3_fetch "https://git.llvm.org/git/llvm.git
73 + https://github.com/llvm-mirror/llvm.git"
74 + fi
75 + git-r3_fetch
76 +
77 + if use test; then
78 + git-r3_checkout https://llvm.org/git/llvm.git \
79 + "${WORKDIR}"/llvm '' lib/Testing/Support utils/unittest
80 + fi
81 + git-r3_checkout
82 +}
83 +
84 +src_configure() {
85 + local mycmakeargs=(
86 + -DLLDB_DISABLE_CURSES=$(usex !ncurses)
87 + -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
88 + -DLLDB_DISABLE_PYTHON=$(usex !python)
89 + -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
90 +
91 + -DLLDB_INCLUDE_TESTS=$(usex test)
92 + -DLLVM_BUILD_TESTS=$(usex test)
93 + # compilers for lit tests
94 + -DLLDB_TEST_C_COMPILER="$(type -P clang)"
95 + -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
96 + # compiler for ole' python tests
97 + -DLLDB_TEST_COMPILER="$(type -P clang)"
98 +
99 + # TODO: fix upstream to detect this properly
100 + -DHAVE_LIBDL=ON
101 + -DHAVE_LIBPTHREAD=ON
102 +
103 + # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
104 + # and TERMINFO_LIBS... so just force FindCurses.cmake to use
105 + # ncurses with complete library set (including autodetection
106 + # of -ltinfo)
107 + -DCURSES_NEED_NCURSES=ON
108 + )
109 + use test && mycmakeargs+=(
110 + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
111 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
112 + -DLLVM_LIT_ARGS="-vv"
113 + )
114 +
115 + cmake-utils_src_configure
116 +}
117 +
118 +src_test() {
119 + cmake-utils_src_make check-lldb-lit
120 + use python && cmake-utils_src_make check-lldb
121 +}
122 +
123 +src_install() {
124 + cmake-utils_src_install
125 +
126 + # oh my...
127 + if use python; then
128 + # remove bundled six module
129 + rm "${D}$(python_get_sitedir)/six.py" || die
130 +
131 + # remove custom readline.so for now
132 + # TODO: figure out how to deal with it
133 + # upstream is basically building a custom readline.so with -ledit
134 + # to avoid symbol collisions between readline and libedit...
135 + rm "${D}$(python_get_sitedir)/readline.so" || die
136 +
137 + # byte-compile the modules
138 + python_optimize
139 + fi
140 +}