From feeb9f07adda22b56a732141522cc3ad57820aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 20 Aug 2016 23:22:58 +0200 Subject: sys-devel/llvm: Strip external projects off the live ebuild --- ...ystem-llvm-lit-when-lit.py-does-not-exist.patch | 33 +++ ...y-Install-as-llvm-lit-as-cmake-expects-it.patch | 30 +++ ...ll-compiler-rt-into-usr-lib-without-suffi.patch | 26 -- sys-devel/llvm/llvm-9999.ebuild | 299 +++------------------ 4 files changed, 93 insertions(+), 295 deletions(-) create mode 100644 sys-devel/llvm/files/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch create mode 100644 sys-devel/llvm/files/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch delete mode 100644 sys-devel/llvm/files/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch (limited to 'sys-devel') diff --git a/sys-devel/llvm/files/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch b/sys-devel/llvm/files/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch new file mode 100644 index 00000000000..7245af07d2e --- /dev/null +++ b/sys-devel/llvm/files/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch @@ -0,0 +1,33 @@ +From bcdf2c49b7686046f8a9a5664f0e46117997baf4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 21 Aug 2016 23:19:40 +0200 +Subject: [PATCH 09/10] cmake: Use system llvm-lit when lit.py does not exist + in srcdir + +Modify the add_lit_target function to use lit.py from LLVM_MAIN_SRC_DIR +only when one does exist there, and otherwise fall back to looking for +system install of llvm-lit. This is based on a similar conditional in +clang's CMakeLists.txt, and makes it possible to run clang's tests when +built separately from LLVM with no access to the original sources. + +Patch: https://reviews.llvm.org/D23742 +--- + cmake/modules/AddLLVM.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 83a2359..87540d5 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -1081,7 +1081,7 @@ function(add_lit_target target comment) + if (NOT CMAKE_CFG_INTDIR STREQUAL ".") + list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR}) + endif () +- if (LLVM_MAIN_SRC_DIR) ++ if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py) + set (LIT_COMMAND ${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py) + else() + find_program(LIT_COMMAND llvm-lit) +-- +2.9.3 + diff --git a/sys-devel/llvm/files/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch b/sys-devel/llvm/files/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch new file mode 100644 index 00000000000..53726aa3f5e --- /dev/null +++ b/sys-devel/llvm/files/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch @@ -0,0 +1,30 @@ +From 242fd2cbad1075d4cc0e3a3b64652dbc766bd117 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 21 Aug 2016 23:20:11 +0200 +Subject: [PATCH 10/10] lit/setup.py: Install as llvm-lit (as cmake expects it) + +Modify the setup.py for lit to install the entry point as llvm-lit +(instead of lit) since this is the name expected by functions in +AddLLVM.cmake. + +Patch: https://reviews.llvm.org/D23743 +--- + utils/lit/setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/lit/setup.py b/utils/lit/setup.py +index 10de6bb..c57e0aa 100644 +--- a/utils/lit/setup.py ++++ b/utils/lit/setup.py +@@ -71,7 +71,7 @@ http://llvm.org/svn/llvm-project/llvm/trunk/utils/lit. + packages = find_packages(), + entry_points = { + 'console_scripts': [ +- 'lit = lit:main', ++ 'llvm-lit = lit:main', + ], + } + ) +-- +2.9.3 + diff --git a/sys-devel/llvm/files/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch b/sys-devel/llvm/files/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch deleted file mode 100644 index a09de901024..00000000000 --- a/sys-devel/llvm/files/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 380b8faadc3fc66f9aa0528bd3578464b317c31e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -Date: Thu, 12 May 2016 08:25:48 +0200 -Subject: [PATCH] cmake: Install compiler-rt to a directory without libdir - suffix - ---- - cmake/base-config-ix.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake -index 5d0502c..ce16ce9 100644 ---- a/projects/compiler-rt/cmake/base-config-ix.cmake -+++ b/projects/compiler-rt/cmake/base-config-ix.cmake -@@ -18,7 +18,7 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) - # Setup the paths where compiler-rt runtimes and headers should be stored. - set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) - set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) -- set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) -+ set(COMPILER_RT_INSTALL_PATH lib/clang/${CLANG_VERSION}) - option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." - ${LLVM_INCLUDE_TESTS}) - option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" --- -2.8.2 - diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild index c8a34ba3f9f..556bf076366 100644 --- a/sys-devel/llvm/llvm-9999.ebuild +++ b/sys-devel/llvm/llvm-9999.ebuild @@ -6,10 +6,11 @@ EAPI=6 : ${CMAKE_MAKEFILE_GENERATOR:=ninja} CMAKE_MIN_VERSION=3.4.3 +DISTUTILS_OPTIONAL=1 PYTHON_COMPAT=( python2_7 ) -inherit check-reqs cmake-utils eutils flag-o-matic git-r3 multilib \ - multilib-minimal python-single-r1 toolchain-funcs pax-utils +inherit check-reqs cmake-utils distutils-r1 flag-o-matic git-r3 \ + multilib-minimal pax-utils toolchain-funcs DESCRIPTION="Low Level Virtual Machine" HOMEPAGE="http://llvm.org/" @@ -20,17 +21,12 @@ EGIT_REPO_URI="http://llvm.org/git/llvm.git LICENSE="UoI-NCSA" SLOT="0/${PV%.*}" KEYWORDS="" -IUSE="clang debug default-compiler-rt default-libcxx +doc gold libedit +libffi - lldb multitarget ncurses ocaml python +sanitize +static-analyzer test xml - video_cards_radeon elibc_musl kernel_Darwin kernel_FreeBSD" +IUSE="debug +doc gold libedit +libffi multitarget ncurses ocaml test + video_cards_radeon elibc_musl kernel_Darwin" -COMMON_DEPEND=" +# python is needed for llvm-lit (which is installed) +RDEPEND=" sys-libs/zlib:0= - clang? ( - static-analyzer? ( dev-lang/perl:* ) - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) - ${PYTHON_DEPS} - ) gold? ( >=sys-devel/binutils-2.22:*[cxx] ) libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] ) libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] ) @@ -38,51 +34,31 @@ COMMON_DEPEND=" ocaml? ( >=dev-lang/ocaml-4.00.0:0= dev-ml/findlib - dev-ml/ocaml-ctypes )" + dev-ml/ocaml-ctypes ) + ${PYTHON_DEPS}" # configparser-3.2 breaks the build (3.3 or none at all are fine) -DEPEND="${COMMON_DEPEND} +DEPEND="${RDEPEND} dev-lang/perl - >=sys-devel/make-3.81 - >=sys-devel/flex-2.5.4 - >=sys-devel/bison-1.875d || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5 ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx ) ) || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 ) kernel_Darwin? ( clang-X.Y - # - clang++, clang-cl -> clang - # we want to have: - # - clang-X.Y - # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y - # - clang, clang++, clang-cl -> clang*-X.Y - # so we need to fix the two tools - for i in "${clang_tools[@]:1}"; do - rm "${ED%/}/usr/bin/${i}" || die - dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}" - dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}" - done - - # now prepend ${CHOST} and let the multilib-build.eclass symlink it - if ! multilib_is_native_abi; then - # non-native? let's replace it with a simple wrapper - for i in "${clang_tools[@]}"; do - rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die - cat > "${T}"/wrapper.tmp <<-_EOF_ - #!${EPREFIX}/bin/sh - exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}" - _EOF_ - newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}" - done - fi - fi } multilib_src_install_all() { @@ -492,33 +282,4 @@ multilib_src_install_all() { doins -r utils/vim/*/. # some users may find it useful dodoc utils/vim/vimrc - - if use clang; then - pushd tools/clang >/dev/null || die - - if use python ; then - pushd bindings/python/clang >/dev/null || die - - python_moduleinto clang - python_domodule *.py - - popd >/dev/null || die - fi - - # AddressSanitizer symbolizer (currently separate) - dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py - - popd >/dev/null || die - - python_fix_shebang "${ED}" - if use static-analyzer; then - python_optimize "${ED}"usr/share/scan-view - fi - fi -} - -pkg_postinst() { - if use clang && ! has_version 'sys-libs/libomp'; then - elog "To enable OpenMP support in clang, install sys-libs/libomp." - fi } -- cgit v1.2.1