Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
Date: Tue, 22 Feb 2022 00:59:07
Message-Id: 1645491524.9e8369277b272b15f3dd1159fa18b71ec4431a77.sam@gentoo
1 commit: 9e8369277b272b15f3dd1159fa18b71ec4431a77
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 22 00:58:44 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 22 00:58:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e836927
7
8 dev-lang/ocaml: drop 4.05.0-r7, 4.05.0-r8, 4.10.2-r2
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 .../ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch | 70 ---------
13 dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch | 59 --------
14 dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch | 42 ------
15 dev-lang/ocaml/ocaml-4.05.0-r7.ebuild | 155 --------------------
16 dev-lang/ocaml/ocaml-4.05.0-r8.ebuild | 156 ---------------------
17 dev-lang/ocaml/ocaml-4.10.2-r2.ebuild | 105 --------------
18 6 files changed, 587 deletions(-)
19
20 diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch b/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch
21 deleted file mode 100644
22 index cfe3ff636c25..000000000000
23 --- a/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch
24 +++ /dev/null
25 @@ -1,70 +0,0 @@
26 -https://bugs.gentoo.org/755257
27 -
28 -Needed for both fixing the CVE + compatibility with Debian for e.g.
29 -Unison.
30 -
31 -From c6ca3afc78b75d7748e4e09e56c6b020418be06e Mon Sep 17 00:00:00 2001
32 -From: Stephane Glondu <steph@××××××.net>
33 -Date: Fri, 25 Jan 2019 14:34:23 +0100
34 -Subject: [PATCH] Fix integer overflows when unmarshaling a bigarray
35 -
36 -Malicious or corrupted marshaled data can result in a bigarray
37 -with impossibly large dimensions that cause overflow when computing
38 -the in-memory size of the bigarray. Disaster ensues when the data
39 -is read in a too small memory area. This commit checks for overflows
40 -when computing the in-memory size of the bigarray.
41 -
42 -This patch is based on one by Xavier Leroy and has been modified to
43 -use caml_ba_multov instead of caml_umul_overflow which is unavailable
44 -in OCaml 4.05.0.
45 -
46 -The original commit hash is 85162eee9d4072fa9c2f498f03cd94e357033eec.
47 -
48 -Origin: https://github.com/ocaml/ocaml/pull/1718
49 -Bug: https://github.com/ocaml/ocaml/issues/7765
50 -Bug-Debian: https://bugs.debian.org/895472
51 -Bug-CVE: CVE-2018-9838
52 ---- a/otherlibs/bigarray/bigarray_stubs.c
53 -+++ b/otherlibs/bigarray/bigarray_stubs.c
54 -@@ -966,22 +966,34 @@ static void caml_ba_deserialize_longarray(void * dest, intnat num_elts)
55 - uintnat caml_ba_deserialize(void * dst)
56 - {
57 - struct caml_ba_array * b = dst;
58 -- int i, elt_size;
59 -- uintnat num_elts;
60 -+ int i;
61 -+ uintnat num_elts, size;
62 -+ int overflow;
63 -
64 - /* Read back header information */
65 - b->num_dims = caml_deserialize_uint_4();
66 -+ if (b->num_dims < 0 || b->num_dims > CAML_BA_MAX_NUM_DIMS)
67 -+ caml_deserialize_error("input_value: wrong number of bigarray dimensions");
68 - b->flags = caml_deserialize_uint_4() | CAML_BA_MANAGED;
69 - b->proxy = NULL;
70 - for (i = 0; i < b->num_dims; i++) b->dim[i] = caml_deserialize_uint_4();
71 -- /* Compute total number of elements */
72 -- num_elts = caml_ba_num_elts(b);
73 -- /* Determine element size in bytes */
74 -+ /* Compute total number of elements. Watch out for overflows (MPR#7765). */
75 -+ num_elts = 1;
76 -+ for (i = 0; i < b->num_dims; i++) {
77 -+ overflow = 0;
78 -+ num_elts = caml_ba_multov(num_elts, b->dim[i], &overflow);
79 -+ if (overflow)
80 -+ caml_deserialize_error("input_value: size overflow for bigarray");
81 -+ }
82 -+ /* Determine array size in bytes. Watch out for overflows (MPR#7765). */
83 - if ((b->flags & CAML_BA_KIND_MASK) > CAML_BA_CHAR)
84 - caml_deserialize_error("input_value: bad bigarray kind");
85 -- elt_size = caml_ba_element_size[b->flags & CAML_BA_KIND_MASK];
86 -+ overflow = 0;
87 -+ size = caml_ba_multov(num_elts, caml_ba_element_size[b->flags & CAML_BA_KIND_MASK], &overflow);
88 -+ if (overflow)
89 -+ caml_deserialize_error("input_value: size overflow for bigarray");
90 - /* Allocate room for data */
91 -- b->data = malloc(elt_size * num_elts);
92 -+ b->data = malloc(size);
93 - if (b->data == NULL)
94 - caml_deserialize_error("input_value: out of memory for bigarray");
95 - /* Read data */
96
97 diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch b/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
98 deleted file mode 100644
99 index 8b2e99883167..000000000000
100 --- a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
101 +++ /dev/null
102 @@ -1,59 +0,0 @@
103 ---- a/byterun/caml/intext.h
104 -+++ b/byterun/caml/intext.h
105 -@@ -196,7 +196,7 @@
106 -
107 - CAMLextern struct code_fragment * caml_extern_find_code(char *addr);
108 -
109 --struct ext_table caml_code_fragments_table;
110 -+extern struct ext_table caml_code_fragments_table;
111 -
112 - #endif /* CAML_INTERNALS */
113 -
114 ---- a/byterun/caml/major_gc.h
115 -+++ b/byterun/caml/major_gc.h
116 -@@ -64,9 +64,9 @@
117 - extern char *caml_gc_sweep_hp;
118 -
119 - extern int caml_major_window;
120 --double caml_major_ring[Max_major_window];
121 --int caml_major_ring_index;
122 --double caml_major_work_credit;
123 -+extern double caml_major_ring[Max_major_window];
124 -+extern int caml_major_ring_index;
125 -+extern double caml_major_work_credit;
126 - extern double caml_gc_clock;
127 -
128 - /* [caml_major_gc_hook] is called just between the end of the mark
129 ---- a/byterun/meta.c
130 -+++ b/byterun/meta.c
131 -@@ -32,6 +32,8 @@
132 - #include "caml/prims.h"
133 - #include "caml/stacks.h"
134 -
135 -+struct ext_table caml_code_fragments_table;
136 -+
137 - #ifndef NATIVE_CODE
138 -
139 - CAMLprim value caml_get_global_data(value unit)
140 ---- a/byterun/backtrace.c
141 -+++ b/byterun/backtrace.c
142 -@@ -28,7 +28,7 @@
143 - #include "caml/fail.h"
144 -
145 - /* The table of debug information fragments */
146 --struct ext_table caml_debug_info;
147 -+extern struct ext_table caml_debug_info;
148 -
149 - CAMLexport int32_t caml_backtrace_active = 0;
150 - CAMLexport int32_t caml_backtrace_pos = 0;
151 ---- a/asmrun/startup.c
152 -+++ b/asmrun/startup.c
153 -@@ -44,7 +44,7 @@
154 - #endif
155 -
156 - extern int caml_parser_trace;
157 --CAMLexport header_t caml_atom_table[256];
158 -+CAMLextern header_t caml_atom_table[256];
159 - char * caml_code_area_start, * caml_code_area_end;
160 -
161 - /* Initialize the atom table and the static data and code area limits. */
162
163 diff --git a/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch b/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch
164 deleted file mode 100644
165 index 7adb1ea0768d..000000000000
166 --- a/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch
167 +++ /dev/null
168 @@ -1,42 +0,0 @@
169 ---- a/runtime/Makefile
170 -+++ b/runtime/Makefile
171 -@@ -335,7 +335,7 @@
172 - # (without the extension, which is added by the macro)
173 - define COMPILE_C_FILE
174 - $(1).$(O): %.c
175 -- $$(CC) -c $$(OC_CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
176 -+ $$(CC) -c $$(OC_CFLAGS) $(CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
177 - endef
178 -
179 - object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic
180 ---- a/otherlibs/Makefile.otherlibs.common
181 -+++ b/otherlibs/Makefile.otherlibs.common
182 -@@ -138,4 +138,4 @@
183 - $(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $<
184 -
185 - .c.$(O):
186 -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
187 -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
188 ---- a/otherlibs/systhreads/Makefile
189 -+++ b/otherlibs/systhreads/Makefile
190 -@@ -102,10 +102,10 @@
191 - st_stubs_n.$(O): OC_CPPFLAGS += $(NATIVE_CPPFLAGS)
192 -
193 - st_stubs_b.$(O): st_stubs.c $(HEADER)
194 -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
195 -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
196 -
197 - st_stubs_n.$(O): st_stubs.c $(HEADER)
198 -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
199 -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
200 -
201 - partialclean:
202 - rm -f *.cm*
203 ---- a/Makefile.common.in
204 -+++ b/Makefile.common.in
205 -@@ -79,4 +79,4 @@
206 - # general (it supports both .o and .obj)
207 -
208 - %.$(O): %.c
209 -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
210 -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
211
212 diff --git a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
213 deleted file mode 100644
214 index 8f3bd8015bfc..000000000000
215 --- a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
216 +++ /dev/null
217 @@ -1,155 +0,0 @@
218 -# Copyright 1999-2022 Gentoo Authors
219 -# Distributed under the terms of the GNU General Public License v2
220 -
221 -EAPI=7
222 -
223 -inherit flag-o-matic toolchain-funcs
224 -
225 -PATCHLEVEL="9"
226 -MY_P="${P/_/-}"
227 -DESCRIPTION="Type-inferring functional programming language descended from the ML family"
228 -HOMEPAGE="https://ocaml.org"
229 -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> ${MY_P}.tar.gz
230 - mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
231 -
232 -LICENSE="QPL-1.0 LGPL-2"
233 -# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
234 -# so here we go with the subslot.
235 -SLOT="0/$(ver_cut 1-2)"
236 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
237 -IUSE="emacs flambda latex ncurses +ocamlopt spacetime X xemacs"
238 -
239 -RDEPEND="
240 - sys-libs/binutils-libs:=
241 - ncurses? ( sys-libs/ncurses:0= )
242 - spacetime? ( sys-libs/libunwind:= )
243 - X? ( x11-libs/libX11 )
244 - !dev-ml/num"
245 -BDEPEND="${RDEPEND}
246 - virtual/pkgconfig"
247 -PDEPEND="emacs? ( app-emacs/ocaml-mode )
248 - xemacs? ( app-xemacs/ocaml )"
249 -
250 -QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs'
251 -
252 -S="${WORKDIR}/${MY_P}"
253 -
254 -PATCHES=(
255 - "${FILESDIR}/${PN}-4.04.2-tinfo.patch" #459512
256 - "${FILESDIR}"/${P}-gcc10.patch
257 -)
258 -
259 -pkg_setup() {
260 - # dev-lang/ocaml creates its own objects but calls gcc for linking, which will
261 - # results in relocations if gcc wants to create a PIE executable
262 - if gcc-specs-pie ; then
263 - append-ldflags -nopie
264 - ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
265 - ewarn "We have appended -nopie to ocaml build options"
266 - ewarn "because linking an executable with pie while the objects are not pic will not work"
267 - fi
268 -}
269 -
270 -src_prepare() {
271 - EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches"
272 -
273 - cp "${FILESDIR}"/ocaml.conf "${T}" || die
274 -
275 - default
276 -}
277 -
278 -src_configure() {
279 - export LC_ALL=C
280 - local myconf=""
281 -
282 - # Causes build failures because it builds some programs with -pg,
283 - # bug #270920
284 - filter-flags -fomit-frame-pointer
285 - # Bug #285993
286 - filter-mfpmath sse
287 -
288 - # Broken until 4.12
289 - # bug #818445
290 - filter-flags '-flto*'
291 - append-flags -fno-strict-aliasing
292 -
293 - # -ggdb3 & co makes it behave weirdly, breaks sexplib
294 - replace-flags -ggdb* -ggdb
295 -
296 - # OCaml generates textrels on 32-bit arches
297 - # We can't do anything about it, but disabling it means that tests
298 - # for OCaml-based packages won't fail on unexpected output
299 - # bug #773226
300 - if use arm || use ppc || use x86 ; then
301 - append-ldflags "-Wl,-z,notext"
302 - fi
303 -
304 - # It doesn't compile on alpha without this LDFLAGS
305 - use alpha && append-ldflags "-Wl,--no-relax"
306 -
307 - use ncurses || myconf="${myconf} -no-curses"
308 - use X || myconf="${myconf} -no-graph"
309 - use flambda && myconf="${myconf} -flambda"
310 - use spacetime && myconf="${myconf} -spacetime"
311 -
312 - # ocaml uses a home-brewn configure script, preventing it to use econf.
313 - RAW_LDFLAGS="$(raw-ldflags)" ./configure \
314 - --prefix "${EPREFIX}"/usr \
315 - --bindir "${EPREFIX}"/usr/bin \
316 - --target-bindir "${EPREFIX}"/usr/bin \
317 - --libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
318 - --mandir "${EPREFIX}"/usr/share/man \
319 - -target "${CHOST}" \
320 - -host "${CBUILD}" \
321 - -cc "$(tc-getCC)" \
322 - -as "$(tc-getAS)" \
323 - -aspp "$(tc-getCC) -c" \
324 - -partialld "$(tc-getLD) -r" \
325 - --with-pthread ${myconf} || die "configure failed!"
326 -
327 - # http://caml.inria.fr/mantis/view.php?id=4698
328 - export CCLINKFLAGS="${LDFLAGS}"
329 -}
330 -
331 -src_compile() {
332 - emake world
333 -
334 - # Native code generation can be disabled now
335 - if use ocamlopt ; then
336 - # bug #279968
337 - emake opt
338 - emake -j1 opt.opt
339 - fi
340 -}
341 -
342 -src_test() {
343 - if use ocamlopt ; then
344 - emake -j1 tests
345 - else
346 - ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
347 - fi
348 -}
349 -
350 -src_install() {
351 - emake BINDIR="${ED}"/usr/bin \
352 - LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
353 - MANDIR="${ED}"/usr/share/man \
354 - install
355 -
356 - # Symlink the headers to the right place
357 - dodir /usr/include
358 - # Create symlink for header files
359 - dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
360 - dodoc Changes README.adoc
361 - # Create envd entry for latex input files
362 - if use latex ; then
363 - echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
364 - doenvd "${T}/99ocamldoc"
365 - fi
366 -
367 - sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
368 -
369 - # Install ocaml-rebuild portage set
370 - insinto /usr/share/portage/config/sets
371 - doins "${T}"/ocaml.conf
372 -}
373
374 diff --git a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
375 deleted file mode 100644
376 index 58ae1dde82d7..000000000000
377 --- a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
378 +++ /dev/null
379 @@ -1,156 +0,0 @@
380 -# Copyright 1999-2022 Gentoo Authors
381 -# Distributed under the terms of the GNU General Public License v2
382 -
383 -EAPI=7
384 -
385 -inherit flag-o-matic toolchain-funcs
386 -
387 -PATCHLEVEL="9"
388 -MY_P="${P/_/-}"
389 -DESCRIPTION="Type-inferring functional programming language descended from the ML family"
390 -HOMEPAGE="https://ocaml.org"
391 -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> ${MY_P}.tar.gz
392 - mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
393 -
394 -LICENSE="QPL-1.0 LGPL-2"
395 -# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
396 -# so here we go with the subslot.
397 -SLOT="0/$(ver_cut 1-2)"
398 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
399 -IUSE="emacs flambda latex ncurses +ocamlopt spacetime X xemacs"
400 -
401 -RDEPEND="
402 - sys-libs/binutils-libs:=
403 - ncurses? ( sys-libs/ncurses:0= )
404 - spacetime? ( sys-libs/libunwind:= )
405 - X? ( x11-libs/libX11 )
406 - !dev-ml/num"
407 -BDEPEND="${RDEPEND}
408 - virtual/pkgconfig"
409 -PDEPEND="emacs? ( app-emacs/ocaml-mode )
410 - xemacs? ( app-xemacs/ocaml )"
411 -
412 -QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs'
413 -
414 -S="${WORKDIR}/${MY_P}"
415 -
416 -PATCHES=(
417 - "${FILESDIR}"/${PN}-4.04.2-tinfo.patch #459512
418 - "${FILESDIR}"/${P}-gcc10.patch
419 - "${FILESDIR}"/${P}-CVE-2018-9838.patch
420 -)
421 -
422 -pkg_setup() {
423 - # dev-lang/ocaml creates its own objects but calls gcc for linking, which will
424 - # results in relocations if gcc wants to create a PIE executable
425 - if gcc-specs-pie ; then
426 - append-ldflags -nopie
427 - ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
428 - ewarn "We have appended -nopie to ocaml build options"
429 - ewarn "because linking an executable with pie while the objects are not pic will not work"
430 - fi
431 -}
432 -
433 -src_prepare() {
434 - EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches"
435 -
436 - cp "${FILESDIR}"/ocaml.conf "${T}" || die
437 -
438 - default
439 -}
440 -
441 -src_configure() {
442 - export LC_ALL=C
443 - local myconf=""
444 -
445 - # Causes build failures because it builds some programs with -pg,
446 - # bug #270920
447 - filter-flags -fomit-frame-pointer
448 - # Bug #285993
449 - filter-mfpmath sse
450 -
451 - # Broken until 4.12
452 - # bug #818445
453 - filter-flags '-flto*'
454 - append-flags -fno-strict-aliasing
455 -
456 - # -ggdb3 & co makes it behave weirdly, breaks sexplib
457 - replace-flags -ggdb* -ggdb
458 -
459 - # OCaml generates textrels on 32-bit arches
460 - # We can't do anything about it, but disabling it means that tests
461 - # for OCaml-based packages won't fail on unexpected output
462 - # bug #773226
463 - if use arm || use ppc || use x86 ; then
464 - append-ldflags "-Wl,-z,notext"
465 - fi
466 -
467 - # It doesn't compile on alpha without this LDFLAGS
468 - use alpha && append-ldflags "-Wl,--no-relax"
469 -
470 - use ncurses || myconf="${myconf} -no-curses"
471 - use X || myconf="${myconf} -no-graph"
472 - use flambda && myconf="${myconf} -flambda"
473 - use spacetime && myconf="${myconf} -spacetime"
474 -
475 - # ocaml uses a home-brewn configure script, preventing it to use econf.
476 - RAW_LDFLAGS="$(raw-ldflags)" ./configure \
477 - --prefix "${EPREFIX}"/usr \
478 - --bindir "${EPREFIX}"/usr/bin \
479 - --target-bindir "${EPREFIX}"/usr/bin \
480 - --libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
481 - --mandir "${EPREFIX}"/usr/share/man \
482 - -target "${CHOST}" \
483 - -host "${CBUILD}" \
484 - -cc "$(tc-getCC)" \
485 - -as "$(tc-getAS)" \
486 - -aspp "$(tc-getCC) -c" \
487 - -partialld "$(tc-getLD) -r" \
488 - --with-pthread ${myconf} || die "configure failed!"
489 -
490 - # http://caml.inria.fr/mantis/view.php?id=4698
491 - export CCLINKFLAGS="${LDFLAGS}"
492 -}
493 -
494 -src_compile() {
495 - emake world
496 -
497 - # Native code generation can be disabled now
498 - if use ocamlopt ; then
499 - # bug #279968
500 - emake opt
501 - emake -j1 opt.opt
502 - fi
503 -}
504 -
505 -src_test() {
506 - if use ocamlopt ; then
507 - emake -j1 tests
508 - else
509 - ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
510 - fi
511 -}
512 -
513 -src_install() {
514 - emake BINDIR="${ED}"/usr/bin \
515 - LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
516 - MANDIR="${ED}"/usr/share/man \
517 - install
518 -
519 - # Symlink the headers to the right place
520 - dodir /usr/include
521 - # Create symlink for header files
522 - dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
523 - dodoc Changes README.adoc
524 - # Create envd entry for latex input files
525 - if use latex ; then
526 - echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
527 - doenvd "${T}"/99ocamldoc
528 - fi
529 -
530 - sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
531 -
532 - # Install ocaml-rebuild portage set
533 - insinto /usr/share/portage/config/sets
534 - doins "${T}"/ocaml.conf
535 -}
536
537 diff --git a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
538 deleted file mode 100644
539 index fbf4e4c204b6..000000000000
540 --- a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
541 +++ /dev/null
542 @@ -1,105 +0,0 @@
543 -# Copyright 1999-2022 Gentoo Authors
544 -# Distributed under the terms of the GNU General Public License v2
545 -
546 -EAPI=7
547 -
548 -inherit flag-o-matic
549 -
550 -HOMEPAGE="https://ocaml.org/"
551 -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
552 -DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles"
553 -
554 -LICENSE="LGPL-2.1"
555 -SLOT="0/$(ver_cut 1-2)"
556 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
557 -IUSE="emacs flambda latex +ocamlopt spacetime xemacs"
558 -
559 -RDEPEND="sys-libs/binutils-libs:=
560 - spacetime? ( sys-libs/libunwind:= )"
561 -BDEPEND="${RDEPEND}
562 - virtual/pkgconfig"
563 -PDEPEND="emacs? ( app-emacs/ocaml-mode )
564 - xemacs? ( app-xemacs/ocaml )"
565 -
566 -QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
567 -
568 -PATCHES=(
569 - "${FILESDIR}"/${P}-cflags.patch
570 -)
571 -
572 -src_prepare() {
573 - default
574 -
575 - cp "${FILESDIR}"/ocaml.conf "${T}" || die
576 -
577 - # Broken until 4.12
578 - # bug #818445
579 - filter-flags '-flto*'
580 - append-flags -fno-strict-aliasing
581 -
582 - # OCaml generates textrels on 32-bit arches
583 - # We can't do anything about it, but disabling it means that tests
584 - # for OCaml-based packages won't fail on unexpected output
585 - # bug #773226
586 - if use arm || use ppc || use x86 ; then
587 - append-ldflags "-Wl,-z,notext"
588 - fi
589 -
590 - # Upstream build ignores LDFLAGS in several places.
591 - sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
592 - -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
593 - -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
594 - Makefile.config.in || die "LDFLAGS fix failed"
595 - # ${P} overrides upstream build's own P due to a wrong assignment operator.
596 - sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed"
597 -}
598 -
599 -src_configure() {
600 - local opt=(
601 - --bindir="${EPREFIX}/usr/bin"
602 - --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
603 - --mandir="${EPREFIX}/usr/share/man"
604 - --prefix="${EPREFIX}/usr"
605 - $(use_enable flambda)
606 - $(use_enable spacetime)
607 - )
608 - econf ${opt[@]}
609 -}
610 -
611 -src_compile() {
612 - if use ocamlopt ; then
613 - emake world.opt
614 - else
615 - emake world
616 - fi
617 -}
618 -
619 -src_test() {
620 - if use ocamlopt ; then
621 - # OCaml tests only work when run sequentially
622 - emake -j1 -C testsuite all
623 - else
624 - ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
625 - fi
626 -}
627 -
628 -src_install() {
629 - default
630 - dodir /usr/include
631 -
632 - # Create symlink for header files
633 - dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
634 - dodoc Changes README.adoc
635 -
636 - # Create envd entry for latex input files
637 - if use latex ; then
638 - echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}/99ocamldoc" || die
639 - doenvd "${T}"/99ocamldoc
640 - fi
641 -
642 - sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
643 -
644 - # Install ocaml-rebuild portage set
645 - insinto /usr/share/portage/config/sets
646 - doins "${T}"/ocaml.conf
647 -}