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