1 |
commit: 06b36e0f648bef1acf5ad451d9eebe3e04df2120 |
2 |
Author: Mark Wright <gienah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 29 12:08:33 2022 +0000 |
4 |
Commit: Mark Wright <gienah <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 29 12:08:33 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06b36e0f |
7 |
|
8 |
dev-lang/ocaml: Bump to 4.14.0, fix clang build. |
9 |
|
10 |
See: https://github.com/ocaml/ocaml/pull/10774 |
11 |
Closes: https://bugs.gentoo.org/729566 |
12 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
13 |
Signed-off-by: Mark Wright <gienah <AT> gentoo.org> |
14 |
|
15 |
dev-lang/ocaml/Manifest | 1 + |
16 |
dev-lang/ocaml/files/ocaml-4.14.0-clang.patch | 132 ++++++++++++++++++++++++++ |
17 |
dev-lang/ocaml/ocaml-4.14.0.ebuild | 103 ++++++++++++++++++++ |
18 |
3 files changed, 236 insertions(+) |
19 |
|
20 |
diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest |
21 |
index 9466e909f6b9..edc6337be4cb 100644 |
22 |
--- a/dev-lang/ocaml/Manifest |
23 |
+++ b/dev-lang/ocaml/Manifest |
24 |
@@ -7,4 +7,5 @@ DIST ocaml-4.10.2.tar.gz 4933135 BLAKE2B ec5e92adb23c28a254247182c79ab555fd82603 |
25 |
DIST ocaml-4.11.2.tar.gz 5075323 BLAKE2B bdc503d9a8d0e39dd11060febcd0287657b460e50ed81e55578a3e778af990ca5d4ef9011753eee4e1a144da33eb76c95b1672dc99b76e65a2e107eee472fe06 SHA512 03d8a9f6e130142c121ff2eb3d54f584f1e7c8475f066a5803bb0edd2fa172ca06a56a3ec548b225f5c8b12112d7a68511b1e16f3ade075b5f02610d4247bbb3 |
26 |
DIST ocaml-4.12.1.tar.gz 5181696 BLAKE2B 9d21438e09b1a9680eabb65f5c78d9fe84459592ef7bb797a1933e5383f7b6d5cefffa8cdc184abc102417f5dbc0fca8ef624c9b560f89eaff6537544b5b395f SHA512 e942e5cf5530804690ec45c40936ad2acbb60e11279fc676e0f04181fe1855f84ee5c3cb9c337fc5d01f6ee0e7b2251a6c04f7de56d99c20bb62026dff6c5671 |
27 |
DIST ocaml-4.13.1.tar.gz 5323203 BLAKE2B f1dcb1601ebfa2a37351e3a466a7ca601518c2da403b01aeb182738a54d5887523ab554d747d6591cb09b07b417865e20907f7877117b2d2d069ef6c9edc0fae SHA512 da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6 |
28 |
+DIST ocaml-4.14.0.tar.gz 5494844 BLAKE2B f2f9142a95722c7fc5fda205ea6b951939f7d285963b8aa14dc157ac10202ef9d00c7590beabdc97ed83548d61e5ef28b60a360f1a492420a54f4e26dfbf89f0 SHA512 3c5e5b9f00bb109dd99b5f7b0078cf8663d4247e548f3e601d6b2a55582e04bb20f6de85005c4cf2f78ae9aaa449f5ca6f2bab2f6ce83eeb3aeb386e3f2fcc32 |
29 |
DIST ocaml-patches-9.tar.bz2 1700 BLAKE2B 4e46b8fb490db28f815414e285f54e251394ea53e1d25c529bbea9f03e426fd19132b1e2c7c2be7d14983fceb4cad073d191b001f6da522fee4226371d4a2eca SHA512 cc19f9104fac69aecc5effa8cb772342e1fb61cdcd38ba0176efe04cf3d710b1c56d5178748f3bd29099af91fa684da432a8ef8d42de76dbd1b6954a255ea6c0 |
30 |
|
31 |
diff --git a/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch b/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch |
32 |
new file mode 100644 |
33 |
index 000000000000..cd3c042f2639 |
34 |
--- /dev/null |
35 |
+++ b/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch |
36 |
@@ -0,0 +1,132 @@ |
37 |
+commit 28b553622bd0f168411d86ddcfba1adab0d87b92 |
38 |
+Author: Yawar Amin <yawar.amin@×××××.com> |
39 |
+Date: Mon Nov 15 22:40:43 2021 -0500 |
40 |
+ |
41 |
+ Fix ranlib error |
42 |
+ |
43 |
+ - Always pass ranlib one file argument at a time to avoid error 'Exactly |
44 |
+ one archive should be specified' |
45 |
+ - Call ranlib without cd'ing into the library's directory |
46 |
+ - Use Makefile functionality to simplify recipes |
47 |
+ |
48 |
+diff --git a/Makefile b/Makefile |
49 |
+index c2522c775..2e4e44faa 100644 |
50 |
+--- a/Makefile |
51 |
++++ b/Makefile |
52 |
+@@ -549,6 +549,8 @@ else |
53 |
+ endif |
54 |
+ $(MAKE) -C tools installopt |
55 |
+ |
56 |
++LIBRARIES = $(addsuffix .$(A), ocamlcommon ocamlbytecomp ocamloptcomp) |
57 |
++ |
58 |
+ .PHONY: installoptopt |
59 |
+ installoptopt: |
60 |
+ $(INSTALL_PROG) ocamlc.opt$(EXE) "$(INSTALL_BINDIR)" |
61 |
+@@ -585,8 +587,11 @@ endif |
62 |
+ ifeq "$(INSTALL_OCAMLNAT)" "true" |
63 |
+ $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)" |
64 |
+ endif |
65 |
+- cd "$(INSTALL_COMPLIBDIR)" && \ |
66 |
+- $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A) |
67 |
++# Some versions of ranlib do not support multiple archives |
68 |
++ for library in $(LIBRARIES); \ |
69 |
++ do \ |
70 |
++ $(RANLIB) "$(INSTALL_COMPLIBDIR)/$$library"; \ |
71 |
++ done |
72 |
+ |
73 |
+ # Installation of the *.ml sources of compiler-libs |
74 |
+ .PHONY: install-compiler-sources |
75 |
+diff --git a/otherlibs/Makefile.otherlibs.common b/otherlibs/Makefile.otherlibs.common |
76 |
+index 95ff4d58f..6a4451e47 100644 |
77 |
+--- a/otherlibs/Makefile.otherlibs.common |
78 |
++++ b/otherlibs/Makefile.otherlibs.common |
79 |
+@@ -95,7 +95,7 @@ install:: |
80 |
+ fi |
81 |
+ ifneq "$(STUBSLIB)" "" |
82 |
+ $(INSTALL_DATA) $(STUBSLIB) "$(INSTALL_LIBDIR)/" |
83 |
+- cd "$(INSTALL_LIBDIR)"; $(RANLIB) lib$(CLIBNAME).$(A) |
84 |
++ $(RANLIB) "$(INSTALL_LIBDIR)/lib$(CLIBNAME).$(A)" |
85 |
+ endif |
86 |
+ |
87 |
+ $(INSTALL_DATA) \ |
88 |
+@@ -104,7 +104,7 @@ endif |
89 |
+ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
90 |
+ $(INSTALL_DATA) \ |
91 |
+ $(CMIFILES:.cmi=.mli) \ |
92 |
+- $(CMIFILES:.cmi=.cmti) \ |
93 |
++ $(CMIFILES:.cmi=.cmti) \ |
94 |
+ "$(INSTALL_LIBDIR)/" |
95 |
+ endif |
96 |
+ if test -n "$(HEADERS)"; then \ |
97 |
+@@ -115,7 +115,7 @@ installopt: |
98 |
+ $(INSTALL_DATA) \ |
99 |
+ $(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \ |
100 |
+ "$(INSTALL_LIBDIR)/" |
101 |
+- cd "$(INSTALL_LIBDIR)"; $(RANLIB) $(LIBNAME).a |
102 |
++ $(RANLIB) "$(INSTALL_LIBDIR)/$(LIBNAME).$(A)" |
103 |
+ if test -f $(LIBNAME).cmxs; then \ |
104 |
+ $(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR)"; \ |
105 |
+ fi |
106 |
+diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile |
107 |
+index 6b02dc197..dccc45103 100644 |
108 |
+--- a/otherlibs/dynlink/Makefile |
109 |
++++ b/otherlibs/dynlink/Makefile |
110 |
+@@ -249,12 +249,12 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true" |
111 |
+ endif |
112 |
+ |
113 |
+ installopt: |
114 |
+- if $(NATDYNLINK); then \ |
115 |
+- $(INSTALL_DATA) \ |
116 |
+- $(NATOBJS) dynlink.cmxa dynlink.$(A) \ |
117 |
+- "$(INSTALL_LIBDIR)" && \ |
118 |
+- cd "$(INSTALL_LIBDIR)" && $(RANLIB) dynlink.$(A); \ |
119 |
+- fi |
120 |
++ifeq "$(NATDYNLINK)" "true" |
121 |
++ $(INSTALL_DATA) \ |
122 |
++ $(NATOBJS) dynlink.cmxa dynlink.$(A) \ |
123 |
++ "$(INSTALL_LIBDIR)" |
124 |
++ $(RANLIB) "$(INSTALL_LIBDIR)/dynlink.$(A)" |
125 |
++endif |
126 |
+ |
127 |
+ partialclean: |
128 |
+ rm -f $(extract_crc) *.cm[ioaxt] *.cmti *.cmxa \ |
129 |
+diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile |
130 |
+index 8fc1bdb92..379c530fa 100644 |
131 |
+--- a/otherlibs/systhreads/Makefile |
132 |
++++ b/otherlibs/systhreads/Makefile |
133 |
+@@ -121,7 +121,7 @@ install: |
134 |
+ $(INSTALL_PROG) dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \ |
135 |
+ fi |
136 |
+ $(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)" |
137 |
+- cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A) |
138 |
++ $(RANLIB) "$(INSTALL_LIBDIR)/libthreads.$(A)" |
139 |
+ mkdir -p "$(INSTALL_THREADSLIBDIR)" |
140 |
+ $(INSTALL_DATA) \ |
141 |
+ $(CMIFILES) threads.cma \ |
142 |
+@@ -136,11 +136,11 @@ endif |
143 |
+ |
144 |
+ installopt: |
145 |
+ $(INSTALL_DATA) libthreadsnat.$(A) "$(INSTALL_LIBDIR)" |
146 |
+- cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreadsnat.$(A) |
147 |
++ $(RANLIB) "$(INSTALL_LIBDIR)/libthreadsnat.$(A)" |
148 |
+ $(INSTALL_DATA) \ |
149 |
+ $(THREADS_NCOBJS) threads.cmxa threads.$(A) \ |
150 |
+ "$(INSTALL_THREADSLIBDIR)" |
151 |
+- cd "$(INSTALL_THREADSLIBDIR)" && $(RANLIB) threads.$(A) |
152 |
++ $(RANLIB) "$(INSTALL_THREADSLIBDIR)/threads.$(A)" |
153 |
+ |
154 |
+ %.cmi: %.mli |
155 |
+ $(CAMLC) -c $(COMPFLAGS) $< |
156 |
+diff --git a/stdlib/Makefile b/stdlib/Makefile |
157 |
+index df34bc2d4..32c5dab56 100644 |
158 |
+--- a/stdlib/Makefile |
159 |
++++ b/stdlib/Makefile |
160 |
+@@ -105,7 +105,7 @@ installopt-default:: |
161 |
+ $(INSTALL_DATA) \ |
162 |
+ stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx \ |
163 |
+ "$(INSTALL_LIBDIR)" |
164 |
+- cd "$(INSTALL_LIBDIR)"; $(RANLIB) stdlib.$(A) |
165 |
++ $(RANLIB) "$(INSTALL_LIBDIR)/stdlib.$(A)" |
166 |
+ |
167 |
+ ifeq "$(UNIX_OR_WIN32)" "unix" |
168 |
+ HEADERPROGRAM = header |
169 |
|
170 |
diff --git a/dev-lang/ocaml/ocaml-4.14.0.ebuild b/dev-lang/ocaml/ocaml-4.14.0.ebuild |
171 |
new file mode 100644 |
172 |
index 000000000000..d54fe96af6c3 |
173 |
--- /dev/null |
174 |
+++ b/dev-lang/ocaml/ocaml-4.14.0.ebuild |
175 |
@@ -0,0 +1,103 @@ |
176 |
+# Copyright 1999-2022 Gentoo Authors |
177 |
+# Distributed under the terms of the GNU General Public License v2 |
178 |
+ |
179 |
+EAPI=8 |
180 |
+ |
181 |
+inherit flag-o-matic |
182 |
+ |
183 |
+HOMEPAGE="https://ocaml.org/" |
184 |
+SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz" |
185 |
+DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles" |
186 |
+ |
187 |
+LICENSE="QPL-1.0 LGPL-2" |
188 |
+SLOT="0/$(ver_cut 1-2)" |
189 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" |
190 |
+IUSE="emacs flambda latex +ocamlopt xemacs" |
191 |
+ |
192 |
+RDEPEND="sys-libs/binutils-libs:=" |
193 |
+BDEPEND="${RDEPEND} |
194 |
+ virtual/pkgconfig" |
195 |
+PDEPEND="emacs? ( app-emacs/ocaml-mode ) |
196 |
+ xemacs? ( app-xemacs/ocaml )" |
197 |
+ |
198 |
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs' |
199 |
+ |
200 |
+PATCHES=( |
201 |
+ "${FILESDIR}"/${PN}-4.14.0-clang.patch |
202 |
+) |
203 |
+ |
204 |
+src_prepare() { |
205 |
+ default |
206 |
+ |
207 |
+ cp "${FILESDIR}"/ocaml.conf "${T}" || die |
208 |
+ |
209 |
+ # OCaml generates textrels on 32-bit arches |
210 |
+ # We can't do anything about it, but disabling it means that tests |
211 |
+ # for OCaml-based packages won't fail on unexpected output |
212 |
+ # bug #773226 |
213 |
+ if use arm || use ppc || use x86 ; then |
214 |
+ append-ldflags "-Wl,-z,notext" |
215 |
+ fi |
216 |
+ |
217 |
+ # Upstream build ignores LDFLAGS in several places. |
218 |
+ sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \ |
219 |
+ -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \ |
220 |
+ -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \ |
221 |
+ Makefile.config.in || die "LDFLAGS fix failed" |
222 |
+} |
223 |
+ |
224 |
+src_configure() { |
225 |
+ local opt=( |
226 |
+ --bindir="${EPREFIX}/usr/bin" |
227 |
+ --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml" |
228 |
+ --mandir="${EPREFIX}/usr/share/man" |
229 |
+ --prefix="${EPREFIX}/usr" |
230 |
+ $(use_enable flambda) |
231 |
+ ) |
232 |
+ |
233 |
+ econf "${opt[@]}" |
234 |
+} |
235 |
+ |
236 |
+src_compile() { |
237 |
+ env -u P emake world |
238 |
+ |
239 |
+ if use ocamlopt ; then |
240 |
+ env -u P emake opt |
241 |
+ env -u P emake opt.opt |
242 |
+ fi |
243 |
+} |
244 |
+ |
245 |
+src_test() { |
246 |
+ emake -j |
247 |
+ |
248 |
+ # OCaml tests only work when run sequentially |
249 |
+ if use ocamlopt ; then |
250 |
+ emake -j1 ocamltest.opt |
251 |
+ else |
252 |
+ emake -j1 ocamltest |
253 |
+ #ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." |
254 |
+ fi |
255 |
+ |
256 |
+ emake -j1 tests |
257 |
+} |
258 |
+ |
259 |
+src_install() { |
260 |
+ default |
261 |
+ |
262 |
+ dodir /usr/include |
263 |
+ # Create symlink for header files |
264 |
+ dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml |
265 |
+ dodoc Changes README.adoc |
266 |
+ |
267 |
+ # Create envd entry for latex input files |
268 |
+ if use latex ; then |
269 |
+ echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die |
270 |
+ doenvd "${T}"/99ocamldoc |
271 |
+ fi |
272 |
+ |
273 |
+ sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die |
274 |
+ |
275 |
+ # Install ocaml-rebuild portage set |
276 |
+ insinto /usr/share/portage/config/sets |
277 |
+ doins "${T}"/ocaml.conf |
278 |
+} |