public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2015-11-10 12:08 Alexis Ballier
  0 siblings, 0 replies; 11+ messages in thread
From: Alexis Ballier @ 2015-11-10 12:08 UTC (permalink / raw
  To: gentoo-commits

commit:     8484ddce33a613a12ca92e65d73ffb27f9aea76e
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 10 12:08:00 2015 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 10 12:08:00 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8484ddce

dev-lang/ocaml: remove old

Package-Manager: portage-2.2.24
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-lang/ocaml/Manifest                            |   4 -
 ...-3.11.2-Fix-ocamlopt-w.r.t.-binutils-2.21.patch |  66 -----------
 dev-lang/ocaml/ocaml-4.01.0.ebuild                 | 128 ---------------------
 dev-lang/ocaml/ocaml-4.02.1.ebuild                 | 114 ------------------
 dev-lang/ocaml/ocaml-4.02.2.ebuild                 | 115 ------------------
 5 files changed, 427 deletions(-)

diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest
index 31e4a53..70893c3 100644
--- a/dev-lang/ocaml/Manifest
+++ b/dev-lang/ocaml/Manifest
@@ -1,8 +1,4 @@
 DIST ocaml-3.12.1.tar.bz2 2949124 SHA256 edcf563da75e0b91f09765649caa98ab1535e0c7498f0737b5591b7de084958d SHA512 cbb050aabcbe19a4aa070d6cb74f3774cb136692dfd9433ca977f0f9520ad2f583b6cfb1a9cedfedc92e7dc794ac4a869e20aa5a67a4739002feb290435dc7e7 WHIRLPOOL b7bf4844452ab52027e6b785159df6e4defc548d2f3d31eb73dc0dc05214e7c19ed654c8b3ff234a85691599df0be568ba02fafe257856be7f603177584a7ca0
-DIST ocaml-4.01.0.tar.bz2 3691090 SHA256 b1ca708994180236917ae79e17606da5bd334ca6acd6873a550027e1c0ec874a SHA512 b0a4efa89d0e48e5c01922156a73a8ed67c58efa07170710eaef9de1138e1d6fff8a440b2c81860fc63c604f3a4e189b795bb08a5e9d8df60778fcd468985f6e WHIRLPOOL a31cc2c46e19ca1c5ca65ffdee77ef42b7269b1584f81629e29b725b167c7e3d9eb467a3e8171aaba7d2cf1d8aea31d1822c5631fe3e209ce7731c16112a11d3
-DIST ocaml-4.02.1.tar.xz 2031244 SHA256 68c4b01be54c23bc20fc0a8beaa5c7433b8483f8950490129cfe7662e0c6f4dc SHA512 79d257210c0ddfb0367250a688ffb58f143fcc8c159f7d6e149d42b074e811eaf69449b66ad39da399e1bdcb2bab5924d195fc7c5ebc29d44cb637c093b9931d WHIRLPOOL 2c9849f73a705a63c0d0d4682d1ab1225a3150f68bda98805dc2d2b11f100ee7206200b9dc49b07d39d1b737f45671f3662a9bf2c069d6795f26e1f9b9b65ead
-DIST ocaml-4.02.2.tar.xz 2059800 SHA256 60f923988ab7ae023a0799f9699d7d7a476bf8207ee2c900f92c8288ea363085 SHA512 f826cdb149ba594134b02d62343c5d25aca7ca2a36154e360560fe11d285c4f4905074d81db03ce71758254fc390e93ae8d530ecd08853324966f39af870d46e WHIRLPOOL 8fa47f214743000c0e372f77cfe874d1c8e5b043647c753a459a22e6045cecda3f8a18edaca75e262d4004d2b3bf11c500232864cfdf71e9231ac24af4419c0e
 DIST ocaml-4.02.3.tar.xz 2058552 SHA256 83c6697e135b599a196fd7936eaf8a53dd6b8f3155a796d18407b56f91df9ce3 SHA512 a815421f6a320b18e7f351bd66884024ad4a33525ba161a198ea356892ce331be6c1ddf4cd07d120ebe9a902bcf815ce1b17e45f405e4e0b2d55ce1b6d2adada WHIRLPOOL 1104cdcf23b773ebf0c0ef8d8ee36b2b4b58b1fab10a41ff7f2d522c34ae6161bc6cba28b279eea03ac183a111fc332557084b017d0c2ad6f9c969204e309597
 DIST ocaml-patches-3.tar.bz2 4101 SHA256 c4ceb604f4480c78d1cf4f848b0903c8d37798d9761f582d8d1643d4e38b8658 SHA512 8be5c44de5a6b0b7c14723e41d92fe807b881b218cc5eee38ea7519c0f971415cb7fe30035303da275089dcb8a61c4f334c4a88e0bdbced3953503794b8308a7 WHIRLPOOL f1920606785702c44dead01b1426145653bc1931acba2d614c6818baddc051e4f74ca0322cae66ade63ba0cd0df5651cfd67f511fca5f12973b67a0c50ebab6d
-DIST ocaml-patches-6.tar.bz2 2197 SHA256 7acfa3d056c2b3f7dfc3b1f96a2557d81802c837c2ba0abc1487de10627e5e07 SHA512 88afa904044192b945b537cbfc3c17308e333ed1d241332212b9500d01c14bb306905b03f2b48ec64dd2f428df1f7179772d742b77b4402da108ba7790239bf6 WHIRLPOOL d2001a8a3e799080c3981be87bcef62635c11cab037d6d92da186643614c6e2a568543f82f3566bfb099c063ad344cab2238edf863a9fb02081f4e20f442d9f8
 DIST ocaml-patches-7.tar.bz2 2194 SHA256 71e9496af89ded9852d8e1f32be18a5f0d7e11270958fb4bc8c588420b1e9156 SHA512 63bca96f009e2de24ff6f7a4b37b97c5b7655d5ad6196f06cc2b18ca213e87878a310d169378c341c00aaac698530e458e301620bcc21284bc8b9ea143f642dd WHIRLPOOL 02d17436f901c70b2fa8a104d8b7a6526c65ab9b40408b549c4f4dfe7a1eeae8213620d151fb181833782504e4d7cb6fa3ff7ddebe77efcb88d32fe057cbd8cc

diff --git a/dev-lang/ocaml/files/ocaml-3.11.2-Fix-ocamlopt-w.r.t.-binutils-2.21.patch b/dev-lang/ocaml/files/ocaml-3.11.2-Fix-ocamlopt-w.r.t.-binutils-2.21.patch
deleted file mode 100644
index fa7664c..0000000
--- a/dev-lang/ocaml/files/ocaml-3.11.2-Fix-ocamlopt-w.r.t.-binutils-2.21.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Tue, 8 Mar 2011 21:17:40 +0100
-Subject: [PATCH] Fix ocamlopt w.r.t. binutils 2.21
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Bug: http://caml.inria.fr/mantis/view.php?id=5237
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=617404
-Authors: Eric Cooper, spiralvoice
-Reviewed-by: Stéphane Glondu <steph@glondu.net>
----
- asmcomp/amd64/emit.mlp |   13 +++++++------
- asmcomp/i386/emit.mlp  |    6 +++---
- 2 files changed, 10 insertions(+), 9 deletions(-)
-
-diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp
-index 4a3f844..525c6e6 100644
---- a/asmcomp/amd64/emit.mlp
-+++ b/asmcomp/amd64/emit.mlp
-@@ -679,17 +679,18 @@ let fundecl fundecl =
-   emit_all true fundecl.fun_body;
-   List.iter emit_call_gc !call_gc_sites;
-   emit_call_bound_errors ();
-+  begin match Config.system with
-+    "linux" | "gnu" ->
-+      `	.type	{emit_symbol fundecl.fun_name},@function\n`;
-+      `	.size	{emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
-+    | _ -> ()
-+  end;
-   if !float_constants <> [] then begin
-     if macosx
-     then `	.literal8\n`
-     else `	.section	.rodata.cst8,\"a\",@progbits\n`;
-     List.iter emit_float_constant !float_constants
--  end;
--  match Config.system with
--    "linux" | "gnu" ->
--      `	.type	{emit_symbol fundecl.fun_name},@function\n`;
--      `	.size	{emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
--  | _ -> ()
-+  end
- 
- (* Emission of data *)
- 
-diff --git a/asmcomp/i386/emit.mlp b/asmcomp/i386/emit.mlp
-index 2992f29..0b1252c 100644
---- a/asmcomp/i386/emit.mlp
-+++ b/asmcomp/i386/emit.mlp
-@@ -905,12 +905,12 @@ let fundecl fundecl =
-   emit_all true fundecl.fun_body;
-   List.iter emit_call_gc !call_gc_sites;
-   emit_call_bound_errors ();
--  List.iter emit_float_constant !float_constants;
--  match Config.system with
-+  begin match Config.system with
-     "linux_elf" | "bsd_elf" | "gnu" ->
-       `	.type	{emit_symbol fundecl.fun_name},@function\n`;
-       `	.size	{emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
--  | _ -> ()
-+  | _ -> () end;
-+  List.iter emit_float_constant !float_constants
- 
- 
- (* Emission of data *)
--- 

diff --git a/dev-lang/ocaml/ocaml-4.01.0.ebuild b/dev-lang/ocaml/ocaml-4.01.0.ebuild
deleted file mode 100644
index 6278a86..0000000
--- a/dev-lang/ocaml/ocaml-4.01.0.ebuild
+++ /dev/null
@@ -1,128 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit flag-o-matic eutils multilib versionator toolchain-funcs
-
-PATCHLEVEL="6"
-MY_P="${P/_/+}"
-DESCRIPTION="Fast modern type-inferring functional programming language descended from the ML family"
-HOMEPAGE="http://www.ocaml.org/"
-SRC_URI="ftp://ftp.inria.fr/INRIA/Projects/cristal/ocaml/ocaml-$(get_version_component_range 1-2)/${MY_P}.tar.bz2
-	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
-
-LICENSE="QPL-1.0 LGPL-2"
-# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
-# so here we go with the subslot.
-SLOT="0/${PV}"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-fbsd ~x86-linux"
-IUSE="emacs latex ncurses +ocamlopt tk X xemacs"
-
-RDEPEND="tk? ( >=dev-lang/tk-3.3.3 )
-	ncurses? ( sys-libs/ncurses )
-	X? ( x11-libs/libX11 x11-proto/xproto )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-S="${WORKDIR}/${MY_P}"
-pkg_setup() {
-	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
-	# results in relocations if gcc wants to create a PIE executable
-	if gcc-specs-pie ; then
-		append-ldflags -nopie
-		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
-		ewarn "We have appended -nopie to ocaml build options"
-		ewarn "because linking an executable with pie while the objects are not pic will not work"
-	fi
-}
-
-src_prepare() {
-	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
-	# Bug #459512
-	epatch "${FILESDIR}/${PN}-4.01.0-pkg-config-ncurses.patch"
-}
-
-src_configure() {
-	export LC_ALL=C
-	local myconf=""
-
-	# Causes build failures because it builds some programs with -pg,
-	# bug #270920
-	filter-flags -fomit-frame-pointer
-	# Bug #285993
-	filter-mfpmath sse
-
-	# It doesn't compile on alpha without this LDFLAGS
-	use alpha && append-ldflags "-Wl,--no-relax"
-
-	use tk || myconf="${myconf} -no-tk"
-	use ncurses || myconf="${myconf} -no-curses"
-	use X || myconf="${myconf} -no-graph"
-
-	# ocaml uses a home-brewn configure script, preventing it to use econf.
-	RAW_LDFLAGS="$(raw-ldflags)" ./configure -prefix "${EPREFIX}"/usr \
-		--bindir "${EPREFIX}"/usr/bin \
-		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
-		--mandir "${EPREFIX}"/usr/share/man \
-		-host "${CHOST}" \
-		-cc "$(tc-getCC)" \
-		-as "$(tc-getAS)" \
-		-aspp "$(tc-getCC) -c" \
-		-partialld "$(tc-getLD) -r" \
-		--with-pthread ${myconf} || die "configure failed!"
-
-	# http://caml.inria.fr/mantis/view.php?id=4698
-	export CCLINKFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	emake -j1 world
-
-	# Native code generation can be disabled now
-	if use ocamlopt ; then
-		# bug #279968
-		emake -j1 opt
-		emake -j1 opt.opt
-	fi
-}
-
-src_install() {
-	make BINDIR="${ED}"/usr/bin \
-		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
-		MANDIR="${ED}"/usr/share/man \
-		install
-
-	# Symlink the headers to the right place
-	dodir /usr/include
-	dosym /usr/$(get_libdir)/ocaml/caml /usr/include/caml
-
-	dodoc Changes INSTALL README
-
-	# Create and envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${FILESDIR}/ocaml.conf"
-}
-
-pkg_postinst() {
-	echo
-	ewarn "OCaml is not binary compatible from version to version, so you"
-	ewarn "need to rebuild all packages depending on it, that are actually"
-	ewarn "installed on your system. To do so, you can run:"
-	if has_version '>=sys-apps/portage-2.2' ; then
-		ewarn "emerge @ocaml-rebuild"
-	else
-		ewarn "emerge -1 ${EROOT%/}/usr/$(get_libdir)/ocaml"
-	fi
-	echo
-}

diff --git a/dev-lang/ocaml/ocaml-4.02.1.ebuild b/dev-lang/ocaml/ocaml-4.02.1.ebuild
deleted file mode 100644
index deefc1f..0000000
--- a/dev-lang/ocaml/ocaml-4.02.1.ebuild
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit flag-o-matic eutils multilib versionator toolchain-funcs
-
-PATCHLEVEL="6"
-MY_P="${P/_/+}"
-DESCRIPTION="Fast modern type-inferring functional programming language descended from the ML family"
-HOMEPAGE="http://www.ocaml.org/"
-SRC_URI="http://caml.inria.fr/pub/distrib/ocaml-$(get_version_component_range 1-2)/${MY_P}.tar.xz
-	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
-
-LICENSE="QPL-1.0 LGPL-2"
-# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
-# so here we go with the subslot.
-SLOT="0/${PV}"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-fbsd ~x86-linux"
-IUSE="emacs latex ncurses +ocamlopt X xemacs"
-
-RDEPEND="
-	ncurses? ( sys-libs/ncurses )
-	X? ( x11-libs/libX11 x11-proto/xproto )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-S="${WORKDIR}/${MY_P}"
-pkg_setup() {
-	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
-	# results in relocations if gcc wants to create a PIE executable
-	if gcc-specs-pie ; then
-		append-ldflags -nopie
-		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
-		ewarn "We have appended -nopie to ocaml build options"
-		ewarn "because linking an executable with pie while the objects are not pic will not work"
-	fi
-}
-
-src_prepare() {
-	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
-}
-
-src_configure() {
-	export LC_ALL=C
-	local myconf=""
-
-	# Causes build failures because it builds some programs with -pg,
-	# bug #270920
-	filter-flags -fomit-frame-pointer
-	# Bug #285993
-	filter-mfpmath sse
-
-	# It doesn't compile on alpha without this LDFLAGS
-	use alpha && append-ldflags "-Wl,--no-relax"
-
-	use ncurses || myconf="${myconf} -no-curses"
-	use X || myconf="${myconf} -no-graph"
-
-	# ocaml uses a home-brewn configure script, preventing it to use econf.
-	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
-		--prefix "${EPREFIX}"/usr \
-		--bindir "${EPREFIX}"/usr/bin \
-		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
-		--mandir "${EPREFIX}"/usr/share/man \
-		-target "${CHOST}" \
-		-host "${CBUILD}" \
-		-cc "$(tc-getCC)" \
-		-as "$(tc-getAS)" \
-		-aspp "$(tc-getCC) -c" \
-		-partialld "$(tc-getLD) -r" \
-		--with-pthread ${myconf} || die "configure failed!"
-
-	# http://caml.inria.fr/mantis/view.php?id=4698
-	export CCLINKFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	emake world
-
-	# Native code generation can be disabled now
-	if use ocamlopt ; then
-		# bug #279968
-		emake opt
-		emake opt.opt
-	fi
-}
-
-src_install() {
-	emake BINDIR="${ED}"/usr/bin \
-		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
-		MANDIR="${ED}"/usr/share/man \
-		install
-
-	# Symlink the headers to the right place
-	dodir /usr/include
-	dosym /usr/$(get_libdir)/ocaml/caml /usr/include/caml
-
-	dodoc Changes INSTALL README
-
-	# Create and envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${FILESDIR}/ocaml.conf"
-}

diff --git a/dev-lang/ocaml/ocaml-4.02.2.ebuild b/dev-lang/ocaml/ocaml-4.02.2.ebuild
deleted file mode 100644
index c63ec64..0000000
--- a/dev-lang/ocaml/ocaml-4.02.2.ebuild
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit flag-o-matic eutils multilib versionator toolchain-funcs
-
-PATCHLEVEL="7"
-MY_P="${P/_/+}"
-DESCRIPTION="Fast modern type-inferring functional programming language descended from the ML family"
-HOMEPAGE="http://www.ocaml.org/"
-SRC_URI="http://caml.inria.fr/pub/distrib/ocaml-$(get_version_component_range 1-2)/${MY_P}.tar.xz
-	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
-
-LICENSE="QPL-1.0 LGPL-2"
-# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
-# so here we go with the subslot.
-SLOT="0/${PV}"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-fbsd ~x86-linux"
-IUSE="emacs latex ncurses +ocamlopt X xemacs"
-
-RDEPEND="
-	ncurses? ( sys-libs/ncurses )
-	X? ( x11-libs/libX11 x11-proto/xproto )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-S="${WORKDIR}/${MY_P}"
-pkg_setup() {
-	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
-	# results in relocations if gcc wants to create a PIE executable
-	if gcc-specs-pie ; then
-		append-ldflags -nopie
-		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
-		ewarn "We have appended -nopie to ocaml build options"
-		ewarn "because linking an executable with pie while the objects are not pic will not work"
-	fi
-}
-
-src_prepare() {
-	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
-}
-
-src_configure() {
-	export LC_ALL=C
-	local myconf=""
-
-	# Causes build failures because it builds some programs with -pg,
-	# bug #270920
-	filter-flags -fomit-frame-pointer
-	# Bug #285993
-	filter-mfpmath sse
-
-	# It doesn't compile on alpha without this LDFLAGS
-	use alpha && append-ldflags "-Wl,--no-relax"
-
-	use ncurses || myconf="${myconf} -no-curses"
-	use X || myconf="${myconf} -no-graph"
-
-	# ocaml uses a home-brewn configure script, preventing it to use econf.
-	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
-		--prefix "${EPREFIX}"/usr \
-		--bindir "${EPREFIX}"/usr/bin \
-		--target-bindir "${EPREFIX}"/usr/bin \
-		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
-		--mandir "${EPREFIX}"/usr/share/man \
-		-target "${CHOST}" \
-		-host "${CBUILD}" \
-		-cc "$(tc-getCC)" \
-		-as "$(tc-getAS)" \
-		-aspp "$(tc-getCC) -c" \
-		-partialld "$(tc-getLD) -r" \
-		--with-pthread ${myconf} || die "configure failed!"
-
-	# http://caml.inria.fr/mantis/view.php?id=4698
-	export CCLINKFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	emake world
-
-	# Native code generation can be disabled now
-	if use ocamlopt ; then
-		# bug #279968
-		emake opt
-		emake opt.opt
-	fi
-}
-
-src_install() {
-	emake BINDIR="${ED}"/usr/bin \
-		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
-		MANDIR="${ED}"/usr/share/man \
-		install
-
-	# Symlink the headers to the right place
-	dodir /usr/include
-	dosym /usr/$(get_libdir)/ocaml/caml /usr/include/caml
-
-	dodoc Changes INSTALL README
-
-	# Create and envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${FILESDIR}/ocaml.conf"
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2017-01-25 16:56 Alexis Ballier
  0 siblings, 0 replies; 11+ messages in thread
From: Alexis Ballier @ 2017-01-25 16:56 UTC (permalink / raw
  To: gentoo-commits

commit:     4530442dc257bbc66a5b67b1846d16c7d2f0093f
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 25 16:56:07 2017 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Wed Jan 25 16:56:07 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4530442d

dev-lang/ocaml: remove old

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 dev-lang/ocaml/Manifest                            |   1 -
 .../files/ocaml-4.01.0-pkg-config-ncurses.patch    |  15 ---
 dev-lang/ocaml/ocaml-4.02.3-r1.ebuild              | 116 -------------------
 dev-lang/ocaml/ocaml-4.03.0-r1.ebuild              | 125 ---------------------
 4 files changed, 257 deletions(-)

diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest
index c5f58f1..321529f 100644
--- a/dev-lang/ocaml/Manifest
+++ b/dev-lang/ocaml/Manifest
@@ -1,5 +1,4 @@
 DIST ocaml-4.02.3.tar.xz 2058552 SHA256 83c6697e135b599a196fd7936eaf8a53dd6b8f3155a796d18407b56f91df9ce3 SHA512 a815421f6a320b18e7f351bd66884024ad4a33525ba161a198ea356892ce331be6c1ddf4cd07d120ebe9a902bcf815ce1b17e45f405e4e0b2d55ce1b6d2adada WHIRLPOOL 1104cdcf23b773ebf0c0ef8d8ee36b2b4b58b1fab10a41ff7f2d522c34ae6161bc6cba28b279eea03ac183a111fc332557084b017d0c2ad6f9c969204e309597
-DIST ocaml-4.03.0.tar.xz 2289296 SHA256 695caf381105183f9d37bcfb63f863f782352b070e5d7ff3ca269712398fe326 SHA512 9a7f4b17d459373334fb04f8a0d42732243245bf16bc35c935fb2119c7990d0c85549b2e11adea68a98a0a0171a461ccfbb2e249b59eedf90349f087a18ce243 WHIRLPOOL 9c822f7c66494a6e7fc30e565e7c8d120808a15b42cd64ccad0946f8413da44b50ec84dfd658e8f394dce4effe7eda380a0a203db14df9dfc24c7b54f7681cea
 DIST ocaml-4.04.0.tar.gz 4057711 SHA256 03e49d09d5a509216ca0cc8fccd10df3ad9dd441d7633e89974a74e149be3c51 SHA512 288c514e7ccfe29fe9a65239d04f000b3b05df71f15bc05b3e5af50cb233544b4fec22baad69f60de587e8f0f8f65ee023a5b709896a1a68f9fd6fe30b81344d WHIRLPOOL 91fea4195ed84fb97f2ae68e30f47ce60a2404bc47ca809f6e0d182dd755833ea16a2e033ee0a02fab008f5905a2a9b6fa8dc2194c75b8d9daa353eb6b1d70e9
 DIST ocaml-patches-7.tar.bz2 2194 SHA256 71e9496af89ded9852d8e1f32be18a5f0d7e11270958fb4bc8c588420b1e9156 SHA512 63bca96f009e2de24ff6f7a4b37b97c5b7655d5ad6196f06cc2b18ca213e87878a310d169378c341c00aaac698530e458e301620bcc21284bc8b9ea143f642dd WHIRLPOOL 02d17436f901c70b2fa8a104d8b7a6526c65ab9b40408b549c4f4dfe7a1eeae8213620d151fb181833782504e4d7cb6fa3ff7ddebe77efcb88d32fe057cbd8cc
 DIST ocaml-patches-8.tar.bz2 1803 SHA256 bce7ea483842f6e201cdf3de266928b39b5b45322315010291ed28f811720525 SHA512 fc477fbb5bdec60a3c4d3dfa110119bb579560ac0e0e57e30e076da72643bda6359c06fd3745fd3436c5d611dbbd888ec2921e9d1920f4929df633c35a797411 WHIRLPOOL ae73b5377744add3afce012b5745fafd70c0f92f75cd6cf91560e0f2ba359a91f7276afed13db145c307be9fdf79c339c2c69be6946565354c68d701fa61a4be

diff --git a/dev-lang/ocaml/files/ocaml-4.01.0-pkg-config-ncurses.patch b/dev-lang/ocaml/files/ocaml-4.01.0-pkg-config-ncurses.patch
deleted file mode 100644
index b9fa750..00000000
--- a/dev-lang/ocaml/files/ocaml-4.01.0-pkg-config-ncurses.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- ocaml-4.01.0-orig/configure	2013-08-23 16:22:36.000000000 +1000
-+++ ocaml-4.01.0/configure	2014-01-18 20:06:50.669644267 +1100
-@@ -892,7 +892,11 @@
- # For the terminfo module
- 
- if test "$withcurses" = "yes"; then
--  for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do
-+  ncurseslibs=""
-+  if pkg-config --exists ncurses 2>/dev/null; then
-+    ncurseslibs=`pkg-config --libs ncurses`
-+  fi
-+  for libs in "${ncurseslibs}" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do
-     if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then
-       echo "termcap functions found (with libraries '$libs')"
-       echo "#define HAS_TERMCAP" >> s.h

diff --git a/dev-lang/ocaml/ocaml-4.02.3-r1.ebuild b/dev-lang/ocaml/ocaml-4.02.3-r1.ebuild
deleted file mode 100644
index 39bf504..00000000
--- a/dev-lang/ocaml/ocaml-4.02.3-r1.ebuild
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit flag-o-matic eutils multilib versionator toolchain-funcs
-
-PATCHLEVEL="7"
-MY_P="${P/_/+}"
-DESCRIPTION="Fast modern type-inferring functional programming language descended from the ML family"
-HOMEPAGE="http://www.ocaml.org/"
-SRC_URI="http://caml.inria.fr/pub/distrib/ocaml-$(get_version_component_range 1-2)/${MY_P}.tar.xz
-	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
-
-LICENSE="QPL-1.0 LGPL-2"
-# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
-# so here we go with the subslot.
-SLOT="0/${PV}"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
-IUSE="emacs latex ncurses +ocamlopt X xemacs"
-
-RDEPEND="
-	ncurses? ( sys-libs/ncurses:0= )
-	X? ( x11-libs/libX11 x11-proto/xproto )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-S="${WORKDIR}/${MY_P}"
-pkg_setup() {
-	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
-	# results in relocations if gcc wants to create a PIE executable
-	if gcc-specs-pie ; then
-		append-ldflags -nopie
-		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
-		ewarn "We have appended -nopie to ocaml build options"
-		ewarn "because linking an executable with pie while the objects are not pic will not work"
-	fi
-}
-
-src_prepare() {
-	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
-}
-
-src_configure() {
-	export LC_ALL=C
-	local myconf=""
-
-	# Causes build failures because it builds some programs with -pg,
-	# bug #270920
-	filter-flags -fomit-frame-pointer
-	# Bug #285993
-	filter-mfpmath sse
-
-	# It doesn't compile on alpha without this LDFLAGS
-	use alpha && append-ldflags "-Wl,--no-relax"
-
-	use ncurses || myconf="${myconf} -no-curses"
-	use X || myconf="${myconf} -no-graph"
-
-	# ocaml uses a home-brewn configure script, preventing it to use econf.
-	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
-		--prefix "${EPREFIX}"/usr \
-		--bindir "${EPREFIX}"/usr/bin \
-		--target-bindir "${EPREFIX}"/usr/bin \
-		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
-		--mandir "${EPREFIX}"/usr/share/man \
-		--no-ocamlbuild \
-		-target "${CHOST}" \
-		-host "${CBUILD}" \
-		-cc "$(tc-getCC)" \
-		-as "$(tc-getAS)" \
-		-aspp "$(tc-getCC) -c" \
-		-partialld "$(tc-getLD) -r" \
-		--with-pthread ${myconf} || die "configure failed!"
-
-	# http://caml.inria.fr/mantis/view.php?id=4698
-	export CCLINKFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	emake world
-
-	# Native code generation can be disabled now
-	if use ocamlopt ; then
-		# bug #279968
-		emake opt
-		emake opt.opt
-	fi
-}
-
-src_install() {
-	emake BINDIR="${ED}"/usr/bin \
-		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
-		MANDIR="${ED}"/usr/share/man \
-		install
-
-	# Symlink the headers to the right place
-	dodir /usr/include
-	dosym /usr/$(get_libdir)/ocaml/caml /usr/include/caml
-
-	dodoc Changes INSTALL README
-
-	# Create and envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${FILESDIR}/ocaml.conf"
-}

diff --git a/dev-lang/ocaml/ocaml-4.03.0-r1.ebuild b/dev-lang/ocaml/ocaml-4.03.0-r1.ebuild
deleted file mode 100644
index d2df32d..00000000
--- a/dev-lang/ocaml/ocaml-4.03.0-r1.ebuild
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit flag-o-matic eutils multilib versionator toolchain-funcs
-
-PATCHLEVEL="8"
-MY_P="${P/_/+}"
-DESCRIPTION="Fast modern type-inferring functional programming language descended from the ML family"
-HOMEPAGE="http://www.ocaml.org/"
-SRC_URI="http://caml.inria.fr/pub/distrib/ocaml-$(get_version_component_range 1-2)/${MY_P}.tar.xz
-	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
-
-LICENSE="QPL-1.0 LGPL-2"
-# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
-# so here we go with the subslot.
-SLOT="0/${PV}"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
-IUSE="emacs flambda latex ncurses +ocamlopt X xemacs"
-
-RDEPEND="
-	sys-libs/binutils-libs:=
-	ncurses? ( sys-libs/ncurses:0= )
-	X? ( x11-libs/libX11 x11-proto/xproto )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-S="${WORKDIR}/${MY_P}"
-pkg_setup() {
-	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
-	# results in relocations if gcc wants to create a PIE executable
-	if gcc-specs-pie ; then
-		append-ldflags -nopie
-		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
-		ewarn "We have appended -nopie to ocaml build options"
-		ewarn "because linking an executable with pie while the objects are not pic will not work"
-	fi
-}
-
-src_prepare() {
-	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
-}
-
-src_configure() {
-	export LC_ALL=C
-	local myconf=""
-
-	# Causes build failures because it builds some programs with -pg,
-	# bug #270920
-	filter-flags -fomit-frame-pointer
-	# Bug #285993
-	filter-mfpmath sse
-
-	# It doesn't compile on alpha without this LDFLAGS
-	use alpha && append-ldflags "-Wl,--no-relax"
-
-	use ncurses || myconf="${myconf} -no-curses"
-	use X || myconf="${myconf} -no-graph"
-	use flambda && myconf="${myconf} -flambda"
-
-	# ocaml uses a home-brewn configure script, preventing it to use econf.
-	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
-		--prefix "${EPREFIX}"/usr \
-		--bindir "${EPREFIX}"/usr/bin \
-		--target-bindir "${EPREFIX}"/usr/bin \
-		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
-		--mandir "${EPREFIX}"/usr/share/man \
-		-target "${CHOST}" \
-		-host "${CBUILD}" \
-		-cc "$(tc-getCC)" \
-		-as "$(tc-getAS)" \
-		-aspp "$(tc-getCC) -c" \
-		-partialld "$(tc-getLD) -r" \
-		--with-pthread ${myconf} || die "configure failed!"
-
-	# http://caml.inria.fr/mantis/view.php?id=4698
-	export CCLINKFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	emake world
-
-	# Native code generation can be disabled now
-	if use ocamlopt ; then
-		# bug #279968
-		emake opt
-		emake opt.opt
-	fi
-}
-
-src_test() {
-	if use ocamlopt ; then
-		emake -j1 tests
-	else
-		ewarn "${PN} testsuite requires ocamlopt useflag"
-	fi
-}
-
-src_install() {
-	emake BINDIR="${ED}"/usr/bin \
-		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
-		MANDIR="${ED}"/usr/share/man \
-		install
-
-	# Symlink the headers to the right place
-	dodir /usr/include
-	dosym /usr/$(get_libdir)/ocaml/caml /usr/include/caml
-
-	dodoc Changes README.adoc
-
-	# Create and envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${FILESDIR}/ocaml.conf"
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2021-01-28 22:15 Alfredo Tupone
  0 siblings, 0 replies; 11+ messages in thread
From: Alfredo Tupone @ 2021-01-28 22:15 UTC (permalink / raw
  To: gentoo-commits

commit:     77fd8a0f1e7d400c8658105c0e0163ac49b6412b
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 28 22:15:08 2021 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 22:15:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77fd8a0f

dev-lang/ocaml: build with gcc-10

Bug: https://bugs.gentoo.org/735274
Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch |  59 ++++++++++++
 dev-lang/ocaml/ocaml-4.05.0-r2.ebuild         | 132 ++++++++++++++++++++++++++
 2 files changed, 191 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch b/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
new file mode 100644
index 00000000000..a0c67da534a
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
@@ -0,0 +1,59 @@
+--- a/byterun/caml/intext.h	2021-01-28 22:46:20.400224678 +0100
++++ b/byterun/caml/intext.h	2021-01-28 22:46:49.312751054 +0100
+@@ -196,7 +196,7 @@
+ 
+ CAMLextern struct code_fragment * caml_extern_find_code(char *addr);
+ 
+-struct ext_table caml_code_fragments_table;
++extern struct ext_table caml_code_fragments_table;
+ 
+ #endif /* CAML_INTERNALS */
+ 
+--- a/byterun/caml/major_gc.h	2021-01-28 22:44:12.193323457 +0100
++++ b/byterun/caml/major_gc.h	2021-01-28 22:45:20.918198701 +0100
+@@ -64,9 +64,9 @@
+ extern char *caml_gc_sweep_hp;
+ 
+ extern int caml_major_window;
+-double caml_major_ring[Max_major_window];
+-int caml_major_ring_index;
+-double caml_major_work_credit;
++extern double caml_major_ring[Max_major_window];
++extern int caml_major_ring_index;
++extern double caml_major_work_credit;
+ extern double caml_gc_clock;
+ 
+ /* [caml_major_gc_hook] is called just between the end of the mark
+--- a/byterun/meta.c	2021-01-28 22:47:34.148016359 +0100
++++ b/byterun/meta.c	2021-01-28 22:47:56.048657393 +0100
+@@ -32,6 +32,8 @@
+ #include "caml/prims.h"
+ #include "caml/stacks.h"
+ 
++struct ext_table caml_code_fragments_table;
++
+ #ifndef NATIVE_CODE
+ 
+ CAMLprim value caml_get_global_data(value unit)
+--- a/byterun/backtrace.c	2021-01-28 22:50:25.275226598 +0100
++++ b/byterun/backtrace.c	2021-01-28 22:50:37.541027290 +0100
+@@ -28,7 +28,7 @@
+ #include "caml/fail.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++extern struct ext_table caml_debug_info;
+ 
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+--- a/asmrun/startup.c	2021-01-28 23:02:50.526072662 +0100
++++ b/asmrun/startup.c	2021-01-28 23:03:09.977754311 +0100
+@@ -44,7 +44,7 @@
+ #endif
+ 
+ extern int caml_parser_trace;
+-CAMLexport header_t caml_atom_table[256];
++CAMLextern header_t caml_atom_table[256];
+ char * caml_code_area_start, * caml_code_area_end;
+ 
+ /* Initialize the atom table and the static data and code area limits. */

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r2.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r2.ebuild
new file mode 100644
index 00000000000..dc6ca02c535
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.05.0-r2.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit flag-o-matic eutils multilib versionator toolchain-funcs
+
+PATCHLEVEL="9"
+MY_P="${P/_/-}"
+DESCRIPTION="Type-inferring functional programming language descended from the ML family"
+HOMEPAGE="https://ocaml.org"
+SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> ${MY_P}.tar.gz
+	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
+
+LICENSE="QPL-1.0 LGPL-2"
+# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
+# so here we go with the subslot.
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="emacs flambda latex ncurses +ocamlopt spacetime X xemacs"
+
+RDEPEND="
+	sys-libs/binutils-libs:=
+	ncurses? ( sys-libs/ncurses:0= )
+	spacetime? ( sys-libs/libunwind:= )
+	X? ( x11-libs/libX11 )
+	!dev-ml/num"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+
+PDEPEND="emacs? ( app-emacs/ocaml-mode )
+	xemacs? ( app-xemacs/ocaml )"
+
+S="${WORKDIR}/${MY_P}"
+pkg_setup() {
+	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
+	# results in relocations if gcc wants to create a PIE executable
+	if gcc-specs-pie ; then
+		append-ldflags -nopie
+		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
+		ewarn "We have appended -nopie to ocaml build options"
+		ewarn "because linking an executable with pie while the objects are not pic will not work"
+	fi
+}
+
+src_prepare() {
+	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+	epatch "${FILESDIR}/${PN}-4.04.2-tinfo.patch" #459512
+	epatch "${FILESDIR}"/${P}-gcc10.patch
+}
+
+src_configure() {
+	export LC_ALL=C
+	local myconf=""
+
+	# Causes build failures because it builds some programs with -pg,
+	# bug #270920
+	filter-flags -fomit-frame-pointer
+	# Bug #285993
+	filter-mfpmath sse
+
+	# -ggdb3 & co makes it behave weirdly, breaks sexplib
+	replace-flags -ggdb* -ggdb
+
+	# It doesn't compile on alpha without this LDFLAGS
+	use alpha && append-ldflags "-Wl,--no-relax"
+
+	use ncurses || myconf="${myconf} -no-curses"
+	use X || myconf="${myconf} -no-graph"
+	use flambda && myconf="${myconf} -flambda"
+	use spacetime && myconf="${myconf} -spacetime"
+
+	# ocaml uses a home-brewn configure script, preventing it to use econf.
+	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
+		--prefix "${EPREFIX}"/usr \
+		--bindir "${EPREFIX}"/usr/bin \
+		--target-bindir "${EPREFIX}"/usr/bin \
+		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
+		--mandir "${EPREFIX}"/usr/share/man \
+		-target "${CHOST}" \
+		-host "${CBUILD}" \
+		-cc "$(tc-getCC)" \
+		-as "$(tc-getAS)" \
+		-aspp "$(tc-getCC) -c" \
+		-partialld "$(tc-getLD) -r" \
+		--with-pthread ${myconf} || die "configure failed!"
+
+	# http://caml.inria.fr/mantis/view.php?id=4698
+	export CCLINKFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	emake world
+
+	# Native code generation can be disabled now
+	if use ocamlopt ; then
+		# bug #279968
+		emake opt
+		emake -j1 opt.opt
+	fi
+}
+
+src_test() {
+	if use ocamlopt ; then
+		emake -j1 tests
+	else
+		ewarn "${PN} testsuite requires ocamlopt useflag"
+	fi
+}
+
+src_install() {
+	emake BINDIR="${ED}"/usr/bin \
+		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
+		MANDIR="${ED}"/usr/share/man \
+		install
+
+	# Symlink the headers to the right place
+	dodir /usr/include
+	dosym /usr/$(get_libdir)/ocaml/caml /usr/include/caml
+
+	dodoc Changes README.adoc
+
+	# Create and envd entry for latex input files
+	if use latex ; then
+		echo "TEXINPUTS=${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc
+		doenvd "${T}"/99ocamldoc
+	fi
+
+	# Install ocaml-rebuild portage set
+	insinto /usr/share/portage/config/sets
+	doins "${FILESDIR}/ocaml.conf"
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2021-10-09  5:56 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2021-10-09  5:56 UTC (permalink / raw
  To: gentoo-commits

commit:     474a14bc9ede109fb7a8033667f42b6f63720962
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  9 05:54:21 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  9 05:55:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=474a14bc

dev-lang/ocaml: fix build with glibc 2.34

Closes: https://bugs.gentoo.org/816765
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch | 91 ++++++++++++++++++++++
 dev-lang/ocaml/ocaml-4.12.0-r2.ebuild              |  4 +
 dev-lang/ocaml/ocaml-4.12.1.ebuild                 |  4 +
 3 files changed, 99 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch
new file mode 100644
index 00000000000..486b44846a8
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch
@@ -0,0 +1,91 @@
+https://src.fedoraproject.org/rpms/ocaml/blob/129153b85109944bf0b2922949f77ef8f32b39a1/f/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch
+https://bugs.gentoo.org/816765
+
+From 3104d92743614f8f52039e0520116af4179880a5 Mon Sep 17 00:00:00 2001
+From: Xavier Leroy <xavierleroy@users.noreply.github.com>
+Date: Fri, 5 Mar 2021 19:14:07 +0100
+Subject: [PATCH 4/4] Dynamically allocate the alternate signal stack (#10266)
+
+In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
+It is no longer possible to statically allocate the alternate signal
+stack for the main thread, as we've been doing for the last 25 years.
+
+This commit implements dynamic allocation of the alternate signal stack
+even for the main thread.  It reuses the code already in place to allocate
+the alternate signal stack for other threads.
+
+Fixes: #10250.
+(cherry picked from commit fc9534746bf5d08a4c109f22e344cf49d5d46d54)
+--- a/runtime/caml/signals.h
++++ b/runtime/caml/signals.h
+@@ -87,7 +87,7 @@ value caml_do_pending_actions_exn (void);
+ value caml_process_pending_actions_with_root (value extra_root); // raises
+ value caml_process_pending_actions_with_root_exn (value extra_root);
+ int caml_set_signal_action(int signo, int action);
+-CAMLextern void caml_setup_stack_overflow_detection(void);
++CAMLextern int caml_setup_stack_overflow_detection(void);
+ 
+ CAMLextern void (*caml_enter_blocking_section_hook)(void);
+ CAMLextern void (*caml_leave_blocking_section_hook)(void);
+--- a/runtime/signals_byt.c
++++ b/runtime/signals_byt.c
+@@ -81,4 +81,4 @@ int caml_set_signal_action(int signo, int action)
+     return 0;
+ }
+ 
+-CAMLexport void caml_setup_stack_overflow_detection(void) {}
++CAMLexport int caml_setup_stack_overflow_detection(void) { return 0; }
+--- a/runtime/signals_nat.c
++++ b/runtime/signals_nat.c
+@@ -181,8 +181,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #error "CONTEXT_SP is required if HAS_STACK_OVERFLOW_DETECTION is defined"
+ #endif
+ 
+-static char sig_alt_stack[SIGSTKSZ];
+-
+ /* Code compiled with ocamlopt never accesses more than
+    EXTRA_STACK bytes below the stack pointer. */
+ #define EXTRA_STACK 256
+@@ -276,28 +274,33 @@ void caml_init_signals(void)
+ #endif
+ 
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+-  {
+-    stack_t stk;
++  if (caml_setup_stack_overflow_detection() != -1) {
+     struct sigaction act;
+-    stk.ss_sp = sig_alt_stack;
+-    stk.ss_size = SIGSTKSZ;
+-    stk.ss_flags = 0;
+     SET_SIGACT(act, segv_handler);
+     act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+     sigemptyset(&act.sa_mask);
+-    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
++    sigaction(SIGSEGV, &act, NULL);
+   }
+ #endif
+ }
+ 
+-CAMLexport void caml_setup_stack_overflow_detection(void)
++/* Allocate and select an alternate stack for handling signals,
++   especially SIGSEGV signals.
++   Each thread needs its own alternate stack.
++   The alternate stack used to be statically-allocated for the main thread,
++   but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
++   may not be a compile-time constant (issue #10250). */
++
++CAMLexport int caml_setup_stack_overflow_detection(void)
+ {
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+   stack_t stk;
+   stk.ss_sp = malloc(SIGSTKSZ);
++  if (stk.ss_sp == NULL) return -1;
+   stk.ss_size = SIGSTKSZ;
+   stk.ss_flags = 0;
+-  if (stk.ss_sp)
+-    sigaltstack(&stk, NULL);
++  return sigaltstack(&stk, NULL);
++#else
++  return 0;
+ #endif
+ }

diff --git a/dev-lang/ocaml/ocaml-4.12.0-r2.ebuild b/dev-lang/ocaml/ocaml-4.12.0-r2.ebuild
index da99522c6e3..287a7f38e79 100644
--- a/dev-lang/ocaml/ocaml-4.12.0-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.12.0-r2.ebuild
@@ -20,6 +20,10 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.12.0-glibc-2.34.patch
+)
+
 src_prepare() {
 	default
 

diff --git a/dev-lang/ocaml/ocaml-4.12.1.ebuild b/dev-lang/ocaml/ocaml-4.12.1.ebuild
index da99522c6e3..287a7f38e79 100644
--- a/dev-lang/ocaml/ocaml-4.12.1.ebuild
+++ b/dev-lang/ocaml/ocaml-4.12.1.ebuild
@@ -20,6 +20,10 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.12.0-glibc-2.34.patch
+)
+
 src_prepare() {
 	default
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2021-10-17  5:24 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2021-10-17  5:24 UTC (permalink / raw
  To: gentoo-commits

commit:     c309652d566cedeb0c93c8b1a08569f54545d354
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 17 05:16:49 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 17 05:24:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c309652d

dev-lang/ocaml: fix build with glibc-2.34 in 4.11.2

Closes: https://bugs.gentoo.org/804498
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch | 91 ++++++++++++++++++++++
 dev-lang/ocaml/ocaml-4.11.2-r2.ebuild              |  4 +
 2 files changed, 95 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch
new file mode 100644
index 00000000000..22cbb806e6e
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch
@@ -0,0 +1,91 @@
+https://gitlab.com/redhat/centos-stream/rpms/ocaml/-/raw/c9s/0006-Dynamically-allocate-the-alternate-signal-stack-1026.patch
+https://bugs.gentoo.org/804498
+
+From 24a9db7784ddfcf0af2d2be2f51616ed960ae7e8 Mon Sep 17 00:00:00 2001
+From: Xavier Leroy <xavierleroy@users.noreply.github.com>
+Date: Fri, 5 Mar 2021 19:14:07 +0100
+Subject: [PATCH 6/6] Dynamically allocate the alternate signal stack (#10266)
+
+In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
+It is no longer possible to statically allocate the alternate signal
+stack for the main thread, as we've been doing for the last 25 years.
+
+This commit implements dynamic allocation of the alternate signal stack
+even for the main thread.  It reuses the code already in place to allocate
+the alternate signal stack for other threads.
+
+Fixes: #10250.
+(cherry picked from commit fc9534746bf5d08a4c109f22e344cf49d5d46d54)
+--- a/runtime/caml/signals.h
++++ b/runtime/caml/signals.h
+@@ -82,7 +82,7 @@ void caml_set_action_pending (void);
+ value caml_do_pending_actions_exn (void);
+ value caml_process_pending_actions_with_root (value extra_root); // raises
+ int caml_set_signal_action(int signo, int action);
+-void caml_setup_stack_overflow_detection(void);
++CAMLextern int caml_setup_stack_overflow_detection(void);
+ 
+ CAMLextern void (*caml_enter_blocking_section_hook)(void);
+ CAMLextern void (*caml_leave_blocking_section_hook)(void);
+--- a/runtime/signals_byt.c
++++ b/runtime/signals_byt.c
+@@ -86,4 +86,4 @@ int caml_set_signal_action(int signo, int action)
+     return 0;
+ }
+ 
+-void caml_setup_stack_overflow_detection(void) {}
++CAMLexport int caml_setup_stack_overflow_detection(void) { return 0; }
+--- a/runtime/signals_nat.c
++++ b/runtime/signals_nat.c
+@@ -195,8 +195,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #error "CONTEXT_SP is required if HAS_STACK_OVERFLOW_DETECTION is defined"
+ #endif
+ 
+-static char sig_alt_stack[SIGSTKSZ];
+-
+ /* Code compiled with ocamlopt never accesses more than
+    EXTRA_STACK bytes below the stack pointer. */
+ #define EXTRA_STACK 256
+@@ -282,28 +280,33 @@ void caml_init_signals(void)
+ #endif
+ 
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+-  {
+-    stack_t stk;
++  if (caml_setup_stack_overflow_detection() != -1) {
+     struct sigaction act;
+-    stk.ss_sp = sig_alt_stack;
+-    stk.ss_size = SIGSTKSZ;
+-    stk.ss_flags = 0;
+     SET_SIGACT(act, segv_handler);
+     act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+     sigemptyset(&act.sa_mask);
+-    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
++    sigaction(SIGSEGV, &act, NULL);
+   }
+ #endif
+ }
+ 
+-void caml_setup_stack_overflow_detection(void)
++/* Allocate and select an alternate stack for handling signals,
++   especially SIGSEGV signals.
++   Each thread needs its own alternate stack.
++   The alternate stack used to be statically-allocated for the main thread,
++   but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
++   may not be a compile-time constant (issue #10250). */
++
++CAMLexport int caml_setup_stack_overflow_detection(void)
+ {
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+   stack_t stk;
+   stk.ss_sp = malloc(SIGSTKSZ);
++  if (stk.ss_sp == NULL) return -1;
+   stk.ss_size = SIGSTKSZ;
+   stk.ss_flags = 0;
+-  if (stk.ss_sp)
+-    sigaltstack(&stk, NULL);
++  return sigaltstack(&stk, NULL);
++#else
++  return 0;
+ #endif
+ }

diff --git a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
index 2d52afb654e..51cc9f56afa 100644
--- a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
@@ -21,6 +21,10 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.11.2-glibc-2.34.patch
+)
+
 src_prepare() {
 	default
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2022-01-22 20:25 Alfredo Tupone
  0 siblings, 0 replies; 11+ messages in thread
From: Alfredo Tupone @ 2022-01-22 20:25 UTC (permalink / raw
  To: gentoo-commits

commit:     aa94926bbf041302507bd8a121edba782f0d2afc
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 22 20:25:03 2022 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sat Jan 22 20:25:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa94926b

dev-lang/ocaml: respect CFLAGS for ocaml-4.09

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch | 54 ++++++++++++++++++++++++++
 dev-lang/ocaml/ocaml-4.09.0-r2.ebuild          |  7 +++-
 2 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
new file mode 100644
index 000000000000..920cd32264b6
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
@@ -0,0 +1,54 @@
+--- a/runtime/Makefile	2022-01-22 19:49:32.914213696 +0100
++++ b/runtime/Makefile	2022-01-22 19:50:03.765640701 +0100
+@@ -335,7 +335,7 @@
+ # (without the extension, which is added by the macro)
+ define COMPILE_C_FILE
+ $(1).$(O): %.c
+-	$$(CC) -c $$(OC_CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
++	$$(CC) -c $$(OC_CFLAGS) $(CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
+ endef
+ 
+ object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic
+--- a/yacc/Makefile	2022-01-22 20:02:56.510340885 +0100
++++ b/yacc/Makefile	2022-01-22 20:03:14.998000508 +0100
+@@ -63,4 +63,4 @@
+ # also works for .obj files.
+ 
+ %.$(O): %.c
+-	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
+--- a/otherlibs/Makefile.otherlibs.common	2022-01-22 20:24:15.316779625 +0100
++++ b/otherlibs/Makefile.otherlibs.common	2022-01-22 20:24:50.730126701 +0100
+@@ -138,4 +138,4 @@
+ 	$(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $<
+ 
+ .c.$(O):
+-	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
+--- a/ocamltest/Makefile	2022-01-22 20:30:22.454009704 +0100
++++ b/ocamltest/Makefile	2022-01-22 20:30:33.845799603 +0100
+@@ -221,7 +221,7 @@
+ 	$(ocamllex) -q $<
+ 
+ %.$(O): %.c
+-	$(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -c $<
++	$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -c $<
+ 
+ ocamltest_config.ml: ocamltest_config.ml.in Makefile ../Makefile.config
+ 	sed \
+--- a/otherlibs/systhreads/Makefile	2022-01-22 20:42:17.647349876 +0100
++++ b/otherlibs/systhreads/Makefile	2022-01-22 20:43:29.766086103 +0100
+@@ -93,11 +93,11 @@
+ # twice, each time with different options).
+ 
+ st_stubs_b.$(O): st_stubs.c $(HEADER)
+-	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime  \
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime  \
+ 	  $(SHAREDLIB_CFLAGS) $(OUTPUTOBJ)$@ $<
+ 
+ st_stubs_n.$(O): st_stubs.c $(HEADER)
+-	$(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) \
++	$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) \
+ 	  -I$(ROOTDIR)/runtime $(SHAREDLIB_CFLAGS) -DNATIVE_CODE \
+ 	  -DTARGET_$(ARCH) -DMODEL_$(MODEL) -DSYS_$(SYSTEM) \
+ 	  $(OUTPUTOBJ)$@ -c $<

diff --git a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
index 68b58ca86b18..ca9871a0c358 100644
--- a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -21,7 +21,10 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
-PATCHES=( "${FILESDIR}"/${PN}-4.09.0-gcc-10.patch )
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.09.0-gcc-10.patch
+	"${FILESDIR}"/${P}-cflags.patch
+)
 
 src_prepare() {
 	default


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2022-02-22  0:41 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2022-02-22  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     08d38917b110ea52b3107556e283498a09a89a36
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 00:35:29 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 00:41:22 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08d38917

dev-lang/ocaml: fix 4.10 with glibc 2.34

Bug: https://bugs.gentoo.org/804498
See: https://github.com/gentoo/gentoo/pull/22851#pullrequestreview-882504245
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch | 257 +++++++++++++++++++++
 dev-lang/ocaml/ocaml-4.10.2-r3.ebuild              | 106 +++++++++
 2 files changed, 363 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch
new file mode 100644
index 000000000000..8ce76701366a
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch
@@ -0,0 +1,257 @@
+https://github.com/ocaml/ocaml/commit/4b4c643d1d5d28738f6d900cd902851ed9dc5364
+https://bugs.gentoo.org/804498
+
+From 4b4c643d1d5d28738f6d900cd902851ed9dc5364 Mon Sep 17 00:00:00 2001
+From: Xavier Leroy <xavierleroy@users.noreply.github.com>
+Date: Fri, 5 Mar 2021 19:14:07 +0100
+Subject: [PATCH] Dynamically allocate the alternate signal stack
+
+In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
+It is no longer possible to statically allocate the alternate signal
+stack for the main thread, as we've been doing for the last 25 years.
+
+This commit implements dynamic allocation of the alternate signal stack
+even for the main thread.  It reuses the code already in place to allocate
+the alternate signal stack for other threads.
+
+The alternate signal stack is freed when the main OCaml code / an OCaml thread
+stops.
+
+(partial back-port of PR#10266 and PR#10726)
+---
+ otherlibs/systhreads/st_stubs.c |  2 +
+ runtime/fail_nat.c              |  7 ++-
+ runtime/signals_nat.c           | 87 ++++++++++++++++++++++++++++-----
+ runtime/startup_nat.c           |  7 ++-
+ runtime/sys.c                   |  5 ++
+ 5 files changed, 95 insertions(+), 13 deletions(-)
+
+diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c
+index e46a67be9dc..0b441934ae9 100644
+--- a/otherlibs/systhreads/st_stubs.c
++++ b/otherlibs/systhreads/st_stubs.c
+@@ -140,6 +140,7 @@ static st_retcode caml_threadstatus_wait (value);
+ #ifdef NATIVE_CODE
+ extern struct longjmp_buffer caml_termination_jmpbuf;
+ extern void (*caml_termination_hook)(void);
++extern int caml_stop_stack_overflow_detection(void);
+ #endif
+ 
+ /* Hook for scanning the stacks of the other threads */
+@@ -576,6 +577,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
+     caml_thread_stop();
+ #ifdef NATIVE_CODE
+   }
++  caml_stop_stack_overflow_detection();
+ #endif
+   /* The thread now stops running */
+   return 0;
+diff --git a/runtime/fail_nat.c b/runtime/fail_nat.c
+index 380578ac47b..4ea658684b4 100644
+--- a/runtime/fail_nat.c
++++ b/runtime/fail_nat.c
+@@ -32,6 +32,8 @@
+ #include "caml/roots.h"
+ #include "caml/callback.h"
+ 
++extern void caml_terminate_signals(void);
++
+ /* The globals holding predefined exceptions */
+ 
+ typedef value caml_generated_constant[1];
+@@ -62,7 +64,10 @@ CAMLno_asan
+ void caml_raise(value v)
+ {
+   Unlock_exn();
+-  if (Caml_state->exception_pointer == NULL) caml_fatal_uncaught_exception(v);
++  if (Caml_state->exception_pointer == NULL) {
++    caml_terminate_signals();
++    caml_fatal_uncaught_exception(v);
++  }
+ 
+   while (Caml_state->local_roots != NULL &&
+          (char *) Caml_state->local_roots < Caml_state->exception_pointer) {
+diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c
+index 017298394e9..b4c58259fc2 100644
+--- a/runtime/signals_nat.c
++++ b/runtime/signals_nat.c
+@@ -191,8 +191,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #error "CONTEXT_SP is required if HAS_STACK_OVERFLOW_DETECTION is defined"
+ #endif
+ 
+-static char sig_alt_stack[SIGSTKSZ];
+-
+ /* Code compiled with ocamlopt never accesses more than
+    EXTRA_STACK bytes below the stack pointer. */
+ #define EXTRA_STACK 256
+@@ -254,6 +252,10 @@ DECLARE_SIGNAL_HANDLER(segv_handler)
+ 
+ /* Initialization of signal stuff */
+ 
++#ifdef HAS_STACK_OVERFLOW_DETECTION
++static int setup_stack_overflow_detection(void);
++#endif
++
+ void caml_init_signals(void)
+ {
+   /* Bound-check trap handling */
+@@ -278,28 +280,91 @@ void caml_init_signals(void)
+ #endif
+ 
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+-  {
+-    stack_t stk;
++  if (setup_stack_overflow_detection() != -1) {
+     struct sigaction act;
+-    stk.ss_sp = sig_alt_stack;
+-    stk.ss_size = SIGSTKSZ;
+-    stk.ss_flags = 0;
+     SET_SIGACT(act, segv_handler);
+     act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+     sigemptyset(&act.sa_mask);
+-    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
++    sigaction(SIGSEGV, &act, NULL);
+   }
+ #endif
+ }
+ 
+-void caml_setup_stack_overflow_detection(void)
++/* Termination of signal stuff */
++
++#if defined(TARGET_power) || defined(TARGET_s390x) \
++    || defined(HAS_STACK_OVERFLOW_DETECTION)
++static void set_signal_default(int signum)
++{
++  struct sigaction act;
++  sigemptyset(&act.sa_mask);
++  act.sa_handler = SIG_DFL;
++  act.sa_flags = 0;
++  sigaction(signum, &act, NULL);
++}
++#endif
++
++int caml_stop_stack_overflow_detection(void);
++
++void caml_terminate_signals(void)
+ {
++#if defined(TARGET_power)
++  set_signal_default(SIGTRAP);
++#endif
++
++#if defined(TARGET_s390x)
++  set_signal_default(SIGFPE);
++#endif
++
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
++  set_signal_default(SIGSEGV);
++  caml_stop_stack_overflow_detection();
++#endif
++}
++
++/* Allocate and select an alternate stack for handling signals,
++   especially SIGSEGV signals.
++   Each thread needs its own alternate stack.
++   The alternate stack used to be statically-allocated for the main thread,
++   but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
++   may not be a compile-time constant (issue #10250). */
++
++#ifdef HAS_STACK_OVERFLOW_DETECTION
++static int setup_stack_overflow_detection(void)
++{
+   stack_t stk;
+   stk.ss_sp = malloc(SIGSTKSZ);
++  if (stk.ss_sp == NULL) return -1;
+   stk.ss_size = SIGSTKSZ;
+   stk.ss_flags = 0;
+-  if (stk.ss_sp)
+-    sigaltstack(&stk, NULL);
++  if (sigaltstack(&stk, NULL) == -1) {
++    free(stk.ss_sp);
++    return -1;
++  }
++  /* Success (or stack overflow detection not available) */
++  return 0;
++}
++#endif
++
++CAMLexport void caml_setup_stack_overflow_detection(void)
++{
++#ifdef HAS_STACK_OVERFLOW_DETECTION
++  setup_stack_overflow_detection();
++#endif
++}
++
++CAMLexport int caml_stop_stack_overflow_detection(void)
++{
++#ifdef HAS_STACK_OVERFLOW_DETECTION
++  stack_t oldstk, stk;
++  stk.ss_flags = SS_DISABLE;
++  if (sigaltstack(&stk, &oldstk) == -1) return -1;
++  /* If caml_setup_stack_overflow_detection failed, we are not using
++     an alternate signal stack.  SS_DISABLE will be set in oldstk,
++     and there is nothing to free in this case. */
++  if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
++  return 0;
++#else
++  return 0;
+ #endif
+ }
+diff --git a/runtime/startup_nat.c b/runtime/startup_nat.c
+index 91ff81b3fac..b80d0ffbd5e 100644
+--- a/runtime/startup_nat.c
++++ b/runtime/startup_nat.c
+@@ -93,6 +93,7 @@ void (*caml_termination_hook)(void *) = NULL;
+ extern value caml_start_program (caml_domain_state*);
+ extern void caml_init_ieee_floats (void);
+ extern void caml_init_signals (void);
++extern void caml_terminate_signals(void);
+ #ifdef _WIN32
+ extern void caml_win32_overflow_detection (void);
+ #endif
+@@ -107,6 +108,7 @@ extern void caml_install_invalid_parameter_handler();
+ value caml_startup_common(char_os **argv, int pooling)
+ {
+   char_os * exe_name, * proc_self_exe;
++  value res;
+   char tos;
+ 
+   /* Initialize the domain */
+@@ -156,10 +158,13 @@ value caml_startup_common(char_os **argv, int pooling)
+     exe_name = caml_search_exe_in_path(exe_name);
+   caml_sys_init(exe_name, argv);
+   if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) {
++    caml_terminate_signals();
+     if (caml_termination_hook != NULL) caml_termination_hook(NULL);
+     return Val_unit;
+   }
+-  return caml_start_program(Caml_state);
++  res = caml_start_program(Caml_state);
++  caml_terminate_signals();
++  return res;
+ }
+ 
+ value caml_startup_exn(char_os **argv)
+diff --git a/runtime/sys.c b/runtime/sys.c
+index d5636199c9f..45f8c8e8100 100644
+--- a/runtime/sys.c
++++ b/runtime/sys.c
+@@ -112,6 +112,8 @@ static void caml_sys_check_path(value name)
+   }
+ }
+ 
++extern void caml_terminate_signals(void);
++
+ CAMLprim value caml_sys_exit(value retcode_v)
+ {
+   int retcode = Int_val(retcode_v);
+@@ -156,6 +158,9 @@ CAMLprim value caml_sys_exit(value retcode_v)
+     caml_shutdown();
+ #ifdef _WIN32
+   caml_restore_win32_terminal();
++#endif
++#ifdef NATIVE_CODE
++  caml_terminate_signals();
+ #endif
+   exit(retcode);
+ }
+

diff --git a/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild
new file mode 100644
index 000000000000..b298bea0d51b
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic
+
+HOMEPAGE="https://ocaml.org/"
+SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
+DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles"
+
+LICENSE="LGPL-2.1"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="emacs flambda latex +ocamlopt spacetime xemacs"
+
+RDEPEND="sys-libs/binutils-libs:=
+	spacetime? ( sys-libs/libunwind:= )"
+BDEPEND="${RDEPEND}
+	virtual/pkgconfig"
+PDEPEND="emacs? ( app-emacs/ocaml-mode )
+	xemacs? ( app-xemacs/ocaml )"
+
+QA_FLAGS_IGNORED='usr/lib.*/ocaml/bigarray.cmxs'
+
+PATCHES=(
+	"${FILESDIR}"/${P}-cflags.patch
+	"${FILESDIR}"/${P}-glibc-2.34.patch
+)
+
+src_prepare() {
+	default
+
+	cp "${FILESDIR}"/ocaml.conf "${T}" || die
+
+	# Broken until 4.12
+	# bug #818445
+	filter-flags '-flto*'
+	append-flags -fno-strict-aliasing
+
+	# OCaml generates textrels on 32-bit arches
+	# We can't do anything about it, but disabling it means that tests
+	# for OCaml-based packages won't fail on unexpected output
+	# bug #773226
+	if use arm || use ppc || use x86 ; then
+		append-ldflags "-Wl,-z,notext"
+	fi
+
+	# Upstream build ignores LDFLAGS in several places.
+	sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
+		-e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
+		-e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
+		Makefile.config.in || die "LDFLAGS fix failed"
+	# ${P} overrides upstream build's own P due to a wrong assignment operator.
+	sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed"
+}
+
+src_configure() {
+	local opt=(
+		--bindir="${EPREFIX}/usr/bin"
+		--libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
+		--mandir="${EPREFIX}/usr/share/man"
+		--prefix="${EPREFIX}/usr"
+		$(use_enable flambda)
+		$(use_enable spacetime)
+	)
+	econf ${opt[@]}
+}
+
+src_compile() {
+	if use ocamlopt ; then
+		emake world.opt
+	else
+		emake world
+	fi
+}
+
+src_test() {
+	if use ocamlopt ; then
+		# OCaml tests only work when run sequentially
+		emake -j1 -C testsuite all
+	else
+		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
+	fi
+}
+
+src_install() {
+	default
+	dodir /usr/include
+
+	# Create symlink for header files
+	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
+	dodoc Changes README.adoc
+
+	# Create envd entry for latex input files
+	if use latex ; then
+		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}/99ocamldoc" || die
+		doenvd "${T}"/99ocamldoc
+	fi
+
+	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
+
+	# Install ocaml-rebuild portage set
+	insinto /usr/share/portage/config/sets
+	doins "${T}"/ocaml.conf
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2022-02-22  0:56 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2022-02-22  0:56 UTC (permalink / raw
  To: gentoo-commits

commit:     bbbbbaf24b7ec12927d0ac7e2b853cccec4e28fe
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 00:55:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 00:55:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbbbbaf2

dev-lang/ocaml: use tarball for 4.05/4.09/4.10 patches

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/ocaml/Manifest                            |   3 +
 dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch | 186 ----------------
 dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch | 178 ---------------
 dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch | 239 ---------------------
 dev-lang/ocaml/ocaml-4.05.0-r9.ebuild              |   7 +-
 dev-lang/ocaml/ocaml-4.09.0-r3.ebuild              |  12 +-
 dev-lang/ocaml/ocaml-4.10.2-r3.ebuild              |  11 +-
 7 files changed, 18 insertions(+), 618 deletions(-)

diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest
index eda27fba03db..9466e909f6b9 100644
--- a/dev-lang/ocaml/Manifest
+++ b/dev-lang/ocaml/Manifest
@@ -1,5 +1,8 @@
+DIST ocaml-4.05.0-patches-1.tar.bz2 4009 BLAKE2B 052c3a6859a942f2993d0b06ab57ca8f7469650c096f20bff7ff7cf5c2842e8d5019d595a4eca0dc1a4e5feda2db8a831a6917b3b6d9f39166c8ae7af1e894e7 SHA512 b349e6613201d9400f736c5b2d0ede01e7e113524cbc6989999a71fb97cb1eb67f90af8c2fbd3fd8abeccf3193e317cdd8258aee328c3e078634385c21558619
 DIST ocaml-4.05.0.tar.gz 4431750 BLAKE2B c2ab003a13e0a581ebd0e1c96eeb8a9baea9bfe6bee08823b0e4541819201ec109f1846e13fc1aefa51a001eefbb8f73320ba854d41975fc68cef41bc75b1ecc SHA512 9a060ae4b741e1687277403e5bdb8f6eda2e2ebf6c45f7c0149b66ea1213cb26d13febfbb3f11c12543e244cfdd053b786b09c4145e2348e5d89a7206f7de225
+DIST ocaml-4.09.0-patches-1.tar.bz2 3300 BLAKE2B ef710ea5ed5a243ae684f68b7f203ba454192c9f8f19c32697d336bf18cf2a0e8ea08df232b0fd8e2475a000758a5ba95b3794096ec7d0d1b292a715ab3de86f SHA512 94096b99fd58b32232e418c5736203f08ab3c1558154ed00d4290730bd4db849bc60dfae6160f344acce63bbb8eaceecee25cf836bb73fa419d7bbf4eac433f1
 DIST ocaml-4.09.0.tar.gz 4838748 BLAKE2B 80f29d535c64bf2371b480217723ed20b2b21cfd93ce31366a7b91e7ddffdf68db4e88d085288b7e21efee567a13f42ecff24c3a0115507b006acf844239cefd SHA512 dc0271e591bf929b751705835790949a9d741e12d085c8b207c3689b5838a02ea8de80da8b2605d2e6744f2f541b0d1694ffafff9509e99ce01f3a391f6ef2ae
+DIST ocaml-4.10.2-patches-1.tar.bz2 3180 BLAKE2B 474471e10c4525e4da730fcf8602fddf5209f7d8eb15bd76894ed2bc22213a6e61aa7f52b1b67dff6c8bf04eac7d759ada28f1783c83a075cc65e7e5caadc715 SHA512 1456f90c0c833461eb9d1c140ba1a7358aa9351f6303e83b0e19bb8688dcb17bdad211f4cec1281a47180bbdddcfdbf44367b47a6b301d2ea41fa9d926bd03a5
 DIST ocaml-4.10.2.tar.gz 4933135 BLAKE2B ec5e92adb23c28a254247182c79ab555fd82603e02f24799049b8057abf869d18234302408c8ae89b9997a2b210ed6965e45c2c03e4f0cab34262ad3f6ebb528 SHA512 1dd827da07f01e815fd74dd7ee84db0900f24782f8f7fd426e2d71b9fb03c7b8045f22e018120a0446c362315751365d1bd8c1724edef2b182394e76eb0a07b2
 DIST ocaml-4.11.2.tar.gz 5075323 BLAKE2B bdc503d9a8d0e39dd11060febcd0287657b460e50ed81e55578a3e778af990ca5d4ef9011753eee4e1a144da33eb76c95b1672dc99b76e65a2e107eee472fe06 SHA512 03d8a9f6e130142c121ff2eb3d54f584f1e7c8475f066a5803bb0edd2fa172ca06a56a3ec548b225f5c8b12112d7a68511b1e16f3ade075b5f02610d4247bbb3
 DIST ocaml-4.12.1.tar.gz 5181696 BLAKE2B 9d21438e09b1a9680eabb65f5c78d9fe84459592ef7bb797a1933e5383f7b6d5cefffa8cdc184abc102417f5dbc0fca8ef624c9b560f89eaff6537544b5b395f SHA512 e942e5cf5530804690ec45c40936ad2acbb60e11279fc676e0f04181fe1855f84ee5c3cb9c337fc5d01f6ee0e7b2251a6c04f7de56d99c20bb62026dff6c5671

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch
deleted file mode 100644
index d95d2bb0fa50..000000000000
--- a/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch
+++ /dev/null
@@ -1,186 +0,0 @@
-https://github.com/ocaml/ocaml/commit/50c2d1275e537906ea144bd557fde31e0bf16e5f
-https://bugs.gentoo.org/804498
-
-From 50c2d1275e537906ea144bd557fde31e0bf16e5f Mon Sep 17 00:00:00 2001
-From: Xavier Leroy <xavierleroy@users.noreply.github.com>
-Date: Fri, 5 Mar 2021 19:14:07 +0100
-Subject: [PATCH] Dynamically allocate the alternate signal stack
-
-In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
-It is no longer possible to statically allocate the alternate signal
-stack for the main thread, as we've been doing for the last 25 years.
-
-This commit implements dynamic allocation of the alternate signal stack
-even for the main thread.  It reuses the code already in place to allocate
-the alternate signal stack for other threads.
-
-The alternate signal stack is freed when the main OCaml code / an OCaml thread
-stops.
-
-(partial back-port of PR#10266 and PR#10726)
---- a/asmrun/fail.c
-+++ b/asmrun/fail.c
-@@ -31,6 +31,8 @@
- #include "caml/roots.h"
- #include "caml/callback.h"
- 
-+extern void caml_terminate_signals(void);
-+
- /* The globals holding predefined exceptions */
- 
- typedef value caml_generated_constant[1];
-@@ -60,7 +62,10 @@ char * caml_exception_pointer = NULL;
- void caml_raise(value v)
- {
-   Unlock_exn();
--  if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v);
-+  if (caml_exception_pointer == NULL) {
-+    caml_terminate_signals();
-+    caml_fatal_uncaught_exception(v);
-+  }
- 
- #ifndef Stack_grows_upwards
- #define PUSHED_AFTER <
---- a/asmrun/signals_asm.c
-+++ b/asmrun/signals_asm.c
-@@ -194,7 +194,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
- #ifdef HAS_STACK_OVERFLOW_DETECTION
- 
- static char * system_stack_top;
--static char sig_alt_stack[SIGSTKSZ];
- 
- #if defined(SYS_linux)
- /* PR#4746: recent Linux kernels with support for stack randomization
-@@ -295,17 +294,69 @@ void caml_init_signals(void)
-   {
-     stack_t stk;
-     struct sigaction act;
--    stk.ss_sp = sig_alt_stack;
--    stk.ss_size = SIGSTKSZ;
--    stk.ss_flags = 0;
--    SET_SIGACT(act, segv_handler);
--    act.sa_flags |= SA_ONSTACK | SA_NODEFER;
--    sigemptyset(&act.sa_mask);
--    system_stack_top = (char *) &act;
--    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
-+    /* Allocate and select an alternate stack for handling signals,
-+       especially SIGSEGV signals.
-+       The alternate stack used to be statically-allocated for the main thread,
-+       but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
-+       may not be a compile-time constant. */
-+    stk.ss_sp = malloc(SIGSTKSZ);
-+    if (stk.ss_sp != NULL) {
-+      stk.ss_size = SIGSTKSZ;
-+      stk.ss_flags = 0;
-+      SET_SIGACT(act, segv_handler);
-+      act.sa_flags |= SA_ONSTACK | SA_NODEFER;
-+      sigemptyset(&act.sa_mask);
-+      system_stack_top = (char *) &act;
-+      if (sigaltstack(&stk, NULL) == 0)
-+        sigaction(SIGSEGV, &act, NULL);
-+      else
-+        free(stk.ss_sp);
-+    }
-   }
- #endif
- #if defined(_WIN32) && !defined(_WIN64)
-   caml_win32_overflow_detection();
- #endif
- }
-+
-+/* Termination of signal stuff */
-+
-+#if defined(TARGET_power) || defined(TARGET_s390x) \
-+    || defined(TARGET_sparc) && defined(SYS_solaris) \
-+    || defined(HAS_STACK_OVERFLOW_DETECTION)
-+static void set_signal_default(int signum)
-+{
-+  struct sigaction act;
-+  sigemptyset(&act.sa_mask);
-+  act.sa_handler = SIG_DFL;
-+  act.sa_flags = 0;
-+  sigaction(signum, &act, NULL);
-+}
-+#endif
-+
-+void caml_terminate_signals(void)
-+{
-+#if defined(TARGET_sparc) && defined(SYS_solaris)
-+  set_signal_default(SIGILL);
-+#endif
-+
-+#if defined(TARGET_power)
-+  set_signal_default(SIGTRAP);
-+#endif
-+
-+#if defined(TARGET_s390x)
-+  set_signal_default(SIGFPE);
-+#endif
-+
-+#ifdef HAS_STACK_OVERFLOW_DETECTION
-+  set_signal_default(SIGSEGV);
-+  stack_t oldstk, stk;
-+  stk.ss_flags = SS_DISABLE;
-+  if (sigaltstack(&stk, &oldstk) == 0) {
-+    /* If caml_init_signals failed, we are not using an alternate signal stack.
-+       SS_DISABLE will be set in oldstk, and there is nothing to free in this
-+       case. */
-+    if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
-+  }
-+#endif
-+}
---- a/asmrun/startup.c
-+++ b/asmrun/startup.c
-@@ -92,6 +92,7 @@ void (*caml_termination_hook)(void *) = NULL;
- extern value caml_start_program (void);
- extern void caml_init_ieee_floats (void);
- extern void caml_init_signals (void);
-+extern void caml_terminate_signals(void);
- 
- #if defined(_MSC_VER) && __STDC_SECURE_LIB__ >= 200411L
- 
-@@ -103,6 +104,7 @@ extern void caml_install_invalid_parameter_handler();
- value caml_startup_exn(char **argv)
- {
-   char * exe_name, * proc_self_exe;
-+  value res;
-   char tos;
- 
- #ifdef WITH_SPACETIME
-@@ -138,10 +140,13 @@ value caml_startup_exn(char **argv)
-     exe_name = caml_search_exe_in_path(exe_name);
-   caml_sys_init(exe_name, argv);
-   if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) {
-+    caml_terminate_signals();
-     if (caml_termination_hook != NULL) caml_termination_hook(NULL);
-     return Val_unit;
-   }
--  return caml_start_program();
-+  res = caml_start_program();
-+  caml_terminate_signals();
-+  return res;
- }
- 
- void caml_startup(char **argv)
---- a/byterun/sys.c
-+++ b/byterun/sys.c
-@@ -111,6 +111,8 @@ static void caml_sys_check_path(value name)
-   }
- }
- 
-+extern void caml_terminate_signals(void);
-+
- CAMLprim value caml_sys_exit(value retcode_v)
- {
-   int retcode = Int_val(retcode_v);
-@@ -144,6 +146,9 @@ CAMLprim value caml_sys_exit(value retcode_v)
-   caml_debugger(PROGRAM_EXIT);
- #endif
-   CAML_INSTR_ATEXIT ();
-+#ifdef NATIVE_CODE
-+  caml_terminate_signals();
-+#endif
-   CAML_SYS_EXIT(retcode);
-   return Val_unit;
- }
-

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch
deleted file mode 100644
index 48127343a3f4..000000000000
--- a/dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch
+++ /dev/null
@@ -1,178 +0,0 @@
-https://github.com/ocaml/ocaml/commit/8eed2e441222588dc385a98ae8bd6f5820eb0223
-https://github.com/gentoo/gentoo/pull/22851#pullrequestreview-882504245
-
-From 8eed2e441222588dc385a98ae8bd6f5820eb0223 Mon Sep 17 00:00:00 2001
-From: Xavier Leroy <xavierleroy@users.noreply.github.com>
-Date: Fri, 5 Mar 2021 19:14:07 +0100
-Subject: [PATCH] Dynamically allocate the alternate signal stack
-
-In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
-It is no longer possible to statically allocate the alternate signal
-stack for the main thread, as we've been doing for the last 25 years.
-
-This commit implements dynamic allocation of the alternate signal stack
-even for the main thread.  It reuses the code already in place to allocate
-the alternate signal stack for other threads.
-
-The alternate signal stack is freed when the main OCaml code / an OCaml thread
-stops.
-
-(partial back-port of PR#10266 and PR#10726)
---- a/runtime/fail_nat.c
-+++ b/runtime/fail_nat.c
-@@ -31,6 +31,8 @@
- #include "caml/roots.h"
- #include "caml/callback.h"
- 
-+extern void caml_terminate_signals(void);
-+
- /* The globals holding predefined exceptions */
- 
- typedef value caml_generated_constant[1];
-@@ -60,7 +62,10 @@ char * caml_exception_pointer = NULL;
- void caml_raise(value v)
- {
-   Unlock_exn();
--  if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v);
-+  if (caml_exception_pointer == NULL) {
-+    caml_terminate_signals();
-+    caml_fatal_uncaught_exception(v);
-+  }
- 
-   while (caml_local_roots != NULL &&
-          (char *) caml_local_roots < caml_exception_pointer) {
---- a/runtime/signals_nat.c
-+++ b/runtime/signals_nat.c
-@@ -182,7 +182,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
- #ifdef HAS_STACK_OVERFLOW_DETECTION
- 
- static char * system_stack_top;
--static char sig_alt_stack[SIGSTKSZ];
- 
- #if defined(SYS_linux)
- /* PR#4746: recent Linux kernels with support for stack randomization
-@@ -275,14 +274,61 @@ void caml_init_signals(void)
-   {
-     stack_t stk;
-     struct sigaction act;
--    stk.ss_sp = sig_alt_stack;
--    stk.ss_size = SIGSTKSZ;
--    stk.ss_flags = 0;
--    SET_SIGACT(act, segv_handler);
--    act.sa_flags |= SA_ONSTACK | SA_NODEFER;
--    sigemptyset(&act.sa_mask);
--    system_stack_top = (char *) &act;
--    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
-+    /* Allocate and select an alternate stack for handling signals,
-+       especially SIGSEGV signals.
-+       The alternate stack used to be statically-allocated for the main thread,
-+       but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
-+       may not be a compile-time constant. */
-+    stk.ss_sp = malloc(SIGSTKSZ);
-+    if (stk.ss_sp != NULL) {
-+      stk.ss_size = SIGSTKSZ;
-+      stk.ss_flags = 0;
-+      SET_SIGACT(act, segv_handler);
-+      act.sa_flags |= SA_ONSTACK | SA_NODEFER;
-+      sigemptyset(&act.sa_mask);
-+      system_stack_top = (char *) &act;
-+      if (sigaltstack(&stk, NULL) == 0)
-+        sigaction(SIGSEGV, &act, NULL);
-+      else
-+        free(stk.ss_sp);
-+    }
-+  }
-+#endif
-+}
-+
-+/* Termination of signal stuff */
-+
-+#if defined(TARGET_power) || defined(TARGET_s390x) \
-+    || defined(HAS_STACK_OVERFLOW_DETECTION)
-+static void set_signal_default(int signum)
-+{
-+  struct sigaction act;
-+  sigemptyset(&act.sa_mask);
-+  act.sa_handler = SIG_DFL;
-+  act.sa_flags = 0;
-+  sigaction(signum, &act, NULL);
-+}
-+#endif
-+
-+void caml_terminate_signals(void)
-+{
-+#if defined(TARGET_power)
-+  set_signal_default(SIGTRAP);
-+#endif
-+
-+#if defined(TARGET_s390x)
-+  set_signal_default(SIGFPE);
-+#endif
-+
-+#ifdef HAS_STACK_OVERFLOW_DETECTION
-+  set_signal_default(SIGSEGV);
-+  stack_t oldstk, stk;
-+  stk.ss_flags = SS_DISABLE;
-+  if (sigaltstack(&stk, &oldstk) == 0) {
-+    /* If caml_init_signals failed, we are not using an alternate signal stack.
-+       SS_DISABLE will be set in oldstk, and there is nothing to free in this
-+       case. */
-+    if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
-   }
- #endif
- }
---- a/runtime/startup_nat.c
-+++ b/runtime/startup_nat.c
-@@ -92,6 +92,7 @@ void (*caml_termination_hook)(void *) = NULL;
- extern value caml_start_program (void);
- extern void caml_init_ieee_floats (void);
- extern void caml_init_signals (void);
-+extern void caml_terminate_signals(void);
- #ifdef _WIN32
- extern void caml_win32_overflow_detection (void);
- #endif
-@@ -106,6 +107,7 @@ extern void caml_install_invalid_parameter_handler();
- value caml_startup_common(char_os **argv, int pooling)
- {
-   char_os * exe_name, * proc_self_exe;
-+  value res;
-   char tos;
- 
-   /* Determine options */
-@@ -153,10 +155,13 @@ value caml_startup_common(char_os **argv, int pooling)
-     exe_name = caml_search_exe_in_path(exe_name);
-   caml_sys_init(exe_name, argv);
-   if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) {
-+    caml_terminate_signals();
-     if (caml_termination_hook != NULL) caml_termination_hook(NULL);
-     return Val_unit;
-   }
--  return caml_start_program();
-+  res = caml_start_program();
-+  caml_terminate_signals();
-+  return res;
- }
- 
- value caml_startup_exn(char_os **argv)
---- a/runtime/sys.c
-+++ b/runtime/sys.c
-@@ -112,6 +112,8 @@ static void caml_sys_check_path(value name)
-   }
- }
- 
-+extern void caml_terminate_signals(void);
-+
- CAMLprim value caml_sys_exit(value retcode_v)
- {
-   int retcode = Int_val(retcode_v);
-@@ -155,6 +157,9 @@ CAMLprim value caml_sys_exit(value retcode_v)
-     caml_shutdown();
- #ifdef _WIN32
-   caml_restore_win32_terminal();
-+#endif
-+#ifdef NATIVE_CODE
-+  caml_terminate_signals();
- #endif
-   exit(retcode);
- }
-

diff --git a/dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch
deleted file mode 100644
index 4c157ddd90b8..000000000000
--- a/dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch
+++ /dev/null
@@ -1,239 +0,0 @@
-https://github.com/ocaml/ocaml/commit/4b4c643d1d5d28738f6d900cd902851ed9dc5364
-https://bugs.gentoo.org/804498
-
-From 4b4c643d1d5d28738f6d900cd902851ed9dc5364 Mon Sep 17 00:00:00 2001
-From: Xavier Leroy <xavierleroy@users.noreply.github.com>
-Date: Fri, 5 Mar 2021 19:14:07 +0100
-Subject: [PATCH] Dynamically allocate the alternate signal stack
-
-In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
-It is no longer possible to statically allocate the alternate signal
-stack for the main thread, as we've been doing for the last 25 years.
-
-This commit implements dynamic allocation of the alternate signal stack
-even for the main thread.  It reuses the code already in place to allocate
-the alternate signal stack for other threads.
-
-The alternate signal stack is freed when the main OCaml code / an OCaml thread
-stops.
-
-(partial back-port of PR#10266 and PR#10726)
---- a/otherlibs/systhreads/st_stubs.c
-+++ b/otherlibs/systhreads/st_stubs.c
-@@ -140,6 +140,7 @@ static st_retcode caml_threadstatus_wait (value);
- #ifdef NATIVE_CODE
- extern struct longjmp_buffer caml_termination_jmpbuf;
- extern void (*caml_termination_hook)(void);
-+extern int caml_stop_stack_overflow_detection(void);
- #endif
- 
- /* Hook for scanning the stacks of the other threads */
-@@ -576,6 +577,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
-     caml_thread_stop();
- #ifdef NATIVE_CODE
-   }
-+  caml_stop_stack_overflow_detection();
- #endif
-   /* The thread now stops running */
-   return 0;
---- a/runtime/fail_nat.c
-+++ b/runtime/fail_nat.c
-@@ -32,6 +32,8 @@
- #include "caml/roots.h"
- #include "caml/callback.h"
- 
-+extern void caml_terminate_signals(void);
-+
- /* The globals holding predefined exceptions */
- 
- typedef value caml_generated_constant[1];
-@@ -62,7 +64,10 @@ CAMLno_asan
- void caml_raise(value v)
- {
-   Unlock_exn();
--  if (Caml_state->exception_pointer == NULL) caml_fatal_uncaught_exception(v);
-+  if (Caml_state->exception_pointer == NULL) {
-+    caml_terminate_signals();
-+    caml_fatal_uncaught_exception(v);
-+  }
- 
-   while (Caml_state->local_roots != NULL &&
-          (char *) Caml_state->local_roots < Caml_state->exception_pointer) {
---- a/runtime/signals_nat.c
-+++ b/runtime/signals_nat.c
-@@ -191,8 +191,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
- #error "CONTEXT_SP is required if HAS_STACK_OVERFLOW_DETECTION is defined"
- #endif
- 
--static char sig_alt_stack[SIGSTKSZ];
--
- /* Code compiled with ocamlopt never accesses more than
-    EXTRA_STACK bytes below the stack pointer. */
- #define EXTRA_STACK 256
-@@ -254,6 +252,10 @@ DECLARE_SIGNAL_HANDLER(segv_handler)
- 
- /* Initialization of signal stuff */
- 
-+#ifdef HAS_STACK_OVERFLOW_DETECTION
-+static int setup_stack_overflow_detection(void);
-+#endif
-+
- void caml_init_signals(void)
- {
-   /* Bound-check trap handling */
-@@ -278,28 +280,91 @@ void caml_init_signals(void)
- #endif
- 
- #ifdef HAS_STACK_OVERFLOW_DETECTION
--  {
--    stack_t stk;
-+  if (setup_stack_overflow_detection() != -1) {
-     struct sigaction act;
--    stk.ss_sp = sig_alt_stack;
--    stk.ss_size = SIGSTKSZ;
--    stk.ss_flags = 0;
-     SET_SIGACT(act, segv_handler);
-     act.sa_flags |= SA_ONSTACK | SA_NODEFER;
-     sigemptyset(&act.sa_mask);
--    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
-+    sigaction(SIGSEGV, &act, NULL);
-   }
- #endif
- }
- 
--void caml_setup_stack_overflow_detection(void)
-+/* Termination of signal stuff */
-+
-+#if defined(TARGET_power) || defined(TARGET_s390x) \
-+    || defined(HAS_STACK_OVERFLOW_DETECTION)
-+static void set_signal_default(int signum)
-+{
-+  struct sigaction act;
-+  sigemptyset(&act.sa_mask);
-+  act.sa_handler = SIG_DFL;
-+  act.sa_flags = 0;
-+  sigaction(signum, &act, NULL);
-+}
-+#endif
-+
-+int caml_stop_stack_overflow_detection(void);
-+
-+void caml_terminate_signals(void)
- {
-+#if defined(TARGET_power)
-+  set_signal_default(SIGTRAP);
-+#endif
-+
-+#if defined(TARGET_s390x)
-+  set_signal_default(SIGFPE);
-+#endif
-+
- #ifdef HAS_STACK_OVERFLOW_DETECTION
-+  set_signal_default(SIGSEGV);
-+  caml_stop_stack_overflow_detection();
-+#endif
-+}
-+
-+/* Allocate and select an alternate stack for handling signals,
-+   especially SIGSEGV signals.
-+   Each thread needs its own alternate stack.
-+   The alternate stack used to be statically-allocated for the main thread,
-+   but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
-+   may not be a compile-time constant (issue #10250). */
-+
-+#ifdef HAS_STACK_OVERFLOW_DETECTION
-+static int setup_stack_overflow_detection(void)
-+{
-   stack_t stk;
-   stk.ss_sp = malloc(SIGSTKSZ);
-+  if (stk.ss_sp == NULL) return -1;
-   stk.ss_size = SIGSTKSZ;
-   stk.ss_flags = 0;
--  if (stk.ss_sp)
--    sigaltstack(&stk, NULL);
-+  if (sigaltstack(&stk, NULL) == -1) {
-+    free(stk.ss_sp);
-+    return -1;
-+  }
-+  /* Success (or stack overflow detection not available) */
-+  return 0;
-+}
-+#endif
-+
-+CAMLexport void caml_setup_stack_overflow_detection(void)
-+{
-+#ifdef HAS_STACK_OVERFLOW_DETECTION
-+  setup_stack_overflow_detection();
-+#endif
-+}
-+
-+CAMLexport int caml_stop_stack_overflow_detection(void)
-+{
-+#ifdef HAS_STACK_OVERFLOW_DETECTION
-+  stack_t oldstk, stk;
-+  stk.ss_flags = SS_DISABLE;
-+  if (sigaltstack(&stk, &oldstk) == -1) return -1;
-+  /* If caml_setup_stack_overflow_detection failed, we are not using
-+     an alternate signal stack.  SS_DISABLE will be set in oldstk,
-+     and there is nothing to free in this case. */
-+  if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
-+  return 0;
-+#else
-+  return 0;
- #endif
- }
---- a/runtime/startup_nat.c
-+++ b/runtime/startup_nat.c
-@@ -93,6 +93,7 @@ void (*caml_termination_hook)(void *) = NULL;
- extern value caml_start_program (caml_domain_state*);
- extern void caml_init_ieee_floats (void);
- extern void caml_init_signals (void);
-+extern void caml_terminate_signals(void);
- #ifdef _WIN32
- extern void caml_win32_overflow_detection (void);
- #endif
-@@ -107,6 +108,7 @@ extern void caml_install_invalid_parameter_handler();
- value caml_startup_common(char_os **argv, int pooling)
- {
-   char_os * exe_name, * proc_self_exe;
-+  value res;
-   char tos;
- 
-   /* Initialize the domain */
-@@ -156,10 +158,13 @@ value caml_startup_common(char_os **argv, int pooling)
-     exe_name = caml_search_exe_in_path(exe_name);
-   caml_sys_init(exe_name, argv);
-   if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) {
-+    caml_terminate_signals();
-     if (caml_termination_hook != NULL) caml_termination_hook(NULL);
-     return Val_unit;
-   }
--  return caml_start_program(Caml_state);
-+  res = caml_start_program(Caml_state);
-+  caml_terminate_signals();
-+  return res;
- }
- 
- value caml_startup_exn(char_os **argv)
---- a/runtime/sys.c
-+++ b/runtime/sys.c
-@@ -112,6 +112,8 @@ static void caml_sys_check_path(value name)
-   }
- }
- 
-+extern void caml_terminate_signals(void);
-+
- CAMLprim value caml_sys_exit(value retcode_v)
- {
-   int retcode = Int_val(retcode_v);
-@@ -156,6 +158,9 @@ CAMLprim value caml_sys_exit(value retcode_v)
-     caml_shutdown();
- #ifdef _WIN32
-   caml_restore_win32_terminal();
-+#endif
-+#ifdef NATIVE_CODE
-+  caml_terminate_signals();
- #endif
-   exit(retcode);
- }
-

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild
index f2bb2369ad69..836f967b59ce 100644
--- a/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild
+++ b/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild
@@ -10,7 +10,8 @@ MY_P="${P/_/-}"
 DESCRIPTION="Type-inferring functional programming language descended from the ML family"
 HOMEPAGE="https://ocaml.org"
 SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> ${MY_P}.tar.gz
-	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
+	mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2
+	https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches-1.tar.bz2"
 
 LICENSE="QPL-1.0 LGPL-2"
 # Everytime ocaml is updated to a new version, everything ocaml must be rebuilt,
@@ -36,9 +37,7 @@ S="${WORKDIR}/${MY_P}"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.04.2-tinfo.patch #459512
-	"${FILESDIR}"/${P}-gcc10.patch
-	"${FILESDIR}"/${P}-CVE-2018-9838.patch
-	"${FILESDIR}"/${P}-glibc-2.34.patch
+	"${WORKDIR}"/${P}-patches-1/
 )
 
 pkg_setup() {

diff --git a/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild b/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild
index 8bf41d439d5a..7d1b5b6f6592 100644
--- a/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild
+++ b/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild
@@ -5,9 +5,10 @@ EAPI=7
 
 inherit flag-o-matic
 
-HOMEPAGE="https://ocaml.org/"
-SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
 DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles"
+HOMEPAGE="https://ocaml.org/"
+SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz
+	https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches-1.tar.bz2"
 
 LICENSE="LGPL-2.1"
 SLOT="0/$(ver_cut 1-2)"
@@ -24,9 +25,7 @@ PDEPEND="emacs? ( app-emacs/ocaml-mode )
 QA_FLAGS_IGNORED='usr/lib.*/ocaml/bigarray.cmxs'
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-4.09.0-gcc-10.patch
-	"${FILESDIR}"/${P}-cflags.patch
-	"${FILESDIR}"/${P}-glibc-2.34.patch
+	"${WORKDIR}"/${P}-patches-1/
 )
 
 src_prepare() {
@@ -65,7 +64,8 @@ src_configure() {
 		$(use_enable flambda)
 		$(use_enable spacetime)
 	)
-	econf ${opt[@]}
+
+	econf "${opt[@]}"
 }
 
 src_compile() {

diff --git a/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild
index b298bea0d51b..b0b37115a35c 100644
--- a/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild
+++ b/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild
@@ -5,9 +5,10 @@ EAPI=7
 
 inherit flag-o-matic
 
-HOMEPAGE="https://ocaml.org/"
-SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
 DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles"
+HOMEPAGE="https://ocaml.org/"
+SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz
+	https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches-1.tar.bz2"
 
 LICENSE="LGPL-2.1"
 SLOT="0/$(ver_cut 1-2)"
@@ -24,8 +25,7 @@ PDEPEND="emacs? ( app-emacs/ocaml-mode )
 QA_FLAGS_IGNORED='usr/lib.*/ocaml/bigarray.cmxs'
 
 PATCHES=(
-	"${FILESDIR}"/${P}-cflags.patch
-	"${FILESDIR}"/${P}-glibc-2.34.patch
+	"${WORKDIR}"/${P}-patches-1/
 )
 
 src_prepare() {
@@ -64,7 +64,8 @@ src_configure() {
 		$(use_enable flambda)
 		$(use_enable spacetime)
 	)
-	econf ${opt[@]}
+
+	econf "${opt[@]}"
 }
 
 src_compile() {


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2022-02-25 19:58 Alfredo Tupone
  0 siblings, 0 replies; 11+ messages in thread
From: Alfredo Tupone @ 2022-02-25 19:58 UTC (permalink / raw
  To: gentoo-commits

commit:     85fb0c39c57aae6d7795b6ee1259d53ecfebd882
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 25 19:58:12 2022 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Fri Feb 25 19:58:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85fb0c39

dev-lang/ocaml: fix TEXTREL on 4.12.1

Closes: https://bugs.gentoo.org/825282
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 .../files/ocaml-4.12.1-fix-textrel-riscv.patch     | 46 ++++++++++++++++++++++
 dev-lang/ocaml/ocaml-4.12.1.ebuild                 |  1 +
 2 files changed, 47 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch b/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch
new file mode 100644
index 000000000000..5ba8582d3a65
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch
@@ -0,0 +1,46 @@
+From ddf99786f8229c8282905af5c7c74360d4f2fbd0 Mon Sep 17 00:00:00 2001
+From: Alex Fan <alex.fan.q@gmail.com>
+Date: Tue, 22 Feb 2022 19:28:30 +1100
+Subject: [PATCH] riscv: Generate frametable in data section to improve code
+ relocatability (#11042)
+
+Similar to what PowerPC and System-Z have done in commit 24980d3fd9848e281761ef2b8fe383e71261789b
+
+With this commit ocamlopt produces .so shared libraries and PIE relocatable
+executables that contain no relocations in the text segment.
+
+Upstream status: merged in 4.14 and 5.x
+---
+ Changes                | 5 +++++
+ asmcomp/riscv/emit.mlp | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/Changes b/Changes
+index 4898e9d69fc..2bec76daac6 100644
+--- a/Changes
++++ b/Changes
+@@ -477,6 +477,11 @@ OCaml 4.14.0
+ - #10907, #10959: Wrong type inferred from existential types
+   (Jacques Garrigue and Gabriel Scherer, report by @dyzsr, review by Leo White)
+ 
++- #10688: Move frame descriptor table from `rodata` to `data` section on
++  RISC-V.  Improves support for building DLLs and PIEs. In particular, this
++  applies to all binaries in distributions that build PIEs by default (eg
++  Gentoo and Alpine).
++  (Alex Fan, review by Gabriel Scherer)
+ 
+ OCaml 4.13 maintenance branch
+ -----------------------------
+diff --git a/asmcomp/riscv/emit.mlp b/asmcomp/riscv/emit.mlp
+index 474a3c6857a..b36aa0ea38c 100644
+--- a/asmcomp/riscv/emit.mlp
++++ b/asmcomp/riscv/emit.mlp
+@@ -645,7 +645,7 @@ let end_assembly() =
+   `{emit_symbol lbl_end}:\n`;
+   `	.quad	0\n`;
+   (* Emit the frame descriptors *)
+-  `	{emit_string rodata_space}\n`;
++  `	{emit_string data_space}\n`; (* not rodata because relocations inside *)
+   let lbl = Compilenv.make_symbol (Some "frametable") in
+   declare_global_data lbl;
+   `{emit_symbol lbl}:\n`;

diff --git a/dev-lang/ocaml/ocaml-4.12.1.ebuild b/dev-lang/ocaml/ocaml-4.12.1.ebuild
index fd6cae2fff2c..70049fcc0ae4 100644
--- a/dev-lang/ocaml/ocaml-4.12.1.ebuild
+++ b/dev-lang/ocaml/ocaml-4.12.1.ebuild
@@ -24,6 +24,7 @@ QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.12.0-glibc-2.34.patch
+	"${FILESDIR}"/${P}-fix-textrel-riscv.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2022-02-27  6:27 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2022-02-27  6:27 UTC (permalink / raw
  To: gentoo-commits

commit:     687393e4bd5f9a0f9bf4a2f766ea1246f7b324f7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 27 06:25:12 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 27 06:26:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=687393e4

dev-lang/ocaml: fix 4.11.2 src_prepare (missing patch)

Accidentally cleaned up in 9e8369277b272b15f3dd1159fa18b71ec4431a77 (got
confused by what I had/hadn't moved into patch tarballs, renamed accordingly
now to avoid that in future).

Once OCaml 4.09.0-r3 stabilisation is complete, we can cleanup all
the obsolete patches from files/ and then everything is a bit clearer.

Bug: https://bugs.gentoo.org/804498
Fixes: 9e8369277b272b15f3dd1159fa18b71ec4431a77
See: https://forums.gentoo.org/viewtopic-t-1147490.html
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch | 42 ++++++++++++++++++++++++++
 dev-lang/ocaml/ocaml-4.11.2-r2.ebuild          |  2 +-
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch b/dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch
new file mode 100644
index 000000000000..7adb1ea0768d
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch
@@ -0,0 +1,42 @@
+--- a/runtime/Makefile
++++ b/runtime/Makefile
+@@ -335,7 +335,7 @@
+ # (without the extension, which is added by the macro)
+ define COMPILE_C_FILE
+ $(1).$(O): %.c
+-	$$(CC) -c $$(OC_CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
++	$$(CC) -c $$(OC_CFLAGS) $(CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
+ endef
+ 
+ object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic
+--- a/otherlibs/Makefile.otherlibs.common
++++ b/otherlibs/Makefile.otherlibs.common
+@@ -138,4 +138,4 @@
+ 	$(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $<
+ 
+ .c.$(O):
+-	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
+--- a/otherlibs/systhreads/Makefile
++++ b/otherlibs/systhreads/Makefile
+@@ -102,10 +102,10 @@
+ st_stubs_n.$(O): OC_CPPFLAGS += $(NATIVE_CPPFLAGS)
+ 
+ st_stubs_b.$(O): st_stubs.c $(HEADER)
+-	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
+ 
+ st_stubs_n.$(O): st_stubs.c $(HEADER)
+-	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
+ 
+ partialclean:
+ 	rm -f *.cm*
+--- a/Makefile.common.in
++++ b/Makefile.common.in
+@@ -79,4 +79,4 @@
+ # general (it supports both .o and .obj)
+ 
+ %.$(O): %.c
+-	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<

diff --git a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
index 666f43b938bd..00f3ebf026fd 100644
--- a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
@@ -25,7 +25,7 @@ QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.11.2-glibc-2.34.patch
-	"${FILESDIR}"/${PN}-4.10.2-cflags.patch
+	"${FILESDIR}"/${PN}-4.11.2-cflags.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/
@ 2022-03-29 12:09 Mark Wright
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Wright @ 2022-03-29 12:09 UTC (permalink / raw
  To: gentoo-commits

commit:     06b36e0f648bef1acf5ad451d9eebe3e04df2120
Author:     Mark Wright <gienah <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 29 12:08:33 2022 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Tue Mar 29 12:08:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06b36e0f

dev-lang/ocaml: Bump to 4.14.0, fix clang build.

See: https://github.com/ocaml/ocaml/pull/10774
Closes: https://bugs.gentoo.org/729566
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Mark Wright <gienah <AT> gentoo.org>

 dev-lang/ocaml/Manifest                       |   1 +
 dev-lang/ocaml/files/ocaml-4.14.0-clang.patch | 132 ++++++++++++++++++++++++++
 dev-lang/ocaml/ocaml-4.14.0.ebuild            | 103 ++++++++++++++++++++
 3 files changed, 236 insertions(+)

diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest
index 9466e909f6b9..edc6337be4cb 100644
--- a/dev-lang/ocaml/Manifest
+++ b/dev-lang/ocaml/Manifest
@@ -7,4 +7,5 @@ DIST ocaml-4.10.2.tar.gz 4933135 BLAKE2B ec5e92adb23c28a254247182c79ab555fd82603
 DIST ocaml-4.11.2.tar.gz 5075323 BLAKE2B bdc503d9a8d0e39dd11060febcd0287657b460e50ed81e55578a3e778af990ca5d4ef9011753eee4e1a144da33eb76c95b1672dc99b76e65a2e107eee472fe06 SHA512 03d8a9f6e130142c121ff2eb3d54f584f1e7c8475f066a5803bb0edd2fa172ca06a56a3ec548b225f5c8b12112d7a68511b1e16f3ade075b5f02610d4247bbb3
 DIST ocaml-4.12.1.tar.gz 5181696 BLAKE2B 9d21438e09b1a9680eabb65f5c78d9fe84459592ef7bb797a1933e5383f7b6d5cefffa8cdc184abc102417f5dbc0fca8ef624c9b560f89eaff6537544b5b395f SHA512 e942e5cf5530804690ec45c40936ad2acbb60e11279fc676e0f04181fe1855f84ee5c3cb9c337fc5d01f6ee0e7b2251a6c04f7de56d99c20bb62026dff6c5671
 DIST ocaml-4.13.1.tar.gz 5323203 BLAKE2B f1dcb1601ebfa2a37351e3a466a7ca601518c2da403b01aeb182738a54d5887523ab554d747d6591cb09b07b417865e20907f7877117b2d2d069ef6c9edc0fae SHA512 da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6
+DIST ocaml-4.14.0.tar.gz 5494844 BLAKE2B f2f9142a95722c7fc5fda205ea6b951939f7d285963b8aa14dc157ac10202ef9d00c7590beabdc97ed83548d61e5ef28b60a360f1a492420a54f4e26dfbf89f0 SHA512 3c5e5b9f00bb109dd99b5f7b0078cf8663d4247e548f3e601d6b2a55582e04bb20f6de85005c4cf2f78ae9aaa449f5ca6f2bab2f6ce83eeb3aeb386e3f2fcc32
 DIST ocaml-patches-9.tar.bz2 1700 BLAKE2B 4e46b8fb490db28f815414e285f54e251394ea53e1d25c529bbea9f03e426fd19132b1e2c7c2be7d14983fceb4cad073d191b001f6da522fee4226371d4a2eca SHA512 cc19f9104fac69aecc5effa8cb772342e1fb61cdcd38ba0176efe04cf3d710b1c56d5178748f3bd29099af91fa684da432a8ef8d42de76dbd1b6954a255ea6c0

diff --git a/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch b/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch
new file mode 100644
index 000000000000..cd3c042f2639
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch
@@ -0,0 +1,132 @@
+commit 28b553622bd0f168411d86ddcfba1adab0d87b92
+Author: Yawar Amin <yawar.amin@gmail.com>
+Date:   Mon Nov 15 22:40:43 2021 -0500
+
+    Fix ranlib error
+    
+    - Always pass ranlib one file argument at a time to avoid error 'Exactly
+      one archive should be specified'
+    - Call ranlib without cd'ing into the library's directory
+    - Use Makefile functionality to simplify recipes
+
+diff --git a/Makefile b/Makefile
+index c2522c775..2e4e44faa 100644
+--- a/Makefile
++++ b/Makefile
+@@ -549,6 +549,8 @@ else
+ endif
+ 	$(MAKE) -C tools installopt
+ 
++LIBRARIES = $(addsuffix .$(A), ocamlcommon ocamlbytecomp ocamloptcomp)
++
+ .PHONY: installoptopt
+ installoptopt:
+ 	$(INSTALL_PROG) ocamlc.opt$(EXE) "$(INSTALL_BINDIR)"
+@@ -585,8 +587,11 @@ endif
+ ifeq "$(INSTALL_OCAMLNAT)" "true"
+ 	  $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)"
+ endif
+-	cd "$(INSTALL_COMPLIBDIR)" && \
+-	   $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A)
++# Some versions of ranlib do not support multiple archives
++	for library in $(LIBRARIES); \
++	do \
++	  $(RANLIB) "$(INSTALL_COMPLIBDIR)/$$library"; \
++	done
+ 
+ # Installation of the *.ml sources of compiler-libs
+ .PHONY: install-compiler-sources
+diff --git a/otherlibs/Makefile.otherlibs.common b/otherlibs/Makefile.otherlibs.common
+index 95ff4d58f..6a4451e47 100644
+--- a/otherlibs/Makefile.otherlibs.common
++++ b/otherlibs/Makefile.otherlibs.common
+@@ -95,7 +95,7 @@ install::
+ 	fi
+ ifneq "$(STUBSLIB)" ""
+ 	$(INSTALL_DATA) $(STUBSLIB) "$(INSTALL_LIBDIR)/"
+-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) lib$(CLIBNAME).$(A)
++	$(RANLIB) "$(INSTALL_LIBDIR)/lib$(CLIBNAME).$(A)"
+ endif
+ 
+ 	$(INSTALL_DATA) \
+@@ -104,7 +104,7 @@ endif
+ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
+ 	$(INSTALL_DATA) \
+ 	  $(CMIFILES:.cmi=.mli) \
+-          $(CMIFILES:.cmi=.cmti) \
++	        $(CMIFILES:.cmi=.cmti) \
+ 	  "$(INSTALL_LIBDIR)/"
+ endif
+ 	if test -n "$(HEADERS)"; then \
+@@ -115,7 +115,7 @@ installopt:
+ 	$(INSTALL_DATA) \
+ 	   $(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \
+ 	   "$(INSTALL_LIBDIR)/"
+-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) $(LIBNAME).a
++	$(RANLIB) "$(INSTALL_LIBDIR)/$(LIBNAME).$(A)"
+ 	if test -f $(LIBNAME).cmxs; then \
+ 	  $(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR)"; \
+ 	fi
+diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile
+index 6b02dc197..dccc45103 100644
+--- a/otherlibs/dynlink/Makefile
++++ b/otherlibs/dynlink/Makefile
+@@ -249,12 +249,12 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
+ endif
+ 
+ installopt:
+-	if $(NATDYNLINK); then \
+-	  $(INSTALL_DATA) \
+-	    $(NATOBJS) dynlink.cmxa dynlink.$(A) \
+-	    "$(INSTALL_LIBDIR)" && \
+-	  cd "$(INSTALL_LIBDIR)" && $(RANLIB) dynlink.$(A); \
+-	fi
++ifeq "$(NATDYNLINK)" "true"
++	$(INSTALL_DATA) \
++	  $(NATOBJS) dynlink.cmxa dynlink.$(A) \
++	  "$(INSTALL_LIBDIR)"
++	$(RANLIB) "$(INSTALL_LIBDIR)/dynlink.$(A)"
++endif
+ 
+ partialclean:
+ 	rm -f $(extract_crc) *.cm[ioaxt] *.cmti *.cmxa \
+diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile
+index 8fc1bdb92..379c530fa 100644
+--- a/otherlibs/systhreads/Makefile
++++ b/otherlibs/systhreads/Makefile
+@@ -121,7 +121,7 @@ install:
+ 	  $(INSTALL_PROG) dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \
+ 	fi
+ 	$(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)"
+-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A)
++	$(RANLIB) "$(INSTALL_LIBDIR)/libthreads.$(A)"
+ 	mkdir -p "$(INSTALL_THREADSLIBDIR)"
+ 	$(INSTALL_DATA) \
+ 	  $(CMIFILES) threads.cma \
+@@ -136,11 +136,11 @@ endif
+ 
+ installopt:
+ 	$(INSTALL_DATA) libthreadsnat.$(A) "$(INSTALL_LIBDIR)"
+-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreadsnat.$(A)
++	$(RANLIB) "$(INSTALL_LIBDIR)/libthreadsnat.$(A)"
+ 	$(INSTALL_DATA) \
+ 	  $(THREADS_NCOBJS) threads.cmxa threads.$(A) \
+ 	  "$(INSTALL_THREADSLIBDIR)"
+-	cd "$(INSTALL_THREADSLIBDIR)" && $(RANLIB) threads.$(A)
++	$(RANLIB) "$(INSTALL_THREADSLIBDIR)/threads.$(A)"
+ 
+ %.cmi: %.mli
+ 	$(CAMLC) -c $(COMPFLAGS) $<
+diff --git a/stdlib/Makefile b/stdlib/Makefile
+index df34bc2d4..32c5dab56 100644
+--- a/stdlib/Makefile
++++ b/stdlib/Makefile
+@@ -105,7 +105,7 @@ installopt-default::
+ 	$(INSTALL_DATA) \
+ 	  stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx \
+ 	  "$(INSTALL_LIBDIR)"
+-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) stdlib.$(A)
++	$(RANLIB) "$(INSTALL_LIBDIR)/stdlib.$(A)"
+ 
+ ifeq "$(UNIX_OR_WIN32)" "unix"
+ HEADERPROGRAM = header

diff --git a/dev-lang/ocaml/ocaml-4.14.0.ebuild b/dev-lang/ocaml/ocaml-4.14.0.ebuild
new file mode 100644
index 000000000000..d54fe96af6c3
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.14.0.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic
+
+HOMEPAGE="https://ocaml.org/"
+SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
+DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles"
+
+LICENSE="QPL-1.0 LGPL-2"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="emacs flambda latex +ocamlopt xemacs"
+
+RDEPEND="sys-libs/binutils-libs:="
+BDEPEND="${RDEPEND}
+	virtual/pkgconfig"
+PDEPEND="emacs? ( app-emacs/ocaml-mode )
+	xemacs? ( app-xemacs/ocaml )"
+
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.14.0-clang.patch
+)
+
+src_prepare() {
+	default
+
+	cp "${FILESDIR}"/ocaml.conf "${T}" || die
+
+	# OCaml generates textrels on 32-bit arches
+	# We can't do anything about it, but disabling it means that tests
+	# for OCaml-based packages won't fail on unexpected output
+	# bug #773226
+	if use arm || use ppc || use x86 ; then
+		append-ldflags "-Wl,-z,notext"
+	fi
+
+	# Upstream build ignores LDFLAGS in several places.
+	sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
+		-e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
+		-e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
+		Makefile.config.in || die "LDFLAGS fix failed"
+}
+
+src_configure() {
+	local opt=(
+		--bindir="${EPREFIX}/usr/bin"
+		--libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
+		--mandir="${EPREFIX}/usr/share/man"
+		--prefix="${EPREFIX}/usr"
+		$(use_enable flambda)
+	)
+
+	econf "${opt[@]}"
+}
+
+src_compile() {
+	env -u P emake world
+
+	if use ocamlopt ; then
+		env -u P emake opt
+		env -u P emake opt.opt
+	fi
+}
+
+src_test() {
+	emake -j
+
+	# OCaml tests only work when run sequentially
+	if use ocamlopt ; then
+		emake -j1 ocamltest.opt
+	else
+		emake -j1 ocamltest
+		#ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
+	fi
+
+	emake -j1 tests
+}
+
+src_install() {
+	default
+
+	dodir /usr/include
+	# Create symlink for header files
+	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
+	dodoc Changes README.adoc
+
+	# Create envd entry for latex input files
+	if use latex ; then
+		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
+		doenvd "${T}"/99ocamldoc
+	fi
+
+	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
+
+	# Install ocaml-rebuild portage set
+	insinto /usr/share/portage/config/sets
+	doins "${T}"/ocaml.conf
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-03-29 12:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-27  6:27 [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/, dev-lang/ocaml/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2022-03-29 12:09 Mark Wright
2022-02-25 19:58 Alfredo Tupone
2022-02-22  0:56 Sam James
2022-02-22  0:41 Sam James
2022-01-22 20:25 Alfredo Tupone
2021-10-17  5:24 Sam James
2021-10-09  5:56 Sam James
2021-01-28 22:15 Alfredo Tupone
2017-01-25 16:56 Alexis Ballier
2015-11-10 12:08 Alexis Ballier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox