1 |
commit: 52d438422968d43ce090534d9e80b89e4f905754 |
2 |
Author: Hank Leininger <hlein <AT> korelogic <DOT> com> |
3 |
AuthorDate: Tue Jun 1 16:29:43 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 6 23:55:18 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52d43842 |
7 |
|
8 |
dev-ml/opam-installer: patch for dose3-6.x compat |
9 |
|
10 |
Lifted from Debian, see https://bugs.debian.org/982733 |
11 |
|
12 |
Signed-off-by: Hank Leininger <hlein <AT> korelogic.com> |
13 |
Closes: https://bugs.gentoo.org/788265 |
14 |
Package-Manager: Portage-3.0.19, Repoman-3.0.3 |
15 |
Closes: https://github.com/gentoo/gentoo/pull/20686 |
16 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
17 |
|
18 |
.../files/debian-Port-to-Dose3-6.0.1.patch | 142 +++++++++++++++++++++ |
19 |
.../opam-installer/opam-installer-2.0.8-r3.ebuild | 45 +++++++ |
20 |
2 files changed, 187 insertions(+) |
21 |
|
22 |
diff --git a/dev-ml/opam-installer/files/debian-Port-to-Dose3-6.0.1.patch b/dev-ml/opam-installer/files/debian-Port-to-Dose3-6.0.1.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..a8af27416df |
25 |
--- /dev/null |
26 |
+++ b/dev-ml/opam-installer/files/debian-Port-to-Dose3-6.0.1.patch |
27 |
@@ -0,0 +1,142 @@ |
28 |
+From: Mehdi Dogguy <mehdi@××××××.org> |
29 |
+Date: Sun, 28 Feb 2021 19:27:24 +0100 |
30 |
+Subject: Port to Dose3 6.0.1 |
31 |
+ |
32 |
+--- |
33 |
+ src/client/opamAdminCheck.ml | 2 ++ |
34 |
+ src/client/opamAdminRepoUpgrade.ml | 2 ++ |
35 |
+ src/solver/opamBuiltinMccs.ml.real | 2 +- |
36 |
+ src/solver/opamCudf.ml | 5 ++++- |
37 |
+ src/solver/opamCudf.mli | 4 ++-- |
38 |
+ src/solver/opamCudfSolver.ml | 4 ++-- |
39 |
+ src/solver/opamSolver.ml | 4 +++- |
40 |
+ 7 files changed, 16 insertions(+), 7 deletions(-) |
41 |
+ |
42 |
+diff --git a/src/client/opamAdminCheck.ml b/src/client/opamAdminCheck.ml |
43 |
+index 05543a2..f23bfc4 100644 |
44 |
+--- a/src/client/opamAdminCheck.ml |
45 |
++++ b/src/client/opamAdminCheck.ml |
46 |
+@@ -8,6 +8,8 @@ |
47 |
+ (* *) |
48 |
+ (**************************************************************************) |
49 |
+ |
50 |
++module Algo = Dose_algo |
51 |
++ |
52 |
+ open OpamTypes |
53 |
+ open OpamPackage.Set.Op |
54 |
+ |
55 |
+diff --git a/src/client/opamAdminRepoUpgrade.ml b/src/client/opamAdminRepoUpgrade.ml |
56 |
+index 0be53b2..635e792 100644 |
57 |
+--- a/src/client/opamAdminRepoUpgrade.ml |
58 |
++++ b/src/client/opamAdminRepoUpgrade.ml |
59 |
+@@ -8,6 +8,8 @@ |
60 |
+ (* *) |
61 |
+ (**************************************************************************) |
62 |
+ |
63 |
++module Algo = Dose_algo |
64 |
++ |
65 |
+ open OpamTypes |
66 |
+ open OpamProcess.Job.Op |
67 |
+ open OpamStd.Option.Op |
68 |
+diff --git a/src/solver/opamBuiltinMccs.ml.real b/src/solver/opamBuiltinMccs.ml.real |
69 |
+index ab39ab3..2b41982 100644 |
70 |
+--- a/src/solver/opamBuiltinMccs.ml.real |
71 |
++++ b/src/solver/opamBuiltinMccs.ml.real |
72 |
+@@ -35,7 +35,7 @@ let call solver_backend ext ~criteria ?timeout cudf = |
73 |
+ ~verbose:OpamCoreConfig.(!r.debug_level >= 2) |
74 |
+ ?timeout criteria cudf |
75 |
+ with |
76 |
+- | None -> raise Common.CudfSolver.Unsat |
77 |
++ | None -> raise Dose_common.CudfSolver.Unsat |
78 |
+ | Some (preamble, univ) -> Some preamble, univ |
79 |
+ | exception Mccs.Timeout -> raise Timeout |
80 |
+ |
81 |
+diff --git a/src/solver/opamCudf.ml b/src/solver/opamCudf.ml |
82 |
+index e07ff54..ad7293c 100644 |
83 |
+--- a/src/solver/opamCudf.ml |
84 |
++++ b/src/solver/opamCudf.ml |
85 |
+@@ -9,6 +9,9 @@ |
86 |
+ (* *) |
87 |
+ (**************************************************************************) |
88 |
+ |
89 |
++module Common = Dose_common |
90 |
++module Algo = Dose_algo |
91 |
++ |
92 |
+ open OpamTypes |
93 |
+ open OpamTypesBase |
94 |
+ |
95 |
+@@ -634,7 +637,7 @@ let call_external_solver ~version_map univ req = |
96 |
+ let r = |
97 |
+ Algo.Depsolver.check_request_using |
98 |
+ ~call_solver:(OpamSolverConfig.call_solver ~criteria) |
99 |
+- ~criteria ~explain:true cudf_request |
100 |
++ ~explain:true cudf_request |
101 |
+ in |
102 |
+ log "Solver call done in %.3f" (chrono ()); |
103 |
+ r |
104 |
+diff --git a/src/solver/opamCudf.mli b/src/solver/opamCudf.mli |
105 |
+index cb8158d..c928ccf 100644 |
106 |
+--- a/src/solver/opamCudf.mli |
107 |
++++ b/src/solver/opamCudf.mli |
108 |
+@@ -24,7 +24,7 @@ module Map: OpamStd.MAP with type key = Cudf.package |
109 |
+ module Graph: sig |
110 |
+ (** Graph of cudf packages *) |
111 |
+ |
112 |
+- include module type of Algo.Defaultgraphs.PackageGraph.G |
113 |
++ include module type of Dose_algo.Defaultgraphs.PackageGraph.G |
114 |
+ |
115 |
+ (** Build a graph from a CUDF universe. Warning: dependency edges are towards |
116 |
+ the dependency, which is the reverse of what happens in the action |
117 |
+@@ -180,7 +180,7 @@ val string_of_vpkgs: Cudf_types.vpkg list -> string |
118 |
+ |
119 |
+ val make_conflicts: |
120 |
+ version_map:int package_map -> Cudf.universe -> |
121 |
+- Algo.Diagnostic.diagnosis -> ('a, conflict) result |
122 |
++ Dose_algo.Diagnostic.diagnosis -> ('a, conflict) result |
123 |
+ val cycle_conflict: |
124 |
+ version_map:int package_map -> Cudf.universe -> |
125 |
+ string list list -> ('a, conflict) result |
126 |
+diff --git a/src/solver/opamCudfSolver.ml b/src/solver/opamCudfSolver.ml |
127 |
+index 03486f1..2651373 100644 |
128 |
+--- a/src/solver/opamCudfSolver.ml |
129 |
++++ b/src/solver/opamCudfSolver.ml |
130 |
+@@ -57,7 +57,7 @@ let call_external_solver command ~criteria ?timeout (_, universe,_ as cudf) = |
131 |
+ in |
132 |
+ OpamFilename.remove solver_in; |
133 |
+ if not (OpamFilename.exists solver_out) then |
134 |
+- raise (Common.CudfSolver.Error "no output") |
135 |
++ raise (Dose_common.CudfSolver.Error "no output") |
136 |
+ else if |
137 |
+ (let ic = OpamFilename.open_in solver_out in |
138 |
+ try |
139 |
+@@ -65,7 +65,7 @@ let call_external_solver command ~criteria ?timeout (_, universe,_ as cudf) = |
140 |
+ i = "FAIL" |
141 |
+ with End_of_file -> close_in ic; false) |
142 |
+ then |
143 |
+- raise Common.CudfSolver.Unsat |
144 |
++ raise Dose_common.CudfSolver.Unsat |
145 |
+ else |
146 |
+ let r = |
147 |
+ Cudf_parser.load_solution_from_file |
148 |
+diff --git a/src/solver/opamSolver.ml b/src/solver/opamSolver.ml |
149 |
+index 3748e75..bbf995f 100644 |
150 |
+--- a/src/solver/opamSolver.ml |
151 |
++++ b/src/solver/opamSolver.ml |
152 |
+@@ -9,6 +9,8 @@ |
153 |
+ (* *) |
154 |
+ (**************************************************************************) |
155 |
+ |
156 |
++module Algo = Dose_algo |
157 |
++ |
158 |
+ open OpamTypes |
159 |
+ open OpamTypesBase |
160 |
+ open OpamPackage.Set.Op |
161 |
+@@ -84,7 +86,7 @@ let cudf_versions_map universe packages = |
162 |
+ pmap OpamPackage.Map.empty |
163 |
+ |
164 |
+ let name_to_cudf name = |
165 |
+- Common.CudfAdd.encode (OpamPackage.Name.to_string name) |
166 |
++ Dose_common.CudfAdd.encode (OpamPackage.Name.to_string name) |
167 |
+ |
168 |
+ let constraint_to_cudf version_map name (op,v) = |
169 |
+ let nv = OpamPackage.create name v in |
170 |
|
171 |
diff --git a/dev-ml/opam-installer/opam-installer-2.0.8-r3.ebuild b/dev-ml/opam-installer/opam-installer-2.0.8-r3.ebuild |
172 |
new file mode 100644 |
173 |
index 00000000000..7bd84a692fe |
174 |
--- /dev/null |
175 |
+++ b/dev-ml/opam-installer/opam-installer-2.0.8-r3.ebuild |
176 |
@@ -0,0 +1,45 @@ |
177 |
+# Copyright 1999-2021 Gentoo Authors |
178 |
+# Distributed under the terms of the GNU General Public License v2 |
179 |
+ |
180 |
+EAPI=7 |
181 |
+ |
182 |
+# We are opam |
183 |
+OPAM_INSTALLER_DEP=" " |
184 |
+OPAM_SKIP_VALIDATION=yes |
185 |
+inherit opam |
186 |
+ |
187 |
+DESCRIPTION="Core installer for opam packages" |
188 |
+HOMEPAGE="https://opam.ocaml.org/ https://github.com/ocaml/opam" |
189 |
+SRC_URI="https://github.com/ocaml/opam/releases/download/${PV}/opam-full-${PV}.tar.gz" |
190 |
+S="${WORKDIR}/opam-full-${PV/_/-}" |
191 |
+OPAM_INSTALLER="${S}/opam-installer" |
192 |
+ |
193 |
+LICENSE="LGPL-2.1" |
194 |
+SLOT="0/${PV}" |
195 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" |
196 |
+ |
197 |
+# Cherry-picked from https://deb.debian.org/debian/pool/main/o/opam/opam_2.0.8-1.debian.tar.xz |
198 |
+PATCHES=( "${FILESDIR}/debian-Port-to-Dose3-6.0.1.patch" ) |
199 |
+ |
200 |
+RDEPEND=" |
201 |
+ >=dev-lang/ocaml-4.02.3 |
202 |
+ dev-ml/cmdliner:= |
203 |
+ ~dev-ml/opam-format-${PV} |
204 |
+" |
205 |
+DEPEND="${RDEPEND} |
206 |
+ dev-ml/findlib" |
207 |
+ |
208 |
+src_configure() { |
209 |
+ econf \ |
210 |
+ --prefix="${EPREFIX}/usr" \ |
211 |
+ --with-mccs \ |
212 |
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \ |
213 |
+ --mandir="${EPREFIX}/usr/share/man" |
214 |
+} |
215 |
+ |
216 |
+src_compile() { |
217 |
+ sed -e 's/DUNE = .*$/DUNE = /' -i Makefile.config |
218 |
+ #passing -jX to the dune build leads to errors |
219 |
+ #see: https://github.com/ocaml/opam/issues/3585 |
220 |
+ emake DUNE_PROMOTE_ARG="" -j1 |
221 |
+} |