From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- sys-devel/lld/Manifest | 12 +++ ...D-specific-binary-library-dirs-when-build.patch | 97 ++++++++++++++++++++++ ...ib-cond-when-building-stand-alone-clean-u.patch | 82 ++++++++++++++++++ sys-devel/lld/lld-4.0.1.ebuild | 76 +++++++++++++++++ sys-devel/lld/lld-5.0.0.ebuild | 68 +++++++++++++++ sys-devel/lld/lld-5.0.9999.ebuild | 75 +++++++++++++++++ sys-devel/lld/lld-9999.ebuild | 75 +++++++++++++++++ sys-devel/lld/metadata.xml | 7 ++ 8 files changed, 492 insertions(+) create mode 100644 sys-devel/lld/Manifest create mode 100644 sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch create mode 100644 sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch create mode 100644 sys-devel/lld/lld-4.0.1.ebuild create mode 100644 sys-devel/lld/lld-5.0.0.ebuild create mode 100644 sys-devel/lld/lld-5.0.9999.ebuild create mode 100644 sys-devel/lld/lld-9999.ebuild create mode 100644 sys-devel/lld/metadata.xml (limited to 'sys-devel/lld') diff --git a/sys-devel/lld/Manifest b/sys-devel/lld/Manifest new file mode 100644 index 000000000000..b1a65d8fa693 --- /dev/null +++ b/sys-devel/lld/Manifest @@ -0,0 +1,12 @@ +AUX 4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch 4381 SHA256 21221017514bfb4e30a04bf3b69891e127b0ae36b1e25f97a59c5aa96585ffbc SHA512 6d133999c5b95ede493ca98a0e8c7816dcca36e4e5f17f6d847996a2d70517cc50d0e1a6259b0d34173f76c4300f8809cea2c06d029a85d2fc62e856e69cbc72 WHIRLPOOL e45f2467f1286aaf56d5090d94dfebba9e29b50ea11b6b4b10451c9a1cc1ee78a9fd8eec320042eec03b9da506f50809b096f2e0f1f8dfd2d7499315afa4212c +AUX 4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch 2924 SHA256 91e8192923e573ae457e347386f691b8190845cb2cdd0c7a6ed6627943729995 SHA512 1b82f754fb872318740f77f78fa08647e2523d5b6d9cdd0dd9108bdac82a213d5d5c698a8915c0f6bd60b2163cce3c8bd1c13095dad52d0beb08079f851d30d8 WHIRLPOOL 1b2aabe53b872dc5333d992533f715213b900e0bf8d89cbb11c21fe11a7cca61cc70587004e679459053244072c729eae57443483fd6e10538c473a82a1c5900 +DIST lld-4.0.1.src.tar.xz 593796 SHA256 63ce10e533276ca353941ce5ab5cc8e8dcd99dbdd9c4fa49f344a212f29d36ed SHA512 63bd0813094dc7fa9a95fdee93eb7b97026882a15548f819b5c67f3f0f9fa2a582d968af27ad8f802dbff1f6cd1b8c2fb26b3c7c80379488d05c4a4984d7af68 WHIRLPOOL e7adca75f7f5fbb6136d01544798e969cba69b86c5b76a7fdcf7918564aa13eb868f4fa41102d7a4c501f741664ae309d6842c821ac974503431722ae963f93f +DIST lld-5.0.0.src.tar.xz 668344 SHA256 399a7920a5278d42c46a7bf7e4191820ec2301457a7d0d4fcc9a4ac05dd53897 SHA512 984606a8c8aa753805d30602ce851a70d5427ee0ec098e3fcb2751e58d36c601f59f17f5c9ab90a430bc670f689c3b86b6ecbeccb6ff187f108f6e2000621eb7 WHIRLPOOL 111f38f1005f2e4a7c31435acaaff133c3a2dec695f615f25b3872801c5865c5057bcc7e75551fd8d65abafe7f1637498853ca78840731cfae91b0ae3972b4c6 +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 lld-4.0.1.ebuild 1709 SHA256 b93a6bdcf552cc5574b7dff927d6e6cdbd14a500ccc7250725a3db411e4af804 SHA512 a8415379201edd9ea508266c73d62620b08d672f66b4ddfb8b3e82b037e60a585e7263fa5e9e0c89fbba87108d02542bb276beccb403cbf4ebdf58e542f1d64c WHIRLPOOL f9ed88cbefc849ac0f338d20424a42ddb91bdbbbed45df7db3b21d1ca9d594016008e686f0828e717eeab7fe309deab5b38fde12567c55fb84c04bbffc9cc656 +EBUILD lld-5.0.0.ebuild 1439 SHA256 ceafbbb1b8d9a2d2bde685c696abe1129e31ba9785f4de3448dbc31d88e90f2b SHA512 f176cb6685c7e6d435f00b3ce3ab68c345fa658ccfadce1a2ebb23d196d1eb152a3c17e0925d684897c6f82dcd5284748403ff0a803f4ed6f2d4faba20700172 WHIRLPOOL 3cc618de8870afc5e3f31f9cb6e36d1e7de1af756d29eec835b006bf1e3305018aa1e9f7f6a085f6dd3fd14d095d52eaba4c0828184e50afe1acb370f6944af8 +EBUILD lld-5.0.9999.ebuild 1605 SHA256 8b410caed024230c595cc5dc42fc1577fbe1abf40bc2f7d3d2242e26d8cbc6b2 SHA512 7e0ff04172f71b2bfd568b56dffd0ccabd47860c94627a0cda8e6e423d1db7f52aaa766537851364fd2a0be7abd71665e7eb3b7792c2db6d0f118635d1c74cf9 WHIRLPOOL 8010d4153b37e043325b925fdb4fce07adc206be06ee3ecd04fccb9b6f1e4e81b5c01895aebbe3687a8e2d0c21479452538596f2882bab3b56f00c616a07cc1f +EBUILD lld-9999.ebuild 1586 SHA256 25a918670a8dba073d508bf38ab49a7bb136b8c95affe69705754a2d8edb06e9 SHA512 bacda60ca06b24b5d4a5d4eca85a8e1802b93289b533d9bc2e0a189f3bc78b9f7498e3a7f4d121c244ebf3904db09691488f207d66744e9927acbc589ca235e2 WHIRLPOOL 55b3e0af15053002dbc15eb32c7e6311ae034880b1fa18f490faaa5cb0382fd0a5dbbb9962e3b12b78ae16d7dcc0680bd0404bf93ed46273ac4e7b81f83b205d +MISC ChangeLog 282 SHA256 433fa56933fb974fcabf687259f07a45d2e1f27b65551d88c1d0f05563b289de SHA512 bfd4b64c29380b5e9aa3e39a6efe4b2495ba32d09c75be6e257e2dee1cd9d6eb41b527ca356396b0703a7ee92e89225d66715ce0316e148df0ff6c6b175453f5 WHIRLPOOL 3aa87110e79ac3ec17052afbfbadc1b3abe0d93f358a571f5802a87786d86fe4dce8cc20bf7ccfd404c96d4e5d59348ae68c310b654b7023cb929cd7b36e55f7 +MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a diff --git a/sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch b/sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch new file mode 100644 index 000000000000..2a7935f76838 --- /dev/null +++ b/sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch @@ -0,0 +1,97 @@ +From 72b099306f586382a32cb0b37ad6a07dc7cddcf9 Mon Sep 17 00:00:00 2001 +From: Michal Gorny +Date: Wed, 8 Feb 2017 20:08:25 +0000 +Subject: [PATCH 2/3] [test] Use LLD-specific binary&library dirs when building + stand-alone + +Use both LLD- and LLVM-specific binary&library directories when LLD is +being built stand-alone. This ensures that the freshly built tools and +libraries are found and used correctly. + +Without this patch, the test suite uses LLVM_TOOLS_DIR and LLVM_LIBS_DIR +to locate lld, and set PATH and LD_LIBRARY_PATH. When doing +a stand-alone builds, these variables represent the installed LLVM. +As a result, tests either fail due to missing lld executables/libraries +or use an earlier installed LLD version rather than the one being built. + +To solve this, an additional LLD_TOOLS_DIR and LLD_LIBS_DIR variables +are added that are populated using LLVM_*_OUTPUT_INTDIR. Those variables +are populated with directories used to output built executables +and libraries. In stand-alone builds, they represent the directories +used by LLD. 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, the resulting PATH is used to locate tools +for substitutions since the search includes both tools built as part of +LLD and of LLVM. + +Differential Revision: https://reviews.llvm.org/D29335 + +git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@294507 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + test/lit.cfg | 14 ++++++++++---- + test/lit.site.cfg.in | 2 ++ + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/test/lit.cfg b/test/lit.cfg +index 0db879312..8dff2fb4e 100644 +--- a/test/lit.cfg ++++ b/test/lit.cfg +@@ -66,18 +66,24 @@ config.llvm_obj_root = getattr(config, 'llvm_obj_root', None) + + # Tweak the PATH to include the tools dir and the scripts dir. + if lld_obj_root is not None: ++ lld_tools_dir = getattr(config, 'lld_tools_dir', None) ++ if not lld_tools_dir: ++ lit_config.fatal('No LLD 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((lld_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 + ++ lld_libs_dir = getattr(config, 'lld_libs_dir', None) ++ if not lld_libs_dir: ++ lit_config.fatal('No LLD 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((lld_libs_dir, llvm_libs_dir, + config.environment.get('LD_LIBRARY_PATH',''))) + config.environment['LD_LIBRARY_PATH'] = path + +@@ -174,10 +180,10 @@ for pattern in tool_patterns: + pattern) + tool_pipe = tool_match.group(2) + tool_name = tool_match.group(4) +- tool_path = lit.util.which(tool_name, llvm_tools_dir) ++ tool_path = lit.util.which(tool_name, config.environment['PATH']) + if not tool_path: + # Warn, but still provide a substitution. +- lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir) ++ lit_config.note('Did not find ' + tool_name + ' in ' + path) + tool_path = llvm_tools_dir + '/' + tool_name + config.substitutions.append((pattern, tool_pipe + tool_path)) + +diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in +index 5293f24c1..9dcb48174 100644 +--- a/test/lit.site.cfg.in ++++ b/test/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.lld_obj_root = "@LLD_BINARY_DIR@" ++config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" ++config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" + config.target_triple = "@TARGET_TRIPLE@" + config.python_executable = "@PYTHON_EXECUTABLE@" + config.have_zlib = "@HAVE_LIBZ@" +-- +2.12.0 + diff --git a/sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch b/sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch new file mode 100644 index 000000000000..b1333ac40bc9 --- /dev/null +++ b/sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch @@ -0,0 +1,82 @@ +From a7fe305520085cff8e4bec0110d323c4f1ccbcab Mon Sep 17 00:00:00 2001 +From: Michal Gorny +Date: Wed, 8 Feb 2017 20:08:29 +0000 +Subject: [PATCH 3/3] [test] Fix zlib cond when building stand-alone, clean up + +Fix the test zlib conditional to use LLVM_ENABLE_ZLIB value when +building stand-alone. The HAVE_LIBZ is not available when performing +a stand-alone build. Since the zlib support is a feature of +the underlying LLVM library, it exports the actual status as the final +value of LLVM_ENABLE_ZLIB in LLVMConfig. + +While at it, canonicalize the boolean value into 0/1 and remove unused +CMake definitions (most likely copied from clang). + +Differential Revision: https://reviews.llvm.org/D29340 + +git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@294508 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + test/CMakeLists.txt | 19 ++++++++++++------- + test/lit.cfg | 2 +- + test/lit.site.cfg.in | 2 +- + 3 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index ede92c13d..962274160 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -3,13 +3,18 @@ set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") + set(LLVM_BUILD_MODE "%(build_mode)s") + set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s") + set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s") +-set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") +-set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") +-if(BUILD_SHARED_LIBS) +- set(ENABLE_SHARED 1) +-else() +- set(ENABLE_SHARED 0) +-endif(BUILD_SHARED_LIBS) ++ ++if(LLD_BUILT_STANDALONE) ++ # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This ++ # value is forced to 0 if zlib was not found, so it is fine to use it ++ # instead of HAVE_LIBZ (not recorded). ++ if(LLVM_ENABLE_ZLIB) ++ set(HAVE_LIBZ 1) ++ endif() ++endif() ++ ++llvm_canonicalize_cmake_booleans( ++ HAVE_LIBZ) + + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in +diff --git a/test/lit.cfg b/test/lit.cfg +index 8dff2fb4e..85469ff6f 100644 +--- a/test/lit.cfg ++++ b/test/lit.cfg +@@ -202,7 +202,7 @@ if execute_external: + config.available_features.add('shell') + + # zlib compression library +-if config.have_zlib == "1": ++if config.have_zlib: + config.available_features.add("zlib") + + # Running on Darwin OS +diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in +index 9dcb48174..1fb8d3690 100644 +--- a/test/lit.site.cfg.in ++++ b/test/lit.site.cfg.in +@@ -10,7 +10,7 @@ config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" + config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" + config.target_triple = "@TARGET_TRIPLE@" + config.python_executable = "@PYTHON_EXECUTABLE@" +-config.have_zlib = "@HAVE_LIBZ@" ++config.have_zlib = @HAVE_LIBZ@ + + # Support substitution of the tools and libs dirs with user parameters. This is + # used when we can't determine the tool dir at configuration time. +-- +2.12.0 + diff --git a/sys-devel/lld/lld-4.0.1.ebuild b/sys-devel/lld/lld-4.0.1.ebuild new file mode 100644 index 000000000000..684bc8deac68 --- /dev/null +++ b/sys-devel/lld/lld-4.0.1.ebuild @@ -0,0 +1,76 @@ +# 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-any-r1 + +DESCRIPTION="The LLVM linker (link editor)" +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="test" + +RDEPEND="~sys-devel/llvm-${PV}" +DEPEND="${RDEPEND} + test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )" + +S=${WORKDIR}/${P/_/}.src + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +python_check_deps() { + has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +pkg_setup() { + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup + use test && python-any-r1_pkg_setup +} + +src_unpack() { + default + + if use test; then + mv llvm-* llvm || die + fi +} + +src_prepare() { + # backport stand-alone build test fixes from master + eapply "${FILESDIR}/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch" + eapply "${FILESDIR}/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch" + + eapply_user +} + +src_configure() { + local mycmakeargs=( + -DBUILD_SHARED_LIBS=ON + + -DLLVM_INCLUDE_TESTS=$(usex test) + # TODO: fix detecting pthread upstream in stand-alone build + -DPTHREAD_LIB='-lpthread' + ) + use test && mycmakeargs+=( + -DLLVM_BUILD_TESTS=ON + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" + -DLIT_COMMAND="${EPREFIX}/usr/bin/lit" + ) + + cmake-utils_src_configure +} + +src_test() { + cmake-utils_src_make check-lld +} diff --git a/sys-devel/lld/lld-5.0.0.ebuild b/sys-devel/lld/lld-5.0.0.ebuild new file mode 100644 index 000000000000..dabb7f02f743 --- /dev/null +++ b/sys-devel/lld/lld-5.0.0.ebuild @@ -0,0 +1,68 @@ +# 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-any-r1 + +DESCRIPTION="The LLVM linker (link editor)" +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="test" + +RDEPEND="~sys-devel/llvm-${PV}" +DEPEND="${RDEPEND} + test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )" + +S=${WORKDIR}/${P/_/}.src + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +python_check_deps() { + has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +pkg_setup() { + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup + use test && python-any-r1_pkg_setup +} + +src_unpack() { + default + + if use test; then + mv llvm-* llvm || die + fi +} + +src_configure() { + local mycmakeargs=( + -DBUILD_SHARED_LIBS=ON + + -DLLVM_INCLUDE_TESTS=$(usex test) + # TODO: fix detecting pthread upstream in stand-alone build + -DPTHREAD_LIB='-lpthread' + ) + use test && mycmakeargs+=( + -DLLVM_BUILD_TESTS=ON + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" + -DLIT_COMMAND="${EPREFIX}/usr/bin/lit" + ) + + cmake-utils_src_configure +} + +src_test() { + cmake-utils_src_make check-lld +} diff --git a/sys-devel/lld/lld-5.0.9999.ebuild b/sys-devel/lld/lld-5.0.9999.ebuild new file mode 100644 index 000000000000..6c2601f5d423 --- /dev/null +++ b/sys-devel/lld/lld-5.0.9999.ebuild @@ -0,0 +1,75 @@ +# 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-any-r1 + +DESCRIPTION="The LLVM linker (link editor)" +HOMEPAGE="https://llvm.org/" +SRC_URI="" +EGIT_REPO_URI="https://git.llvm.org/git/lld.git + https://github.com/llvm-mirror/lld.git" +EGIT_BRANCH="release_50" + +LICENSE="UoI-NCSA" +SLOT="0" +KEYWORDS="" +IUSE="test" + +RDEPEND="~sys-devel/llvm-${PV}" +DEPEND="${RDEPEND} + test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )" + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +python_check_deps() { + has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +pkg_setup() { + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup + use test && python-any-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=( + -DBUILD_SHARED_LIBS=ON + + -DLLVM_INCLUDE_TESTS=$(usex test) + # TODO: fix detecting pthread upstream in stand-alone build + -DPTHREAD_LIB='-lpthread' + ) + use test && mycmakeargs+=( + -DLLVM_BUILD_TESTS=ON + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" + -DLIT_COMMAND="${EPREFIX}/usr/bin/lit" + ) + + cmake-utils_src_configure +} + +src_test() { + cmake-utils_src_make check-lld +} diff --git a/sys-devel/lld/lld-9999.ebuild b/sys-devel/lld/lld-9999.ebuild new file mode 100644 index 000000000000..a8e3f4f39dc9 --- /dev/null +++ b/sys-devel/lld/lld-9999.ebuild @@ -0,0 +1,75 @@ +# 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-any-r1 + +DESCRIPTION="The LLVM linker (link editor)" +HOMEPAGE="https://llvm.org/" +SRC_URI="" +EGIT_REPO_URI="https://git.llvm.org/git/lld.git + https://github.com/llvm-mirror/lld.git" + +LICENSE="UoI-NCSA" +SLOT="0" +KEYWORDS="" +IUSE="test" + +RDEPEND="~sys-devel/llvm-${PV}" +DEPEND="${RDEPEND} + test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )" + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +python_check_deps() { + has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +pkg_setup() { + llvm_pkg_setup + use test && python-any-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=( + -DBUILD_SHARED_LIBS=ON + + -DLLVM_INCLUDE_TESTS=$(usex test) + # TODO: fix detecting pthread upstream in stand-alone build + -DPTHREAD_LIB='-lpthread' + ) + use test && mycmakeargs+=( + -DLLVM_BUILD_TESTS=ON + -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-lld +} diff --git a/sys-devel/lld/metadata.xml b/sys-devel/lld/metadata.xml new file mode 100644 index 000000000000..89c4bdb96049 --- /dev/null +++ b/sys-devel/lld/metadata.xml @@ -0,0 +1,7 @@ + + + + + llvm@gentoo.org + + -- cgit v1.2.3