Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ml/llvm-ocaml/
Date: Wed, 27 Jun 2018 08:44:50
Message-Id: 1530089073.a4f275f0c584a949712bc032666339aed8d441e8.mgorny@gentoo
1 commit: a4f275f0c584a949712bc032666339aed8d441e8
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 26 21:18:40 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 27 08:44:33 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4f275f0
7
8 dev-ml/llvm-ocaml: Bump to 6.0.1
9
10 dev-ml/llvm-ocaml/Manifest | 1 +
11 dev-ml/llvm-ocaml/llvm-ocaml-6.0.1.ebuild | 127 ++++++++++++++++++++++++++++++
12 2 files changed, 128 insertions(+)
13
14 diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest
15 index 2f801fa6088..53aadd4a873 100644
16 --- a/dev-ml/llvm-ocaml/Manifest
17 +++ b/dev-ml/llvm-ocaml/Manifest
18 @@ -2,3 +2,4 @@ DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10
19 DIST llvm-5.0.1.src.tar.xz 23428720 BLAKE2B 3db4d33df21018d17eef0042c0d8d82a8412bd5daa99cfb5405a6ec83c5774178fa76b220e8731c2a9a64dabf898aa90fe29c685327bd63a4f078e8e94a9a77e SHA512 bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b5366172c4aad46592dfd8afe372349ecf264f581463d017f9cee2d63c1cb
20 DIST llvm-5.0.2.src.tar.xz 23451868 BLAKE2B b7082be2e4ad557b29b9f6869811f262adcf5c73d552faf91b339bede75cf5eab58afefa12fa779a38be71fe2b8f4ea297c3213ee4e8370cc01972c59249d91c SHA512 3588be5ed969c3f7f6f16f56a12a6af2814d3d3c960d4a36ffebb0446cc75f19220bccee7fc605f9b01f5d5c188a905a046193cc12dec42dd5922048b5c27fe1
21 DIST llvm-6.0.0.src.tar.xz 25296048 BLAKE2B 7ea90bb63d6f26cfbc1c1ed2f243b0fcd8ad2ceb7963cf768d262cd55e9a0c71a9cfdea0333fb220faacf4540d924d2512532774dcfb52b52490ad74e38c09e0 SHA512 a71fdd5ddc46f01327ad891cfcc198febdbe10769c57f14d8a4fb7d514621ee4080e1a641200d3353c16a16731d390270499ec6cd3dc98fadc570f3eb6b52b8c
22 +DIST llvm-6.0.1.src.tar.xz 25306628 BLAKE2B 60232d4d22f8096b565cc8d81fea0639f24f14e8fc4f66ade69fa15479181f07f655f26dff3fa24bf105762b495da316c5c9352db234bd0af6b9c3fff6d4d881 SHA512 cbbb00eb99cfeb4aff623ee1a5ba075e7b5a76fc00c5f9f539ff28c108598f5708a0369d5bd92683def5a20c2fe60cab7827b42d628dbfcc79b57e0e91b84dd9
23
24 diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-6.0.1.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-6.0.1.ebuild
25 new file mode 100644
26 index 00000000000..0e64a225bb7
27 --- /dev/null
28 +++ b/dev-ml/llvm-ocaml/llvm-ocaml-6.0.1.ebuild
29 @@ -0,0 +1,127 @@
30 +# Copyright 1999-2018 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
36 +# (needed due to CMAKE_BUILD_TYPE != Gentoo)
37 +CMAKE_MIN_VERSION=3.7.0-r1
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +inherit cmake-utils llvm multiprocessing python-any-r1
41 +
42 +MY_P=llvm-${PV/_/}.src
43 +DESCRIPTION="OCaml bindings for LLVM"
44 +HOMEPAGE="https://llvm.org/"
45 +SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz"
46 +
47 +# Keep in sync with sys-devel/llvm
48 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
49 + NVPTX PowerPC Sparc SystemZ X86 XCore )
50 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
51 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
52 +
53 +LICENSE="UoI-NCSA"
54 +SLOT="0/${PV}"
55 +KEYWORDS="~amd64 ~arm ~x86"
56 +IUSE="debug test ${ALL_LLVM_TARGETS[*]}"
57 +RESTRICT="!test? ( test )"
58 +
59 +RDEPEND="
60 + >=dev-lang/ocaml-4.00.0:0=
61 + dev-ml/ocaml-ctypes:=
62 + ~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,},debug?]
63 + !sys-devel/llvm[ocaml(-)]"
64 +# configparser-3.2 breaks the build (3.3 or none at all are fine)
65 +DEPEND="${RDEPEND}
66 + dev-lang/perl
67 + dev-ml/findlib
68 + test? ( dev-ml/ounit )
69 + !!<dev-python/configparser-3.3.0.2
70 + ${PYTHON_DEPS}"
71 +
72 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
73 + || ( ${ALL_LLVM_TARGETS[*]} )"
74 +
75 +S=${WORKDIR}/${MY_P}
76 +
77 +# least intrusive of all
78 +CMAKE_BUILD_TYPE=RelWithDebInfo
79 +
80 +pkg_setup() {
81 + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
82 + python-any-r1_pkg_setup
83 +}
84 +
85 +src_prepare() {
86 + # Python is needed to run tests using lit
87 + python_setup
88 +
89 + cmake-utils_src_prepare
90 +}
91 +
92 +src_configure() {
93 + local libdir=$(get_libdir)
94 + local mycmakeargs=(
95 + -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
96 +
97 + -DBUILD_SHARED_LIBS=ON
98 + -DLLVM_OCAML_OUT_OF_TREE=ON
99 + -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
100 + -DLLVM_BUILD_TESTS=$(usex test)
101 +
102 + # disable various irrelevant deps and settings
103 + -DLLVM_ENABLE_FFI=OFF
104 + -DLLVM_ENABLE_TERMINFO=OFF
105 + -DHAVE_HISTEDIT_H=NO
106 + -DWITH_POLLY=OFF
107 + -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
108 + -DLLVM_ENABLE_EH=ON
109 + -DLLVM_ENABLE_RTTI=ON
110 +
111 + -DLLVM_HOST_TRIPLE="${CHOST}"
112 +
113 + # disable go bindings
114 + -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
115 +
116 + # TODO: ocamldoc
117 + )
118 +
119 + use test && mycmakeargs+=(
120 + -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
121 + )
122 +
123 + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
124 + # also: custom rules for OCaml do not work for CPPFLAGS
125 + use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG"
126 + cmake-utils_src_configure
127 +
128 + local llvm_libdir=$(llvm-config --libdir)
129 + # an ugly hack; TODO: figure out a way to pass -L to ocaml...
130 + cd "${BUILD_DIR}/${libdir}" || die
131 + ln -s "${llvm_libdir}"/*.so . || die
132 +
133 + if use test; then
134 + local llvm_bindir=$(llvm-config --bindir)
135 + # Force using system-installed tools.
136 + sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \
137 + "${BUILD_DIR}"/test/lit.site.cfg.py || die
138 + fi
139 +}
140 +
141 +src_compile() {
142 + cmake-utils_src_compile ocaml_all
143 +}
144 +
145 +src_test() {
146 + # respect TMPDIR!
147 + local -x LIT_PRESERVES_TMP=1
148 + cmake-utils_src_make check-llvm-bindings-ocaml
149 +}
150 +
151 +src_install() {
152 + DESTDIR="${D}" \
153 + cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die
154 +
155 + dodoc bindings/ocaml/README.txt
156 +}