lld-9999.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
  5. # (needed due to CMAKE_BUILD_TYPE != Gentoo)
  6. CMAKE_MIN_VERSION=3.7.0-r1
  7. PYTHON_COMPAT=( python2_7 )
  8. inherit cmake-utils git-r3 llvm python-any-r1
  9. DESCRIPTION="The LLVM linker (link editor)"
  10. HOMEPAGE="http://llvm.org/"
  11. SRC_URI=""
  12. EGIT_REPO_URI="http://llvm.org/git/lld.git
  13. https://github.com/llvm-mirror/lld.git"
  14. LICENSE="UoI-NCSA"
  15. SLOT="0"
  16. KEYWORDS=""
  17. IUSE="test"
  18. RDEPEND="~sys-devel/llvm-${PV}"
  19. DEPEND="${RDEPEND}
  20. test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )"
  21. # least intrusive of all
  22. CMAKE_BUILD_TYPE=RelWithDebInfo
  23. python_check_deps() {
  24. has_version "dev-python/lit[${PYTHON_USEDEP}]"
  25. }
  26. pkg_setup() {
  27. llvm_pkg_setup
  28. use test && python-any-r1_pkg_setup
  29. }
  30. src_unpack() {
  31. if use test; then
  32. # needed for patched gtest
  33. git-r3_fetch "http://llvm.org/git/llvm.git
  34. https://github.com/llvm-mirror/llvm.git"
  35. fi
  36. git-r3_fetch
  37. if use test; then
  38. git-r3_checkout http://llvm.org/git/llvm.git \
  39. "${WORKDIR}"/llvm
  40. fi
  41. git-r3_checkout
  42. }
  43. src_configure() {
  44. local mycmakeargs=(
  45. -DBUILD_SHARED_LIBS=ON
  46. -DLLVM_INCLUDE_TESTS=$(usex test)
  47. # TODO: fix detecting pthread upstream in stand-alone build
  48. -DPTHREAD_LIB='-lpthread'
  49. )
  50. use test && mycmakeargs+=(
  51. -DLLVM_BUILD_TESTS=ON
  52. -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
  53. -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
  54. )
  55. cmake-utils_src_configure
  56. }
  57. src_test() {
  58. cmake-utils_src_make check-lld
  59. }