diff options
author | Sam James <sam@gentoo.org> | 2021-06-18 21:54:19 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-06-18 22:08:29 +0100 |
commit | 32961e61fdd8aef2d28e533c01ca81d90140f7ff (patch) | |
tree | 6fb6d383386c8096e662977126be845f2f967562 /dev-lang/ocaml/ocaml-4.11.2-r2.ebuild | |
parent | www-client/opera-beta: bump to 77.0.4054.91 (diff) | |
download | gentoo-32961e61fdd8aef2d28e533c01ca81d90140f7ff.tar.gz gentoo-32961e61fdd8aef2d28e533c01ca81d90140f7ff.tar.bz2 gentoo-32961e61fdd8aef2d28e533c01ca81d90140f7ff.zip |
dev-lang/ocaml: fix installed Portage set libdir target
Closes: https://bugs.gentoo.org/796641
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/ocaml/ocaml-4.11.2-r2.ebuild')
-rw-r--r-- | dev-lang/ocaml/ocaml-4.11.2-r2.ebuild | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild new file mode 100644 index 000000000000..3ef5a4d10154 --- /dev/null +++ b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild @@ -0,0 +1,90 @@ +# 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 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 )" + +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) + $(use_enable spacetime) + ) + econf ${opt[@]} +} + +src_compile() { + if use ocamlopt ; then + env -u P emake world.opt + else + env -u P emake world + fi +} + +src_test() { + if use ocamlopt ; then + # OCaml tests only work when run sequentially + emake -j1 tests + 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 +} |