From 0aad4cd3e3fe3db90904ffc51b35e4ff160b53c5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 10 Jun 2024 00:08:04 +0100 Subject: gentoo auto-resync : 10:06:2024 - 00:08:04 --- dev-lang/ocaml/ocaml-5.2.0.ebuild | 107 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 dev-lang/ocaml/ocaml-5.2.0.ebuild (limited to 'dev-lang/ocaml/ocaml-5.2.0.ebuild') diff --git a/dev-lang/ocaml/ocaml-5.2.0.ebuild b/dev-lang/ocaml/ocaml-5.2.0.ebuild new file mode 100644 index 000000000000..dc8655e47ad7 --- /dev/null +++ b/dev-lang/ocaml/ocaml-5.2.0.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic + +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" + +LICENSE="QPL-1.0 LGPL-2" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="emacs flambda latex +ocamlopt test 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' + +RESTRICT="!test? ( test )" + +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() { + filter-lto #bug 870349 + local opt=( + --bindir="${EPREFIX}/usr/bin" + --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml" + --mandir="${EPREFIX}/usr/share/man" + --prefix="${EPREFIX}/usr" + $(use_enable test ocamltest) \ + $(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() { + # OCaml generates textrels on 32-bit arches + if use arm || use ppc || use x86 ; then + export QA_TEXTRELS='.*' + fi + 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 +} -- cgit v1.2.3