1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
7 # (needed due to CMAKE_BUILD_TYPE != Gentoo)
8 CMAKE_MIN_VERSION=3.7.0-r1
9 PYTHON_COMPAT=( python2_7 )
11 inherit cmake-utils git-r3 llvm python-single-r1 toolchain-funcs
13 DESCRIPTION="The LLVM debugger"
14 HOMEPAGE="https://llvm.org/"
16 EGIT_REPO_URI="https://git.llvm.org/git/lldb.git
17 https://github.com/llvm-mirror/lldb.git"
22 IUSE="libedit ncurses python test"
25 libedit? ( dev-libs/libedit:0= )
26 ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
27 python? ( dev-python/six[${PYTHON_USEDEP}]
29 ~sys-devel/clang-${PV}[xml]
32 # swig-3.0.9+ generates invalid wrappers, #598708
33 # upstream: https://github.com/swig/swig/issues/769
35 python? ( <dev-lang/swig-3.0.9 )
36 test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
39 REQUIRED_USE=${PYTHON_REQUIRED_USE}
41 # least intrusive of all
42 CMAKE_BUILD_TYPE=RelWithDebInfo
46 python-single-r1_pkg_setup
51 # needed for patched gtest
52 git-r3_fetch "https://git.llvm.org/git/llvm.git
53 https://github.com/llvm-mirror/llvm.git"
58 git-r3_checkout https://llvm.org/git/llvm.git \
66 -DLLDB_DISABLE_CURSES=$(usex !ncurses)
67 -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
68 -DLLDB_DISABLE_PYTHON=$(usex !python)
69 -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
71 -DLLDB_INCLUDE_TESTS=$(usex test)
72 -DLLVM_BUILD_TESTS=$(usex test)
73 # compilers for lit tests
74 -DLLDB_TEST_C_COMPILER="$(type -P clang)"
75 -DLLDB_TEST_CXX_COMPILER="$(type -P clang++)"
76 # compiler for ole' python tests
77 -DLLDB_TEST_COMPILER="$(type -P clang)"
79 # TODO: fix upstream to detect this properly
83 # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
84 # and TERMINFO_LIBS... so just force FindCurses.cmake to use
85 # ncurses with complete library set (including autodetection
87 -DCURSES_NEED_NCURSES=ON
89 use test && mycmakeargs+=(
90 -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
91 -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
95 cmake-utils_src_configure
99 cmake-utils_src_make check-lldb-lit
100 use python && cmake-utils_src_make check-lldb
104 cmake-utils_src_install
108 # remove bundled six module
109 rm "${D}$(python_get_sitedir)/six.py" || die
111 # remove custom readline.so for now
112 # TODO: figure out how to deal with it
113 # upstream is basically building a custom readline.so with -ledit
114 # to avoid symbol collisions between readline and libedit...
115 rm "${D}$(python_get_sitedir)/readline.so" || die
117 # byte-compile the modules