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: Mon, 24 Jul 2017 19:04:07
Message-Id: 1500923026.b3d5cd21231e2b3f879dfadbcd5028a8f196ddc0.mgorny@gentoo
1 commit: b3d5cd21231e2b3f879dfadbcd5028a8f196ddc0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 23 16:46:41 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 24 19:03:46 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3d5cd21
7
8 dev-util/lldb: Branch for 5.0.0 release
9
10 dev-util/lldb/lldb-5.0.9999.ebuild | 119 +++++++++++++++++++++++++++++++++++++
11 1 file changed, 119 insertions(+)
12
13 diff --git a/dev-util/lldb/lldb-5.0.9999.ebuild b/dev-util/lldb/lldb-5.0.9999.ebuild
14 new file mode 100644
15 index 00000000000..d1d0b573437
16 --- /dev/null
17 +++ b/dev-util/lldb/lldb-5.0.9999.ebuild
18 @@ -0,0 +1,119 @@
19 +# Copyright 1999-2017 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_50"
37 +
38 +LICENSE="UoI-NCSA"
39 +SLOT="0"
40 +KEYWORDS=""
41 +IUSE="libedit ncurses python test"
42 +
43 +RDEPEND="
44 + libedit? ( dev-libs/libedit:0= )
45 + ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
46 + python? ( dev-python/six[${PYTHON_USEDEP}]
47 + ${PYTHON_DEPS} )
48 + ~sys-devel/clang-${PV}[xml]
49 + ~sys-devel/llvm-${PV}
50 + !<sys-devel/llvm-4.0"
51 +# swig-3.0.9+ generates invalid wrappers, #598708
52 +# upstream: https://github.com/swig/swig/issues/769
53 +DEPEND="${RDEPEND}
54 + python? ( <dev-lang/swig-3.0.9 )
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
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 + -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
89 +
90 + -DLLVM_BUILD_TESTS=$(usex test)
91 + # compilers for lit tests
92 + -DLLDB_TEST_C_COMPILER="$(type -P clang)"
93 + -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
94 + # compiler for ole' python tests
95 + -DLLDB_TEST_COMPILER="$(type -P clang)"
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_MAIN_SRC_DIR="${WORKDIR}/llvm"
109 + -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
110 + )
111 +
112 + cmake-utils_src_configure
113 +}
114 +
115 +src_test() {
116 + cmake-utils_src_make check-lldb-lit
117 + use python && cmake-utils_src_make check-lldb
118 +}
119 +
120 +src_install() {
121 + cmake-utils_src_install
122 +
123 + # oh my...
124 + if use python; then
125 + # remove bundled six module
126 + rm "${D}$(python_get_sitedir)/six.py" || die
127 +
128 + # remove custom readline.so for now
129 + # TODO: figure out how to deal with it
130 + # upstream is basically building a custom readline.so with -ledit
131 + # to avoid symbol collisions between readline and libedit...
132 + rm "${D}$(python_get_sitedir)/readline.so" || die
133 +
134 + # byte-compile the modules
135 + python_optimize
136 + fi
137 +}