summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-06-09 21:38:36 +0000
committerSam James <sam@gentoo.org>2021-06-09 21:38:36 +0000
commit2e76cc8b33f566bab28fad6f4efba99b18c03631 (patch)
tree8b2a2f3240910b24304810f74c76d68b4a0e4734 /dev-lang/ocaml/ocaml-4.12.0-r1.ebuild
parentdev-ml/ocaml-fileutils: add 0.6.3 (diff)
downloadgentoo-2e76cc8b33f566bab28fad6f4efba99b18c03631.tar.gz
gentoo-2e76cc8b33f566bab28fad6f4efba99b18c03631.tar.bz2
gentoo-2e76cc8b33f566bab28fad6f4efba99b18c03631.zip
dev-lang/ocaml: adjust subslot to be major version
Should be bytecode compatible with non-major version changes. Makes it a lot easier to give dependencies in e.g. camlp4 which needs to be exactly aligned with the OCaml major version. Bug: https://bugs.gentoo.org/794898 Acked-by: Alfredo Tupone <tupone@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/ocaml/ocaml-4.12.0-r1.ebuild')
-rw-r--r--dev-lang/ocaml/ocaml-4.12.0-r1.ebuild93
1 files changed, 93 insertions, 0 deletions
diff --git a/dev-lang/ocaml/ocaml-4.12.0-r1.ebuild b/dev-lang/ocaml/ocaml-4.12.0-r1.ebuild
new file mode 100644
index 000000000000..137a6160e458
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.12.0-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2021 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="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 )"
+
+src_prepare() {
+ default
+
+ # 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
+
+ # Install ocaml-rebuild portage set
+ insinto /usr/share/portage/config/sets
+ doins "${FILESDIR}/ocaml.conf"
+}