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, 16 Jan 2019 14:52:56
Message-Id: 1547650353.41d617dd0179b3eb55a2434434f9d3673346cbe6.mgorny@gentoo
1 commit: 41d617dd0179b3eb55a2434434f9d3673346cbe6
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 16 13:50:12 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 16 14:52:33 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41d617dd
7
8 dev-util/lldb: Add a live ebuild for 8.* branch
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-util/lldb/lldb-8.0.9999.ebuild | 118 +++++++++++++++++++++++++++++++++++++
13 1 file changed, 118 insertions(+)
14
15 diff --git a/dev-util/lldb/lldb-8.0.9999.ebuild b/dev-util/lldb/lldb-8.0.9999.ebuild
16 new file mode 100644
17 index 00000000000..d16b057b1e9
18 --- /dev/null
19 +++ b/dev-util/lldb/lldb-8.0.9999.ebuild
20 @@ -0,0 +1,118 @@
21 +# Copyright 1999-2019 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=6
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=( python2_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_80"
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? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
58 + ${PYTHON_DEPS}"
59 +
60 +REQUIRED_USE=${PYTHON_REQUIRED_USE}
61 +
62 +# least intrusive of all
63 +CMAKE_BUILD_TYPE=RelWithDebInfo
64 +
65 +pkg_setup() {
66 + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
67 + python-single-r1_pkg_setup
68 +}
69 +
70 +src_unpack() {
71 + if use test; then
72 + # needed for patched gtest
73 + git-r3_fetch "https://git.llvm.org/git/llvm.git
74 + https://github.com/llvm-mirror/llvm.git"
75 + fi
76 + git-r3_fetch
77 +
78 + if use test; then
79 + git-r3_checkout https://llvm.org/git/llvm.git \
80 + "${WORKDIR}"/llvm '' lib/Testing/Support utils/unittest
81 + fi
82 + git-r3_checkout
83 +}
84 +
85 +src_configure() {
86 + local mycmakeargs=(
87 + -DLLDB_DISABLE_CURSES=$(usex !ncurses)
88 + -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
89 + -DLLDB_DISABLE_PYTHON=$(usex !python)
90 + -DLLDB_USE_SYSTEM_SIX=1
91 + -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
92 +
93 + -DLLDB_INCLUDE_TESTS=$(usex test)
94 +
95 + # TODO: fix upstream to detect this properly
96 + -DHAVE_LIBDL=ON
97 + -DHAVE_LIBPTHREAD=ON
98 +
99 + # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
100 + # and TERMINFO_LIBS... so just force FindCurses.cmake to use
101 + # ncurses with complete library set (including autodetection
102 + # of -ltinfo)
103 + -DCURSES_NEED_NCURSES=ON
104 + )
105 + use test && mycmakeargs+=(
106 + -DLLVM_BUILD_TESTS=$(usex test)
107 + # compilers for lit tests
108 + -DLLDB_TEST_C_COMPILER="$(type -P clang)"
109 + -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
110 +
111 + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
112 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
113 + -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
114 + )
115 +
116 + cmake-utils_src_configure
117 +}
118 +
119 +src_test() {
120 + cmake-utils_src_make check-lldb-lit
121 + use python && cmake-utils_src_make check-lldb
122 +}
123 +
124 +src_install() {
125 + cmake-utils_src_install
126 +
127 + # oh my...
128 + if use python; then
129 + # remove custom readline.so for now
130 + # TODO: figure out how to deal with it
131 + # upstream is basically building a custom readline.so with -ledit
132 + # to avoid symbol collisions between readline and libedit...
133 + rm "${D}$(python_get_sitedir)/readline.so" || die
134 +
135 + # byte-compile the modules
136 + python_optimize
137 + fi
138 +}