summaryrefslogtreecommitdiff
path: root/dev-util/lldb
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-util/lldb
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-util/lldb')
-rw-r--r--dev-util/lldb/Manifest12
-rw-r--r--dev-util/lldb/files/4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch102
-rw-r--r--dev-util/lldb/files/4.0.1/0002-Fix-bug-28898.patch98
-rw-r--r--dev-util/lldb/lldb-4.0.1.ebuild121
-rw-r--r--dev-util/lldb/lldb-5.0.0.ebuild112
-rw-r--r--dev-util/lldb/lldb-5.0.9999.ebuild119
-rw-r--r--dev-util/lldb/lldb-9999.ebuild119
-rw-r--r--dev-util/lldb/metadata.xml7
8 files changed, 690 insertions, 0 deletions
diff --git a/dev-util/lldb/Manifest b/dev-util/lldb/Manifest
new file mode 100644
index 000000000000..b828b90cec86
--- /dev/null
+++ b/dev-util/lldb/Manifest
@@ -0,0 +1,12 @@
+AUX 4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch 4415 SHA256 4f3cb14bd03e403c7be34e4fb0a6780334fb59f0be90f44536c152f8dd1a0b65 SHA512 9aa4a9618696d97b523e758725619a6cb6d4ca74058147185383b32ddc7db348bada379ad8c567a66a4bebd982c4e039aaae14ba44336408340378735c0b069c WHIRLPOOL 92ddcb08cb2cf87bf961aa1719c7a96628908bf78d98193b3eaaa583be1a6e9e191a0d84c2084a5541bad6a5db072e35e689370c074e1fe7ac42dcbbbe48a53d
+AUX 4.0.1/0002-Fix-bug-28898.patch 3526 SHA256 740390057e85995a1ad45c654c4e335cda697c93d1c5c63c64312772052c376e SHA512 8a9167ba1b17bb6d373fd41755ce4436b199fb48a47e303bff4020a79f90c547ae3ca86525345c55536bdc03b9c3853baaebdf914df04ae92901a073ae5658aa WHIRLPOOL ad5127bd629d65923cfb57e5fac4ac9ad20e8866a2b253343dd36343df8e76439f412f39acbfff8296b44e5a20ce3da020a0e3b36364422819143fe8825dec3b
+DIST lldb-4.0.1.src.tar.xz 19088212 SHA256 8432d2dfd86044a0fc21713e0b5c1d98e1d8aad863cf67562879f47f841ac47b SHA512 1d94d7dfcc0614b16d0ef83436bbe814b39e34ba18394361bb9f13ad408ae9b29affa9a5d58c50c8dcd83765a39ae4d59ffabb7d8cd1358fd2fbd198b2de2ab6 WHIRLPOOL d7897416b89c683702bec9bd244caa911e24e5801270b64b119caf0e617f4bdc714d10bcea3963f229273d040ffdebcb8c5737a71ca17fc92e2bbbf93af002bb
+DIST lldb-5.0.0.src.tar.xz 19203772 SHA256 c0a0ca32105e9881d86b7ca886220147e686edc97fdb9f3657c6659dc6568b7d SHA512 bc70953c7f6b3f0bc797461fb53d9c60c5ab36c0b9aae815a3c37fc597a61c7220695ee3b60a9682486d2e4713c5f78ea85e853e13c587e356510a1c99a62ba9 WHIRLPOOL 25b88b8b0678afe5aaf9e108dd154b874defc63ff41c48a495c91b98a22844e614142e2240515d9996d794ed5322aec26c977ed156cc2d5081ffe5a0c0999cd3
+DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a WHIRLPOOL 6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb
+EBUILD lldb-4.0.1.ebuild 3061 SHA256 2b5344d52b42017c07f98399302b4f9cb0283737baa273e905e0c980976c051c SHA512 d88dc965435cddf490e5fb7ba36ecb43cdc3c4ecf5865d531f3141f40226bba0cc63ff604d62e8e1d436da2c48c4f5a435e0561f265b0e2961423770e9edc43a WHIRLPOOL 8b71979e005adbdd507c4adef7f5fab0555a3726178c7197dd635bc265b29f011c50eb03edae04a04f7387aa62bc317a6975cde5baeb42aa79e07e88e38c3f65
+EBUILD lldb-5.0.0.ebuild 2811 SHA256 84ebaf8be3ca7cfb2538ea2aa360d099c6dd665a43fe2bee3d193c0070abb253 SHA512 e4b38ef25db0a8b764bc7b1540190024557ddafcae6613d3c55fb98b67ca72a922b5224b8f65144050cc3055418bbde6769ae30bd90cb5d30083c018e1fee8f4 WHIRLPOOL 3f70c4841d689de7861a6eae5a4b01b999e9a67311741f989462334805d8991110539f4d39a4988a5d6b8008f77e92d60b7200e372aa80df096f0221f995a117
+EBUILD lldb-5.0.9999.ebuild 2979 SHA256 65d38020b4bdc857d948160870a708d8a052c0d9c236765f6e6d7b6fc28e104b SHA512 46a0d9d7cc2d495037134f0ba7fd3538c974d9d1ba01290f893d2dddec4ab92905fb05c070a9b475f0a6d28c8fb132172784918ff03eccc0b2472573df05fbcd WHIRLPOOL c0948a0c48049a4e8e68305bcd13e650df058291e3bfd62f643f2401a2425bb98a9263a8f76c0012dc23b13255c8f3359ee78d484936c675401abc9d37cb72dc
+EBUILD lldb-9999.ebuild 2960 SHA256 a93f53f6edef42d3e11e40fba7633116c99a0566030e4d25c0c2ecf31b89a2ff SHA512 9b0d27b2508d5814ac7643bf17bccba07ce3fbdddf1708e96971116b2640d6fe84642ff6356acb5f1245cbb614e93ab888c106dc063efc42a3eb87ce5d98ed9a WHIRLPOOL dc1fa2b7ef45c0fb8e7234a7c2edba0091c882ded2783d5da8abbe0a7512e3149e6b9cf489ffb172e23286df92c1ab4fb8f71b215ffeab57166b960bba508796
+MISC ChangeLog 896 SHA256 45fa8891008f733b1dc64963fcc074d79d910d3fa0247a5363c27a5629c28657 SHA512 0b80df074c10b4b65da01b02444386ebdd8f495605de7adc0ef57e8c40eb8c59b888d3d3b85bbc49d351715062b04e1d55ee304b3572592fef62c262546ed092 WHIRLPOOL 6c45ed0905574bb8ad09f56c073d35c1909f542704f6fced3a068e25e7ca00316d4659d5ed36d6a84b812a2a249c7cb9b5ff4764cc10eb9581690406dab761d5
+MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a
diff --git a/dev-util/lldb/files/4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch b/dev-util/lldb/files/4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch
new file mode 100644
index 000000000000..1b183d860a2d
--- /dev/null
+++ b/dev-util/lldb/files/4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch
@@ -0,0 +1,102 @@
+From 6a9aab954c32a2d3d13a0fe5fc984e9787e9f794 Mon Sep 17 00:00:00 2001
+From: Michal Gorny <mgorny@gentoo.org>
+Date: Sun, 19 Feb 2017 22:11:38 +0000
+Subject: [PATCH] [test] Fix finding LLDB tools when building stand-alone
+
+Use both LLDB- and LLVM-specific tool/library directories when LLDB is
+being built stand-alone. This ensures that the freshly-built tools
+(and libraries) are used correctly.
+
+Without this patch, the test suite uses LLVM_TOOLS_DIR and LLVM_LIBS_DIR
+to locate lldb, and set PATH and LD_LIBRARY_PATH. When doing
+a stand-alone build, these variables represent the installed LLVM.
+As a result, tests either fail due to missing lldb executable
+or use an earlier installed LLDB version rather than the one being
+built.
+
+To solve this, additional LLDB_TOOLS_DIR and LLDB_LIBS_DIR variables
+are added and populated using LLVM_*_OUTPUT_INTDIR. Those variables
+contain directories used to output built executables and libraries.
+In stand-alone builds, they represent the build-tree directories
+used by LLDB. In integrated builds, they have the same values as
+LLVM_*_DIR and therefore using them does not harm.
+
+The new variables are prepended to PATH and LD_LIBRARY_PATH to ensure
+that freshly built binaries are preferred over potentially earlier
+installed ones. Furthermore, paths used to locate various tools are
+updated to match appropriate locations.
+
+Differential Revision: https://reviews.llvm.org/D29985
+
+git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@295621 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ lit/lit.cfg | 18 ++++++++++++------
+ lit/lit.site.cfg.in | 2 ++
+ 2 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/lit/lit.cfg b/lit/lit.cfg
+index dd89b45fa..a3d5f9ca7 100644
+--- a/lit/lit.cfg
++++ b/lit/lit.cfg
+@@ -39,18 +39,24 @@ config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
+
+ # Tweak the PATH to include the tools dir and the scripts dir.
+ if lldb_obj_root is not None:
++ lldb_tools_dir = getattr(config, 'lldb_tools_dir', None)
++ if not lldb_tools_dir:
++ lit_config.fatal('No LLDB tools dir set!')
+ llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
+ if not llvm_tools_dir:
+ lit_config.fatal('No LLVM tools dir set!')
+- path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
++ path = os.path.pathsep.join((lldb_tools_dir, llvm_tools_dir, config.environment['PATH']))
+ path = os.path.pathsep.join((os.path.join(getattr(config, 'llvm_src_root', None),'test','Scripts'),path))
+
+ config.environment['PATH'] = path
+
++ lldb_libs_dir = getattr(config, 'lldb_libs_dir', None)
++ if not lldb_libs_dir:
++ lit_config.fatal('No LLDB libs dir set!')
+ llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
+ if not llvm_libs_dir:
+ lit_config.fatal('No LLVM libs dir set!')
+- path = os.path.pathsep.join((llvm_libs_dir,
++ path = os.path.pathsep.join((lldb_libs_dir, llvm_libs_dir,
+ config.environment.get('LD_LIBRARY_PATH','')))
+ config.environment['LD_LIBRARY_PATH'] = path
+
+@@ -115,14 +121,14 @@ if config.test_exec_root is None:
+ # Register substitutions
+ config.substitutions.append(('%python', config.python_executable))
+
+-debugserver = lit.util.which('debugserver', llvm_tools_dir)
+-lldb = lit.util.which('lldb', llvm_tools_dir)
++debugserver = lit.util.which('debugserver', lldb_tools_dir)
++lldb = lit.util.which('lldb', lldb_tools_dir)
+
+ if not os.path.exists(config.cc):
+- config.cc = lit.util.which(config.cc, llvm_tools_dir)
++ config.cc = lit.util.which(config.cc, config.environment['PATH'])
+
+ if not os.path.exists(config.cxx):
+- config.cxx = lit.util.which(config.cxx, llvm_tools_dir)
++ config.cxx = lit.util.which(config.cxx, config.environment['PATH'])
+
+ if platform.system() in ['Darwin']:
+ try:
+diff --git a/lit/lit.site.cfg.in b/lit/lit.site.cfg.in
+index 904521c9d..03aa3df9a 100644
+--- a/lit/lit.site.cfg.in
++++ b/lit/lit.site.cfg.in
+@@ -6,6 +6,8 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
+ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
+ config.lldb_obj_root = "@LLDB_BINARY_DIR@"
++config.lldb_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
++config.lldb_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
+ config.target_triple = "@TARGET_TRIPLE@"
+ config.python_executable = "@PYTHON_EXECUTABLE@"
+ config.cc = "@CMAKE_C_COMPILER@"
+--
+2.12.0
+
diff --git a/dev-util/lldb/files/4.0.1/0002-Fix-bug-28898.patch b/dev-util/lldb/files/4.0.1/0002-Fix-bug-28898.patch
new file mode 100644
index 000000000000..563d2f6813a2
--- /dev/null
+++ b/dev-util/lldb/files/4.0.1/0002-Fix-bug-28898.patch
@@ -0,0 +1,98 @@
+From 9ad9480c3a380a04b3dbe869c0675d6bba37247b Mon Sep 17 00:00:00 2001
+From: Kamil Rytarowski <n54@gmx.com>
+Date: Thu, 25 May 2017 20:12:30 +0000
+Subject: [PATCH] Fix bug #28898 lldb: libedit produces garbled, unusable input
+ on Linux
+
+Apply patch from Christos Zoulas, upstream libedit developer.
+It has been tested on NetBSD/amd64.
+
+New code supports combination of wide libedit and disabled
+LLDB_EDITLINE_USE_WCHAR, which was the popular case on Linux
+systems.
+
+
+git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@303907 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ include/lldb/Host/Editline.h | 12 +++++++++---
+ source/Host/common/Editline.cpp | 8 ++++----
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/include/lldb/Host/Editline.h b/include/lldb/Host/Editline.h
+index 2b1a8e047..0b75e9c92 100644
+--- a/include/lldb/Host/Editline.h
++++ b/include/lldb/Host/Editline.h
+@@ -82,8 +82,14 @@ using EditLineStringStreamType = std::stringstream;
+ using EditLineCharType = char;
+ #endif
+
++#ifdef EL_CLIENTDATA /* editline with wide support + wide char read function */
++using EditLineGetCharType = wchar_t;
++#else
++using EditLineGetCharType = char;
++#endif
++
+ typedef int (*EditlineGetCharCallbackType)(::EditLine *editline,
+- EditLineCharType *c);
++ EditLineGetCharType *c);
+ typedef unsigned char (*EditlineCommandCallbackType)(::EditLine *editline,
+ int ch);
+ typedef const char *(*EditlinePromptCallbackType)(::EditLine *editline);
+@@ -270,7 +276,7 @@ private:
+
+ /// Character reading implementation for EditLine that supports our multi-line
+ /// editing trickery.
+- int GetCharacter(EditLineCharType *c);
++ int GetCharacter(EditLineGetCharType *c);
+
+ /// Prompt implementation for EditLine.
+ const char *Prompt();
+@@ -323,7 +329,7 @@ private:
+ /// single or multi-line editing.
+ void ConfigureEditor(bool multiline);
+
+- bool CompleteCharacter(char ch, EditLineCharType &out);
++ bool CompleteCharacter(char ch, EditLineGetCharType &out);
+
+ private:
+ #if LLDB_EDITLINE_USE_WCHAR
+diff --git a/source/Host/common/Editline.cpp b/source/Host/common/Editline.cpp
+index 7d4b398a1..7b580dde6 100644
+--- a/source/Host/common/Editline.cpp
++++ b/source/Host/common/Editline.cpp
+@@ -474,7 +474,7 @@ unsigned char Editline::RecallHistory(bool earlier) {
+ return CC_NEWLINE;
+ }
+
+-int Editline::GetCharacter(EditLineCharType *c) {
++int Editline::GetCharacter(EditLineGetCharType *c) {
+ const LineInfoW *info = el_wline(m_editline);
+
+ // Paint a faint version of the desired prompt over the version libedit draws
+@@ -969,7 +969,7 @@ void Editline::ConfigureEditor(bool multiline) {
+ }));
+
+ el_wset(m_editline, EL_GETCFN, (EditlineGetCharCallbackType)([](
+- EditLine *editline, EditLineCharType *c) {
++ EditLine *editline, EditLineGetCharType *c) {
+ return Editline::InstanceFor(editline)->GetCharacter(c);
+ }));
+
+@@ -1360,12 +1360,12 @@ void Editline::PrintAsync(Stream *stream, const char *s, size_t len) {
+ }
+ }
+
+-bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
++bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
+ #if !LLDB_EDITLINE_USE_WCHAR
+ if (ch == (char)EOF)
+ return false;
+
+- out = ch;
++ out = (unsigned char)ch;
+ return true;
+ #else
+ std::codecvt_utf8<wchar_t> cvt;
+--
+2.13.1
+
diff --git a/dev-util/lldb/lldb-4.0.1.ebuild b/dev-util/lldb/lldb-4.0.1.ebuild
new file mode 100644
index 000000000000..64a83e7105da
--- /dev/null
+++ b/dev-util/lldb/lldb-4.0.1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils llvm python-single-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM debugger"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="libedit ncurses python test"
+
+RDEPEND="
+ libedit? ( dev-libs/libedit:0= )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
+ python? ( dev-python/six[${PYTHON_USEDEP}]
+ ${PYTHON_DEPS} )
+ ~sys-devel/clang-${PV}[xml]
+ ~sys-devel/llvm-${PV}
+ !<sys-devel/llvm-4.0"
+# swig-3.0.9+ generates invalid wrappers, #598708
+# upstream: https://github.com/swig/swig/issues/769
+DEPEND="${RDEPEND}
+ python? ( <dev-lang/swig-3.0.9 )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ ${PYTHON_DEPS}"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_prepare() {
+ # fix tests in stand-alone build
+ eapply "${FILESDIR}"/4.0.1/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch
+ # fix compatibility with new libedit
+ eapply "${FILESDIR}"/4.0.1/0002-Fix-bug-28898.patch
+
+ eapply_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses)
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+ -DLLDB_DISABLE_PYTHON=$(usex !python)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+
+ -DLLVM_BUILD_TESTS=$(usex test)
+ # compilers for lit tests
+ -DLLDB_TEST_C_COMPILER="$(type -P clang)"
+ -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
+ # compiler for ole' python tests
+ -DLLDB_TEST_COMPILER="$(type -P clang)"
+
+ # TODO: fix upstream to detect this properly
+ -DHAVE_LIBDL=ON
+ -DHAVE_LIBPTHREAD=ON
+
+ # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
+ # and TERMINFO_LIBS... so just force FindCurses.cmake to use
+ # ncurses with complete library set (including autodetection
+ # of -ltinfo)
+ -DCURSES_NEED_NCURSES=ON
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lldb-lit
+ use python && cmake-utils_src_make check-lldb
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # oh my...
+ if use python; then
+ # remove bundled six module
+ rm "${D}$(python_get_sitedir)/six.py" || die
+
+ # remove custom readline.so for now
+ # TODO: figure out how to deal with it
+ # upstream is basically building a custom readline.so with -ledit
+ # to avoid symbol collisions between readline and libedit...
+ rm "${D}$(python_get_sitedir)/readline.so" || die
+
+ # byte-compile the modules
+ python_optimize
+ fi
+}
diff --git a/dev-util/lldb/lldb-5.0.0.ebuild b/dev-util/lldb/lldb-5.0.0.ebuild
new file mode 100644
index 000000000000..ac6f0f6cadc5
--- /dev/null
+++ b/dev-util/lldb/lldb-5.0.0.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils llvm python-single-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM debugger"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="libedit ncurses python test"
+
+RDEPEND="
+ libedit? ( dev-libs/libedit:0= )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
+ python? ( dev-python/six[${PYTHON_USEDEP}]
+ ${PYTHON_DEPS} )
+ ~sys-devel/clang-${PV}[xml]
+ ~sys-devel/llvm-${PV}
+ !<sys-devel/llvm-4.0"
+# swig-3.0.9+ generates invalid wrappers, #598708
+# upstream: https://github.com/swig/swig/issues/769
+DEPEND="${RDEPEND}
+ python? ( <dev-lang/swig-3.0.9 )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ ${PYTHON_DEPS}"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses)
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+ -DLLDB_DISABLE_PYTHON=$(usex !python)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+
+ -DLLVM_BUILD_TESTS=$(usex test)
+ # compilers for lit tests
+ -DLLDB_TEST_C_COMPILER="$(type -P clang)"
+ -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
+ # compiler for ole' python tests
+ -DLLDB_TEST_COMPILER="$(type -P clang)"
+
+ # TODO: fix upstream to detect this properly
+ -DHAVE_LIBDL=ON
+ -DHAVE_LIBPTHREAD=ON
+
+ # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
+ # and TERMINFO_LIBS... so just force FindCurses.cmake to use
+ # ncurses with complete library set (including autodetection
+ # of -ltinfo)
+ -DCURSES_NEED_NCURSES=ON
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lldb-lit
+ use python && cmake-utils_src_make check-lldb
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # oh my...
+ if use python; then
+ # remove bundled six module
+ rm "${D}$(python_get_sitedir)/six.py" || die
+
+ # remove custom readline.so for now
+ # TODO: figure out how to deal with it
+ # upstream is basically building a custom readline.so with -ledit
+ # to avoid symbol collisions between readline and libedit...
+ rm "${D}$(python_get_sitedir)/readline.so" || die
+
+ # byte-compile the modules
+ python_optimize
+ fi
+}
diff --git a/dev-util/lldb/lldb-5.0.9999.ebuild b/dev-util/lldb/lldb-5.0.9999.ebuild
new file mode 100644
index 000000000000..d1d0b573437b
--- /dev/null
+++ b/dev-util/lldb/lldb-5.0.9999.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils git-r3 llvm python-single-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM debugger"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/lldb.git
+ https://github.com/llvm-mirror/lldb.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="libedit ncurses python test"
+
+RDEPEND="
+ libedit? ( dev-libs/libedit:0= )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
+ python? ( dev-python/six[${PYTHON_USEDEP}]
+ ${PYTHON_DEPS} )
+ ~sys-devel/clang-${PV}[xml]
+ ~sys-devel/llvm-${PV}
+ !<sys-devel/llvm-4.0"
+# swig-3.0.9+ generates invalid wrappers, #598708
+# upstream: https://github.com/swig/swig/issues/769
+DEPEND="${RDEPEND}
+ python? ( <dev-lang/swig-3.0.9 )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ ${PYTHON_DEPS}"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses)
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+ -DLLDB_DISABLE_PYTHON=$(usex !python)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+
+ -DLLVM_BUILD_TESTS=$(usex test)
+ # compilers for lit tests
+ -DLLDB_TEST_C_COMPILER="$(type -P clang)"
+ -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
+ # compiler for ole' python tests
+ -DLLDB_TEST_COMPILER="$(type -P clang)"
+
+ # TODO: fix upstream to detect this properly
+ -DHAVE_LIBDL=ON
+ -DHAVE_LIBPTHREAD=ON
+
+ # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
+ # and TERMINFO_LIBS... so just force FindCurses.cmake to use
+ # ncurses with complete library set (including autodetection
+ # of -ltinfo)
+ -DCURSES_NEED_NCURSES=ON
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lldb-lit
+ use python && cmake-utils_src_make check-lldb
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # oh my...
+ if use python; then
+ # remove bundled six module
+ rm "${D}$(python_get_sitedir)/six.py" || die
+
+ # remove custom readline.so for now
+ # TODO: figure out how to deal with it
+ # upstream is basically building a custom readline.so with -ledit
+ # to avoid symbol collisions between readline and libedit...
+ rm "${D}$(python_get_sitedir)/readline.so" || die
+
+ # byte-compile the modules
+ python_optimize
+ fi
+}
diff --git a/dev-util/lldb/lldb-9999.ebuild b/dev-util/lldb/lldb-9999.ebuild
new file mode 100644
index 000000000000..8dd6d2049e91
--- /dev/null
+++ b/dev-util/lldb/lldb-9999.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils git-r3 llvm python-single-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM debugger"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/lldb.git
+ https://github.com/llvm-mirror/lldb.git"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="libedit ncurses python test"
+
+RDEPEND="
+ libedit? ( dev-libs/libedit:0= )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
+ python? ( dev-python/six[${PYTHON_USEDEP}]
+ ${PYTHON_DEPS} )
+ ~sys-devel/clang-${PV}[xml]
+ ~sys-devel/llvm-${PV}
+ !<sys-devel/llvm-4.0"
+# swig-3.0.9+ generates invalid wrappers, #598708
+# upstream: https://github.com/swig/swig/issues/769
+DEPEND="${RDEPEND}
+ python? ( <dev-lang/swig-3.0.9 )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ ${PYTHON_DEPS}"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses)
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+ -DLLDB_DISABLE_PYTHON=$(usex !python)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+
+ -DLLVM_BUILD_TESTS=$(usex test)
+ # compilers for lit tests
+ -DLLDB_TEST_C_COMPILER="$(type -P clang)"
+ -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
+ # compiler for ole' python tests
+ -DLLDB_TEST_COMPILER="$(type -P clang)"
+
+ # TODO: fix upstream to detect this properly
+ -DHAVE_LIBDL=ON
+ -DHAVE_LIBPTHREAD=ON
+
+ # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
+ # and TERMINFO_LIBS... so just force FindCurses.cmake to use
+ # ncurses with complete library set (including autodetection
+ # of -ltinfo)
+ -DCURSES_NEED_NCURSES=ON
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lldb-lit
+ use python && cmake-utils_src_make check-lldb
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # oh my...
+ if use python; then
+ # remove bundled six module
+ rm "${D}$(python_get_sitedir)/six.py" || die
+
+ # remove custom readline.so for now
+ # TODO: figure out how to deal with it
+ # upstream is basically building a custom readline.so with -ledit
+ # to avoid symbol collisions between readline and libedit...
+ rm "${D}$(python_get_sitedir)/readline.so" || die
+
+ # byte-compile the modules
+ python_optimize
+ fi
+}
diff --git a/dev-util/lldb/metadata.xml b/dev-util/lldb/metadata.xml
new file mode 100644
index 000000000000..89c4bdb96049
--- /dev/null
+++ b/dev-util/lldb/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>