1 |
commit: 1cab272249d1ab098a17a023cc5b1d3a83eaeaf0 |
2 |
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 31 19:00:21 2023 +0000 |
4 |
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 31 19:10:10 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cab2722 |
7 |
|
8 |
dev-ml/extlib: update EAPI 7 -> 8 |
9 |
|
10 |
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> |
11 |
|
12 |
dev-ml/extlib/extlib-1.7.7-r1.ebuild | 60 ++++++++++++++++++++++ |
13 |
.../files/0001-Add-support-for-OCaml-4.12.patch | 25 +++++++++ |
14 |
...niv_param-was-removed-for-OCaml-pre-4.00-.patch | 38 ++++++++++++++ |
15 |
3 files changed, 123 insertions(+) |
16 |
|
17 |
diff --git a/dev-ml/extlib/extlib-1.7.7-r1.ebuild b/dev-ml/extlib/extlib-1.7.7-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 000000000000..b21b2aaa3217 |
20 |
--- /dev/null |
21 |
+++ b/dev-ml/extlib/extlib-1.7.7-r1.ebuild |
22 |
@@ -0,0 +1,60 @@ |
23 |
+# Copyright 1999-2023 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=8 |
27 |
+ |
28 |
+inherit findlib vcs-clean |
29 |
+ |
30 |
+DESCRIPTION="Standard library extensions for O'Caml" |
31 |
+HOMEPAGE="https://github.com/ygrek/ocaml-extlib" |
32 |
+SRC_URI="https://github.com/ygrek/ocaml-extlib/archive/${PV}.tar.gz -> ${P}.tar.gz" |
33 |
+ |
34 |
+LICENSE="LGPL-2.1" |
35 |
+SLOT="0/${PV}" |
36 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos" |
37 |
+IUSE="doc +ocamlopt" |
38 |
+ |
39 |
+# See bug #704146 |
40 |
+BDEPEND=">=dev-ml/cppo-1.6.6" |
41 |
+RDEPEND="dev-lang/ocaml:=[ocamlopt?]" |
42 |
+DEPEND="${RDEPEND}" |
43 |
+ |
44 |
+PATCHES=( |
45 |
+ "${FILESDIR}"/${PN}-1.7.7-no-git.patch |
46 |
+ "${FILESDIR}"/0001-Add-support-for-OCaml-4.12.patch |
47 |
+ "${FILESDIR}"/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch |
48 |
+) |
49 |
+ |
50 |
+S="${WORKDIR}/ocaml-${P}" |
51 |
+ |
52 |
+src_prepare() { |
53 |
+ default |
54 |
+ egit_clean |
55 |
+} |
56 |
+ |
57 |
+src_compile() { |
58 |
+ cd src || die |
59 |
+ emake -j1 all |
60 |
+ if use ocamlopt; then |
61 |
+ emake opt cmxs |
62 |
+ fi |
63 |
+ |
64 |
+ if use doc; then |
65 |
+ emake doc |
66 |
+ fi |
67 |
+} |
68 |
+ |
69 |
+src_test() { |
70 |
+ emake -j1 test |
71 |
+} |
72 |
+ |
73 |
+src_install() { |
74 |
+ findlib_src_install |
75 |
+ |
76 |
+ # install documentation |
77 |
+ dodoc README.md |
78 |
+ |
79 |
+ if use doc; then |
80 |
+ dodoc -r src/doc/ |
81 |
+ fi |
82 |
+} |
83 |
|
84 |
diff --git a/dev-ml/extlib/files/0001-Add-support-for-OCaml-4.12.patch b/dev-ml/extlib/files/0001-Add-support-for-OCaml-4.12.patch |
85 |
new file mode 100644 |
86 |
index 000000000000..8a2d076f8224 |
87 |
--- /dev/null |
88 |
+++ b/dev-ml/extlib/files/0001-Add-support-for-OCaml-4.12.patch |
89 |
@@ -0,0 +1,25 @@ |
90 |
+From 3b2073701aed50cd768e0a4cd3c776c7a3a54d7e Mon Sep 17 00:00:00 2001 |
91 |
+From: Kate <kit.ty.kate@×××××××.org> |
92 |
+Date: Thu, 5 Nov 2020 22:17:24 +0000 |
93 |
+Subject: [PATCH 1/2] Add support for OCaml 4.12 |
94 |
+ |
95 |
+--- |
96 |
+ src/extList.ml | 2 +- |
97 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
98 |
+ |
99 |
+diff --git a/src/extList.ml b/src/extList.ml |
100 |
+index 4f0057f..a1435ee 100644 |
101 |
+--- a/src/extList.ml |
102 |
++++ b/src/extList.ml |
103 |
+@@ -380,7 +380,7 @@ let combine l1 l2 = |
104 |
+ loop dummy l1 l2; |
105 |
+ dummy.tl |
106 |
+ |
107 |
+-let sort ?(cmp=compare) = List.sort cmp |
108 |
++let sort ?(cmp=Pervasives.compare) = List.sort cmp |
109 |
+ |
110 |
+ #if OCAML < 406 |
111 |
+ let rec init size f = |
112 |
+-- |
113 |
+2.30.0 |
114 |
+ |
115 |
|
116 |
diff --git a/dev-ml/extlib/files/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch b/dev-ml/extlib/files/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch |
117 |
new file mode 100644 |
118 |
index 000000000000..59a6843f3a15 |
119 |
--- /dev/null |
120 |
+++ b/dev-ml/extlib/files/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch |
121 |
@@ -0,0 +1,38 @@ |
122 |
+From 574e8eae2d358b6db62c2d062b194a7aa06ac02c Mon Sep 17 00:00:00 2001 |
123 |
+From: Kate <kit.ty.kate@×××××××.org> |
124 |
+Date: Fri, 6 Nov 2020 14:10:26 +0000 |
125 |
+Subject: [PATCH 2/2] caml_hash_univ_param was removed for OCaml (pre-4.00 |
126 |
+ function) |
127 |
+ |
128 |
+--- |
129 |
+ src/extHashtbl.ml | 6 +++++- |
130 |
+ 1 file changed, 5 insertions(+), 1 deletion(-) |
131 |
+ |
132 |
+diff --git a/src/extHashtbl.ml b/src/extHashtbl.ml |
133 |
+index 140e9c2..3c69df4 100644 |
134 |
+--- a/src/extHashtbl.ml |
135 |
++++ b/src/extHashtbl.ml |
136 |
+@@ -22,7 +22,7 @@ |
137 |
+ module Hashtbl = |
138 |
+ struct |
139 |
+ |
140 |
+-#if OCAML >= 400 |
141 |
++#if OCAML >= 400 && OCAML < 412 |
142 |
+ external old_hash_param : |
143 |
+ int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" |
144 |
+ #endif |
145 |
+@@ -114,7 +114,11 @@ module Hashtbl = |
146 |
+ (* compatibility with old hash tables *) |
147 |
+ if Obj.size (Obj.repr h) >= 3 |
148 |
+ then (seeded_hash_param 10 100 (h_conv h).seed key) land (Array.length (h_conv h).data - 1) |
149 |
++ #if OCAML >= 412 |
150 |
++ else failwith "Old hash function not supported anymore" |
151 |
++ #else |
152 |
+ else (old_hash_param 10 100 key) mod (Array.length (h_conv h).data) |
153 |
++ #endif |
154 |
+ #else |
155 |
+ let key_index h key = (hash key) mod (Array.length (h_conv h).data) |
156 |
+ #endif |
157 |
+-- |
158 |
+2.30.0 |
159 |
+ |