Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/
Date: Sat, 02 Oct 2021 05:23:57
Message-Id: 1633151349.f570bf2b0a65911fc4b9759e20f748cda8d00d17.sam@gentoo
1 commit: f570bf2b0a65911fc4b9759e20f748cda8d00d17
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 2 05:09:09 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 2 05:09:09 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f570bf2b
7
8 dev-lang/ocaml: add 4.13.0
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 dev-lang/ocaml/Manifest | 1 +
13 dev-lang/ocaml/ocaml-4.13.0.ebuild | 97 ++++++++++++++++++++++++++++++++++++++
14 2 files changed, 98 insertions(+)
15
16 diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest
17 index 15b20c48f7d..a9db051fa41 100644
18 --- a/dev-lang/ocaml/Manifest
19 +++ b/dev-lang/ocaml/Manifest
20 @@ -4,4 +4,5 @@ DIST ocaml-4.10.2.tar.gz 4933135 BLAKE2B ec5e92adb23c28a254247182c79ab555fd82603
21 DIST ocaml-4.11.2.tar.gz 5075323 BLAKE2B bdc503d9a8d0e39dd11060febcd0287657b460e50ed81e55578a3e778af990ca5d4ef9011753eee4e1a144da33eb76c95b1672dc99b76e65a2e107eee472fe06 SHA512 03d8a9f6e130142c121ff2eb3d54f584f1e7c8475f066a5803bb0edd2fa172ca06a56a3ec548b225f5c8b12112d7a68511b1e16f3ade075b5f02610d4247bbb3
22 DIST ocaml-4.12.0.tar.gz 5179734 BLAKE2B 318be7e306157102d7ad22802db381dfa9c675e43325395695c3564e5ffee87d9b55d1152ea1603edb5ef715a28cbde85d835dbf1b5aface2dc415c67192c208 SHA512 951e44cdda613f9c6c5f988434c84249a2d63ba14e21938a9e74c174ebaf9d81a3160d1e5021d57fcd4882732ae6aefc05239ac38116f39ca83d53879d5d4eaf
23 DIST ocaml-4.12.1.tar.gz 5181696 BLAKE2B 9d21438e09b1a9680eabb65f5c78d9fe84459592ef7bb797a1933e5383f7b6d5cefffa8cdc184abc102417f5dbc0fca8ef624c9b560f89eaff6537544b5b395f SHA512 e942e5cf5530804690ec45c40936ad2acbb60e11279fc676e0f04181fe1855f84ee5c3cb9c337fc5d01f6ee0e7b2251a6c04f7de56d99c20bb62026dff6c5671
24 +DIST ocaml-4.13.0.tar.gz 5323007 BLAKE2B 56cbb64272ac2b4b8894b3bb91ec184eb977cb056ae75ace2fce716fdb9853d5626b8f91dcc339d1d0f9f033f032f99bc6e49c443ee142f6005aaabeef9a670a SHA512 553c94ba5c5332d134f2695b3323e4be60ef2d0a404652cbcc56968ec91b1de19a6d894c6e365e418fe814595bb926450d7b109e328e25fc317f13ed6b703080
25 DIST ocaml-patches-9.tar.bz2 1700 BLAKE2B 4e46b8fb490db28f815414e285f54e251394ea53e1d25c529bbea9f03e426fd19132b1e2c7c2be7d14983fceb4cad073d191b001f6da522fee4226371d4a2eca SHA512 cc19f9104fac69aecc5effa8cb772342e1fb61cdcd38ba0176efe04cf3d710b1c56d5178748f3bd29099af91fa684da432a8ef8d42de76dbd1b6954a255ea6c0
26
27 diff --git a/dev-lang/ocaml/ocaml-4.13.0.ebuild b/dev-lang/ocaml/ocaml-4.13.0.ebuild
28 new file mode 100644
29 index 00000000000..da99522c6e3
30 --- /dev/null
31 +++ b/dev-lang/ocaml/ocaml-4.13.0.ebuild
32 @@ -0,0 +1,97 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +inherit flag-o-matic
39 +
40 +HOMEPAGE="https://ocaml.org/"
41 +SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
42 +DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles"
43 +
44 +LICENSE="QPL-1.0 LGPL-2"
45 +SLOT="0/$(ver_cut 1-2)"
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
47 +IUSE="emacs flambda latex +ocamlopt xemacs"
48 +
49 +RDEPEND="sys-libs/binutils-libs:="
50 +BDEPEND="${RDEPEND}
51 + virtual/pkgconfig"
52 +PDEPEND="emacs? ( app-emacs/ocaml-mode )
53 + xemacs? ( app-xemacs/ocaml )"
54 +
55 +src_prepare() {
56 + default
57 +
58 + cp "${FILESDIR}"/ocaml.conf "${T}" || die
59 +
60 + # OCaml generates textrels on 32-bit arches
61 + # We can't do anything about it, but disabling it means that tests
62 + # for OCaml-based packages won't fail on unexpected output
63 + # bug #773226
64 + if use arm || use ppc || use x86 ; then
65 + append-ldflags "-Wl,-z,notext"
66 + fi
67 +
68 + # Upstream build ignores LDFLAGS in several places.
69 + sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
70 + -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
71 + -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
72 + Makefile.config.in || die "LDFLAGS fix failed"
73 +}
74 +
75 +src_configure() {
76 + local opt=(
77 + --bindir="${EPREFIX}/usr/bin"
78 + --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
79 + --mandir="${EPREFIX}/usr/share/man"
80 + --prefix="${EPREFIX}/usr"
81 + $(use_enable flambda)
82 + )
83 +
84 + econf "${opt[@]}"
85 +}
86 +
87 +src_compile() {
88 + env -u P emake world
89 +
90 + if use ocamlopt ; then
91 + env -u P emake opt
92 + env -u P emake opt.opt
93 + fi
94 +}
95 +
96 +src_test() {
97 + emake -j
98 +
99 + # OCaml tests only work when run sequentially
100 + if use ocamlopt ; then
101 + emake -j1 ocamltest.opt
102 + else
103 + emake -j1 ocamltest
104 + #ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
105 + fi
106 +
107 + emake -j1 tests
108 +}
109 +
110 +src_install() {
111 + default
112 +
113 + dodir /usr/include
114 + # Create symlink for header files
115 + dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
116 + dodoc Changes README.adoc
117 +
118 + # Create envd entry for latex input files
119 + if use latex ; then
120 + echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
121 + doenvd "${T}"/99ocamldoc
122 + fi
123 +
124 + sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
125 +
126 + # Install ocaml-rebuild portage set
127 + insinto /usr/share/portage/config/sets
128 + doins "${T}"/ocaml.conf
129 +}