summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubos Kolouch <lubos@kolouch.net>2020-10-07 22:52:47 +0200
committerMark Wright <gienah@gentoo.org>2020-10-13 23:52:20 +1100
commitea2f393820e0834d4ee833e6e24e2137710920d2 (patch)
tree2672d0596534fbdbea4ee7980483a47c4756a9cd /dev-lang/ocaml/ocaml-4.10.0.ebuild
parentdev-python/python_orocos_kdl: add py39 (diff)
downloadgentoo-ea2f393820e0834d4ee833e6e24e2137710920d2.tar.gz
gentoo-ea2f393820e0834d4ee833e6e24e2137710920d2.tar.bz2
gentoo-ea2f393820e0834d4ee833e6e24e2137710920d2.zip
dev-lang/ocaml: Bump to 4.10.0
Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Lubos Kolouch <lubos@kolouch.net> Signed-off-by: Mark Wright <gienah@gentoo.org>
Diffstat (limited to 'dev-lang/ocaml/ocaml-4.10.0.ebuild')
-rw-r--r--dev-lang/ocaml/ocaml-4.10.0.ebuild78
1 files changed, 78 insertions, 0 deletions
diff --git a/dev-lang/ocaml/ocaml-4.10.0.ebuild b/dev-lang/ocaml/ocaml-4.10.0.ebuild
new file mode 100644
index 000000000000..73512531e69a
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.10.0.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-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 )"
+
+#PATCHES=("${FILESDIR}"/${PN}-4.10.0-gcc-10.patch)
+
+src_prepare() {
+ default
+ # 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"
+ doenvd "${T}/99ocamldoc"
+ fi
+ # Install ocaml-rebuild portage set
+ insinto /usr/share/portage/config/sets
+ doins "${FILESDIR}/ocaml.conf"
+}