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