Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/
Date: Fri, 27 Dec 2019 13:39:40
Message-Id: 1577453971.df1434388cf449f432d8058f8fa0e9f0202483ab.zlogene@gentoo
1 commit: df1434388cf449f432d8058f8fa0e9f0202483ab
2 Author: Ralph Seichter <github <AT> seichter <DOT> de>
3 AuthorDate: Mon Dec 16 01:37:34 2019 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 27 13:39:31 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df143438
7
8 dev-lang/ocaml: Bump to version 4.09.0, EAPI 7
9
10 This new OCaml ebuild uses EAPI 7. As discussed with Zlogenem, multi-
11 platform support has been removed and the ebuild is now keyworded for
12 ~amd64 only.
13
14 Significant time was spent figuring out why the build failed when run
15 via ebuild, but succeeded when run manually. After I filed an upstream
16 issue[1] and a subsequent discussion, it turned out that Gentoo's ${P}
17 variable clashed with the OCaml build, as I had suspected. The line
18
19 P ?= stdlib__
20
21 in a Makefile resulted in wrong file paths which in turn broke the
22 OCaml documentation build. I have asked upstream if their use of the
23 "?=" operator is deliberate; an answer is pending.
24
25 The license in this build has been changed to match [2].
26
27 [1] https://github.com/ocaml/ocaml/issues/9189
28 [2] https://ocaml.org/docs/license.html
29
30 Closes: https://bugs.gentoo.org/688108
31 Package-Manager: Portage-2.3.79, Repoman-2.3.16
32 Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
33 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
34
35 dev-lang/ocaml/Manifest | 1 +
36 dev-lang/ocaml/ocaml-4.09.0.ebuild | 76 ++++++++++++++++++++++++++++++++++++++
37 2 files changed, 77 insertions(+)
38
39 diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest
40 index cdb9691eb47..01c355f8949 100644
41 --- a/dev-lang/ocaml/Manifest
42 +++ b/dev-lang/ocaml/Manifest
43 @@ -1,4 +1,5 @@
44 DIST ocaml-4.04.2.tar.gz 4061873 BLAKE2B 756936592c7e0c87da27f154f07850eb3e4b2ed46ff3b36ff57541375840cd56b170dbe646ef6682f63d4e15ae209d3c125581803641f07403e9eb838c265519 SHA512 8b6a0319307cbb7451594d2f7c63851299d3e7d6ae7879e7525373304f9fd5a9b01d503ecd313a12a3cae24a4a7cb909f7aeebbb70efaa5277137189ea4558cb
45 DIST ocaml-4.05.0.tar.gz 4431750 BLAKE2B c2ab003a13e0a581ebd0e1c96eeb8a9baea9bfe6bee08823b0e4541819201ec109f1846e13fc1aefa51a001eefbb8f73320ba854d41975fc68cef41bc75b1ecc SHA512 9a060ae4b741e1687277403e5bdb8f6eda2e2ebf6c45f7c0149b66ea1213cb26d13febfbb3f11c12543e244cfdd053b786b09c4145e2348e5d89a7206f7de225
46 +DIST ocaml-4.09.0.tar.gz 4838748 BLAKE2B 80f29d535c64bf2371b480217723ed20b2b21cfd93ce31366a7b91e7ddffdf68db4e88d085288b7e21efee567a13f42ecff24c3a0115507b006acf844239cefd SHA512 dc0271e591bf929b751705835790949a9d741e12d085c8b207c3689b5838a02ea8de80da8b2605d2e6744f2f541b0d1694ffafff9509e99ce01f3a391f6ef2ae
47 DIST ocaml-patches-8.tar.bz2 1803 BLAKE2B 5e76a198c2f5ca9f231d4e80499d784cf061ec79bf6b5e3aac917e1260d1f2b927f0f8015d39c01ce4fd481d32a5d211c31e081a7ab87ba1e7c7d5def95bc0fb SHA512 fc477fbb5bdec60a3c4d3dfa110119bb579560ac0e0e57e30e076da72643bda6359c06fd3745fd3436c5d611dbbd888ec2921e9d1920f4929df633c35a797411
48 DIST ocaml-patches-9.tar.bz2 1700 BLAKE2B 4e46b8fb490db28f815414e285f54e251394ea53e1d25c529bbea9f03e426fd19132b1e2c7c2be7d14983fceb4cad073d191b001f6da522fee4226371d4a2eca SHA512 cc19f9104fac69aecc5effa8cb772342e1fb61cdcd38ba0176efe04cf3d710b1c56d5178748f3bd29099af91fa684da432a8ef8d42de76dbd1b6954a255ea6c0
49
50 diff --git a/dev-lang/ocaml/ocaml-4.09.0.ebuild b/dev-lang/ocaml/ocaml-4.09.0.ebuild
51 new file mode 100644
52 index 00000000000..feadd4f5804
53 --- /dev/null
54 +++ b/dev-lang/ocaml/ocaml-4.09.0.ebuild
55 @@ -0,0 +1,76 @@
56 +# Copyright 1999-2019 Gentoo Authors
57 +# Distributed under the terms of the GNU General Public License v2
58 +
59 +EAPI=7
60 +
61 +HOMEPAGE="https://ocaml.org/"
62 +SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
63 +DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles"
64 +
65 +LICENSE="LGPL-2.1"
66 +SLOT="0/${PV}"
67 +KEYWORDS="~amd64"
68 +IUSE="emacs flambda latex +ocamlopt spacetime xemacs"
69 +
70 +RDEPEND="sys-libs/binutils-libs:=
71 + spacetime? ( sys-libs/libunwind:= )"
72 +BDEPEND="${RDEPEND}
73 + virtual/pkgconfig"
74 +PDEPEND="emacs? ( app-emacs/ocaml-mode )
75 + xemacs? ( app-xemacs/ocaml )"
76 +
77 +src_prepare() {
78 + default
79 + # Upstream build ignores LDFLAGS in several places.
80 + sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
81 + -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
82 + -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
83 + Makefile.config.in || die "LDFLAGS fix failed"
84 + # ${P} overrides upstream build's own P due to a wrong assignment operator.
85 + sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed"
86 +}
87 +
88 +src_configure() {
89 + local opt=(
90 + --bindir="${EPREFIX}/usr/bin"
91 + --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
92 + --mandir="${EPREFIX}/usr/share/man"
93 + --prefix="${EPREFIX}/usr"
94 + $(use_enable flambda)
95 + $(use_enable spacetime)
96 + )
97 + econf ${opt[@]}
98 +}
99 +
100 +src_compile() {
101 + if use ocamlopt ; then
102 + emake world.opt
103 + else
104 + emake world
105 + fi
106 +}
107 +
108 +src_test() {
109 + if use ocamlopt ; then
110 + # OCaml tests only work when run sequentially
111 + emake -j1 -C testsuite all
112 + else
113 + ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
114 + fi
115 +}
116 +
117 +src_install() {
118 + default
119 + dodir /usr/include
120 + # Create symlink for header files
121 + dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
122 + dodoc Changes README.adoc
123 + # Create envd entry for latex input files
124 + if use latex ; then
125 + echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}/99ocamldoc"
126 + doenvd "${T}/99ocamldoc"
127 + fi
128 + # Install ocaml-rebuild portage set
129 + insinto /usr/share/portage/config/sets
130 + doins "${FILESDIR}/ocaml.conf"
131 +}