sys-libs/libomp: Branch for 5.0.0 release
[gentoo.git] / sys-libs / libomp / libomp-5.0.9999.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
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 )
10
11 inherit cmake-multilib git-r3 python-any-r1
12
13 DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
14 HOMEPAGE="https://openmp.llvm.org"
15 SRC_URI=""
16 EGIT_REPO_URI="https://git.llvm.org/git/openmp.git
17         https://github.com/llvm-mirror/openmp.git"
18 EGIT_BRANCH="release_50"
19
20 # Additional licenses:
21 # - MIT-licensed Intel code,
22 # - LLVM Software Grant from Intel.
23
24 LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
25 SLOT="0"
26 KEYWORDS=""
27 IUSE="hwloc ompt test"
28
29 RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )"
30 # tests:
31 # - dev-python/lit provides the test runner
32 # - sys-devel/llvm provide test utils (e.g. FileCheck)
33 # - sys-devel/clang provides the compiler to run tests
34 DEPEND="${RDEPEND}
35         dev-lang/perl
36         test? (
37                 $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
38                 sys-devel/llvm
39                 >=sys-devel/clang-3.9.0
40         )"
41
42 # least intrusive of all
43 CMAKE_BUILD_TYPE=RelWithDebInfo
44
45 python_check_deps() {
46         has_version "dev-python/lit[${PYTHON_USEDEP}]"
47 }
48
49 pkg_setup() {
50         use test && python-any-r1_pkg_setup
51 }
52
53 multilib_src_configure() {
54         local libdir="$(get_libdir)"
55         local mycmakeargs=(
56                 -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
57                 -DLIBOMPTARGET_LIBDIR_SUFFIX="${libdir#lib}"
58                 -DLIBOMP_USE_HWLOC=$(usex hwloc)
59                 -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
60                 # do not install libgomp.so & libiomp5.so aliases
61                 -DLIBOMP_INSTALL_ALIASES=OFF
62                 # disable unnecessary hack copying stuff back to srcdir
63                 -DLIBOMP_COPY_EXPORTS=OFF
64                 -DLIBOMP_TEST_COMPILER="$(type -P "${CHOST}-clang")"
65         )
66         cmake-utils_src_configure
67 }
68
69 multilib_src_test() {
70         # respect TMPDIR!
71         local -x LIT_PRESERVES_TMP=1
72
73         cmake-utils_src_make check-libomp
74 }