1 |
commit: 59813a99ec529322787b3769c122b79cc36978c1 |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Apr 28 23:46:59 2022 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Fri Apr 29 01:47:58 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=59813a99 |
7 |
|
8 |
sci-mathematics/packup: new package, add 0.6 |
9 |
|
10 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
11 |
|
12 |
sci-mathematics/packup/Manifest | 3 + |
13 |
sci-mathematics/packup/files/packup | 3 + |
14 |
.../packup/files/packup-0.6-c++11.patch | 166 +++++++++++++++++++++ |
15 |
.../packup/files/packup-0.6-makefile.patch | 49 ++++++ |
16 |
.../files/packup-0.6-minisat+-invocation.patch | 14 ++ |
17 |
.../packup/files/packup-0.6-spelling.patch | 14 ++ |
18 |
sci-mathematics/packup/metadata.xml | 11 ++ |
19 |
sci-mathematics/packup/packup-0.6.ebuild | 53 +++++++ |
20 |
8 files changed, 313 insertions(+) |
21 |
|
22 |
diff --git a/sci-mathematics/packup/Manifest b/sci-mathematics/packup/Manifest |
23 |
new file mode 100644 |
24 |
index 000000000..6f8e7b3d7 |
25 |
--- /dev/null |
26 |
+++ b/sci-mathematics/packup/Manifest |
27 |
@@ -0,0 +1,3 @@ |
28 |
+DIST packup-0.6.1 3539 BLAKE2B 5a98a7a8f9fb760cd394058a0e3b8295a664b9d1c70cd32f6edac20d236c167acfa953c70f2dd8e43de7b7be2f1fc8ade2f1175a6fb4526112bc994237b0d434 SHA512 8b2dab50f1f92c601e4e77fe477e7fef4fd08764cd793f910fe9abe8f18f7dcbc22d4513fa75a125b8f90f32faf3b6bd6d257a9301072046ddd351c436645299 |
29 |
+DIST packup-0.6.1.html 6480 BLAKE2B 26fe09b83e7fe55c088163124e3241894d8cad2ee9ca87d56ef17a878655448fc62182bc80cf66f7595861477f4fd17a4ea330a485d9970e36466ef7a10bff06 SHA512 8d8f66250db548e5d5291ea5670349efe7195ff25703e2a47dd76adba0bfa3074a01d0c22b0e9b27285b6116d057190b6ebb48c3dc21cc9cd132e2e6ef3741b7 |
30 |
+DIST packup-0.6.tgz 86457 BLAKE2B d7a7540a9d46ab09500ef71862ade6484dc2fc19df0dab8be0b017a53102843539640a2ec6838cb551f4bdf77abede83abb05bd87271c506f5b5b41093278409 SHA512 8aa396f7f53f8ea3eba086df6ab1c4c685277e8fe947d90431d7cc9b70dd04c20771277b92c770e6766a633dfb8e75b36188c706c9cbae31e4afeff85ee60814 |
31 |
|
32 |
diff --git a/sci-mathematics/packup/files/packup b/sci-mathematics/packup/files/packup |
33 |
new file mode 100644 |
34 |
index 000000000..793e1b91d |
35 |
--- /dev/null |
36 |
+++ b/sci-mathematics/packup/files/packup |
37 |
@@ -0,0 +1,3 @@ |
38 |
+description: CUDF solver based on the Pseudo-Boolean Constraint solver MiniSat+ |
39 |
+exec: /usr/bin/packup -u $pref $in $out |
40 |
+cudf-version: 2.0 |
41 |
|
42 |
diff --git a/sci-mathematics/packup/files/packup-0.6-c++11.patch b/sci-mathematics/packup/files/packup-0.6-c++11.patch |
43 |
new file mode 100644 |
44 |
index 000000000..1c894f361 |
45 |
--- /dev/null |
46 |
+++ b/sci-mathematics/packup/files/packup-0.6-c++11.patch |
47 |
@@ -0,0 +1,166 @@ |
48 |
+Author: Mikoláš Janota <mikolas.janota@×××××.com> |
49 |
+Description: compliance to the C++11 standard |
50 |
+Debian-bug: #811793 |
51 |
+ |
52 |
+--- a/basic_clset.hh |
53 |
++++ b/basic_clset.hh |
54 |
+@@ -34,11 +34,7 @@ |
55 |
+ #include <cmath> |
56 |
+ #include <vector> |
57 |
+ |
58 |
+-#include <ext/hash_map> // Location of STL hash extensions |
59 |
+-#include <ext/hash_set> // Location of STL hash extensions |
60 |
+- |
61 |
+ using namespace std; |
62 |
+-using namespace __gnu_cxx; // Required for STL hash extensions |
63 |
+ |
64 |
+ #include "globals.hh" |
65 |
+ #include "basic_clause.hh" |
66 |
+--- a/cl_globals.hh |
67 |
++++ b/cl_globals.hh |
68 |
+@@ -34,11 +34,7 @@ |
69 |
+ #include <cmath> |
70 |
+ #include <vector> |
71 |
+ |
72 |
+-#include <ext/hash_map> // Location of STL hash extensions |
73 |
+-#include <ext/hash_set> // Location of STL hash extensions |
74 |
+- |
75 |
+ using namespace std; |
76 |
+-using namespace __gnu_cxx; // Required for STL hash extensions |
77 |
+ |
78 |
+ #include "globals.hh" |
79 |
+ #include "basic_clause.hh" |
80 |
+--- a/cl_registry.hh |
81 |
++++ b/cl_registry.hh |
82 |
+@@ -34,8 +34,6 @@ |
83 |
+ #include <cmath> |
84 |
+ #include <vector> |
85 |
+ |
86 |
+-#include <ext/hash_map> // Location of STL hash extensions |
87 |
+-#include <ext/hash_set> // Location of STL hash extensions |
88 |
+ #include <ext/algorithm> // Location of STL hash extensions |
89 |
+ |
90 |
+ using namespace std; |
91 |
+--- a/cl_types.hh |
92 |
++++ b/cl_types.hh |
93 |
+@@ -66,7 +66,7 @@ |
94 |
+ typedef vector<BasicClause*> BasicClauseVector; |
95 |
+ typedef BasicClauseVector::iterator ClVectIterator; |
96 |
+ |
97 |
+-typedef slist<BasicClause*> BasicClauseSList; |
98 |
++//typedef slist<BasicClause*> BasicClauseSList; |
99 |
+ |
100 |
+ typedef list<BasicClause*> BasicClauseList; |
101 |
+ |
102 |
+--- a/collections.hh |
103 |
++++ b/collections.hh |
104 |
+@@ -34,7 +34,7 @@ |
105 |
+ typedef vector<PackageVersions> PackageVersionsList; |
106 |
+ typedef vector<PackageVersionsList*> PackageVersionsCNF; |
107 |
+ typedef vector<PackageVersion> PackageVersionList; |
108 |
+-typedef unordered_map< const char*,string,__gnu_cxx::hash<const char*>, streq > Str2Str; |
109 |
++typedef unordered_map< const char*,string,std::hash<const char*>, streq > Str2Str; |
110 |
+ typedef unordered_map<PackageVersion, Variable, hash_package_version, eq_package_version> PackageVersionMap; |
111 |
+ typedef unordered_map<Variable,PackageVersion> VariableToPackageVersion; |
112 |
+ typedef vector<Version> VersionVector; |
113 |
+--- a/common_types.hh |
114 |
++++ b/common_types.hh |
115 |
+@@ -25,13 +25,9 @@ |
116 |
+ #ifndef COMMON_TYPES_H |
117 |
+ #define COMMON_TYPES_H |
118 |
+ |
119 |
+-#include <ext/hash_set> |
120 |
+-#include <ext/hash_map> |
121 |
++#include "hash_structs.hh" |
122 |
+ #include <string.h> |
123 |
+ #include "types.hh" |
124 |
+-using __gnu_cxx::hash; |
125 |
+-using __gnu_cxx::hash_map; |
126 |
+-using __gnu_cxx::hash_set; |
127 |
+ using std::string; |
128 |
+ using std::vector; |
129 |
+ using std::ostream; |
130 |
+@@ -40,8 +36,6 @@ |
131 |
+ #define CONSTANT const |
132 |
+ #define CONTAINS(s,e) ( ((s).find(e))!=(s).end() ) |
133 |
+ #define SAME_PACKAGE_NAME(n1,n2) (n1.data()==n2.data()) |
134 |
+-#define unordered_set hash_set |
135 |
+-#define unordered_map hash_map |
136 |
+ |
137 |
+ typedef unsigned int UINT; |
138 |
+ typedef UINT Version; |
139 |
+@@ -115,6 +109,7 @@ |
140 |
+ {return strcmp(s1, s2) == 0;} |
141 |
+ }; |
142 |
+ |
143 |
++/* |
144 |
+ namespace __gnu_cxx |
145 |
+ { |
146 |
+ template<> |
147 |
+@@ -126,7 +121,9 @@ |
148 |
+ return h(s.data()); |
149 |
+ } |
150 |
+ }; |
151 |
+-} /*end of namespace __gnu_cxx */ |
152 |
++}*/ /*end of namespace __gnu_cxx */ |
153 |
++ |
154 |
++ |
155 |
+ |
156 |
+ const char* to_string (KeepValue value); |
157 |
+ const char* to_string (Criterion value); |
158 |
+--- a/cudf_msu.cc |
159 |
++++ b/cudf_msu.cc |
160 |
+@@ -27,8 +27,9 @@ |
161 |
+ #include "Options.hh" |
162 |
+ using std::ifstream; |
163 |
+ |
164 |
+-static const char* dist_date = ""DISTDATE""; |
165 |
+-static const char* changeset = ""CHANGESET""; |
166 |
++#define stringify(s) #s |
167 |
++static const char* dist_date = stringify(DISTDATE); |
168 |
++static const char* changeset = stringify(CHANGESET); |
169 |
+ static const char* release = "0.6"; |
170 |
+ |
171 |
+ IDManager id_manager; |
172 |
+--- a/hash_structs.hh |
173 |
++++ b/hash_structs.hh |
174 |
+@@ -0,0 +1,12 @@ |
175 |
++#ifndef HASH_STRUCTS_123 |
176 |
++#define HASH_STRUCTS_123 |
177 |
++ |
178 |
++#include <unordered_set> |
179 |
++#include <unordered_map> |
180 |
++#define hash_multimap unordered_multimap |
181 |
++#define hash_set unordered_set |
182 |
++#define hash_map unordered_map |
183 |
++using std::hash; |
184 |
++using std::unordered_map; |
185 |
++using std::unordered_set; |
186 |
++#endif |
187 |
+--- a/types.hh |
188 |
++++ b/types.hh |
189 |
+@@ -38,6 +38,12 @@ |
190 |
+ |
191 |
+ using namespace std; |
192 |
+ |
193 |
++#include <unordered_set> |
194 |
++#include <unordered_map> |
195 |
++#define hash_multimap unordered_multimap |
196 |
++#define hash_set unordered_set |
197 |
++#define hash_map unordered_map |
198 |
++ |
199 |
+ |
200 |
+ /*----------------------------------------------------------------------------*\ |
201 |
+ * Values besides 0 and 1 |
202 |
+@@ -158,11 +164,8 @@ |
203 |
+ #include <map> |
204 |
+ #include <set> |
205 |
+ #include <ext/slist> // Location of STL list extensions |
206 |
+-#include <ext/hash_map> // Location of STL hash extensions |
207 |
+-#include <ext/hash_set> // Location of STL hash extensions |
208 |
+ |
209 |
+ using namespace std; |
210 |
+-using namespace __gnu_cxx; // Required for STL hash extensions |
211 |
+ |
212 |
+ |
213 |
+ #ifdef USE_RBTREE_SETS |
214 |
|
215 |
diff --git a/sci-mathematics/packup/files/packup-0.6-makefile.patch b/sci-mathematics/packup/files/packup-0.6-makefile.patch |
216 |
new file mode 100644 |
217 |
index 000000000..8c715edf3 |
218 |
--- /dev/null |
219 |
+++ b/sci-mathematics/packup/files/packup-0.6-makefile.patch |
220 |
@@ -0,0 +1,49 @@ |
221 |
+--- a/Makefile |
222 |
++++ b/Makefile |
223 |
+@@ -13,18 +13,18 @@ |
224 |
+ LIBD = |
225 |
+ LIBS = |
226 |
+ CXX?=g++ |
227 |
+-CFLAGS+=-DEXTERNAL_SOLVER |
228 |
+-CFLAGS+=-DNDEBUG -DNCHECK |
229 |
+-CFLAGS+=-O3 |
230 |
+-CFLAGS += -Wall -DBUILDDATE='"$(BUILDDATE)"' -DDISTDATE='"$(DISTDATE)"' |
231 |
+-CFLAGS += -DCHANGESET='"$(CHANGESET)"' -DRELDATE='"$(RELDATE)"' |
232 |
+-CFLAGS+=-D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -Wno-parentheses -Wno-deprecated |
233 |
++CXXFLAGS+=-DEXTERNAL_SOLVER |
234 |
++CXXFLAGS+=-DNDEBUG -DNCHECK |
235 |
++CXXFLAGS+=-std=c++11 |
236 |
++CXXFLAGS += -Wall -DBUILDDATE='"$(BUILDDATE)"' -DDISTDATE='"$(DISTDATE)"' |
237 |
++CXXFLAGS += -DCHANGESET='"$(CHANGESET)"' -DRELDATE='"$(RELDATE)"' |
238 |
++CXXFLAGS+=-D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -Wno-parentheses -Wno-deprecated |
239 |
+ LIBS+=-lz |
240 |
+ #LNFLAGS+=-static |
241 |
+ |
242 |
+ # comment out if arbitrary precision not needed |
243 |
+ LIBS+=-lgmpxx -lgmp |
244 |
+-CFLAGS+=-DGMPDEF |
245 |
++CXXFLAGS+=-DGMPDEF |
246 |
+ |
247 |
+ .PHONY: build all objs |
248 |
+ |
249 |
+@@ -32,17 +32,17 @@ |
250 |
+ |
251 |
+ $(XTRGT): objs |
252 |
+ @echo Linking: $@ |
253 |
+- @$(CXX) $(COBJS) $(LNFLAGS) $(LIBD) $(LIBS) -o $@ |
254 |
++ @$(CXX) $(CXXFLAGS) -fPIE $(CPPFLAGS) $(COBJS) $(LDFLAGS) $(LIBD) $(LIBS) -o $@ |
255 |
+ |
256 |
+ objs: Lexer.o p.tab.o $(COBJS) |
257 |
+ |
258 |
+ depend: |
259 |
+- makedepend -- -I. $(CFLAGS) -- *.cc |
260 |
++ makedepend -- -I. $(CXXFLAGS) -- *.cc |
261 |
+ |
262 |
+ ## Build rule |
263 |
+ %.o: %.cc |
264 |
+ @echo Compiling: $@ |
265 |
+- @$(CXX) -I. $(CFLAGS) -c -o $@ $< |
266 |
++ @$(CXX) -I. $(CPPFLAGS) $(CXXFLAGS) -fPIC $(LDFLAGS) -c -o $@ $< |
267 |
+ |
268 |
+ ## This needs bison and ragel, comment in if parsing changes |
269 |
+ #Lexer.cc: p.tab.cc l.rl Lexer.hh |
270 |
|
271 |
diff --git a/sci-mathematics/packup/files/packup-0.6-minisat+-invocation.patch b/sci-mathematics/packup/files/packup-0.6-minisat+-invocation.patch |
272 |
new file mode 100644 |
273 |
index 000000000..8420fd173 |
274 |
--- /dev/null |
275 |
+++ b/sci-mathematics/packup/files/packup-0.6-minisat+-invocation.patch |
276 |
@@ -0,0 +1,14 @@ |
277 |
+Author: Ralf Treinen <treinen@××××××.org> |
278 |
+Description: invoke minisat+ with switch for old-format input |
279 |
+ |
280 |
+--- a/ExternalWrapper.cc |
281 |
++++ b/ExternalWrapper.cc |
282 |
+@@ -33,7 +33,7 @@ |
283 |
+ :min_cost(LONG_MAX) |
284 |
+ ,solution_value (-1) |
285 |
+ ,_id_manager(id_manager) |
286 |
+-,solver_command("minisat+ -cs -ansi") |
287 |
++,solver_command("minisat+ -cs -ansi -old-fmt") |
288 |
+ ,multiplication_string("*") |
289 |
+ ,temporary_directory("/tmp") |
290 |
+ ,leave_temporary_files(false) |
291 |
|
292 |
diff --git a/sci-mathematics/packup/files/packup-0.6-spelling.patch b/sci-mathematics/packup/files/packup-0.6-spelling.patch |
293 |
new file mode 100644 |
294 |
index 000000000..6022f894f |
295 |
--- /dev/null |
296 |
+++ b/sci-mathematics/packup/files/packup-0.6-spelling.patch |
297 |
@@ -0,0 +1,14 @@ |
298 |
+Author: Ralf Treinen <treinen@××××××.org> |
299 |
+Description: Fix spelling in message |
300 |
+ |
301 |
+--- a/Encoder.cc |
302 |
++++ b/Encoder.cc |
303 |
+@@ -2123,7 +2123,7 @@ |
304 |
+ } |
305 |
+ |
306 |
+ void Encoder::check_solution() { |
307 |
+- cerr << "cheking solution" <<endl; |
308 |
++ cerr << "checking solution" <<endl; |
309 |
+ // Package dependencies |
310 |
+ FOR_EACH(PackageUnits::const_iterator,i,needed_units) { |
311 |
+ CONSTANT UnitVector &uv = *(i->second); |
312 |
|
313 |
diff --git a/sci-mathematics/packup/metadata.xml b/sci-mathematics/packup/metadata.xml |
314 |
new file mode 100644 |
315 |
index 000000000..981b9c9d3 |
316 |
--- /dev/null |
317 |
+++ b/sci-mathematics/packup/metadata.xml |
318 |
@@ -0,0 +1,11 @@ |
319 |
+<?xml version="1.0" encoding="UTF-8"?> |
320 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
321 |
+<pkgmetadata> |
322 |
+ <maintainer type="person"> |
323 |
+ <email>lssndrbarbieri@×××××.com</email> |
324 |
+ <name>Alessandro Barbieri</name> |
325 |
+ </maintainer> |
326 |
+ <longdescription lang="en"> |
327 |
+packup solves the package upgradability problem specified in CUDF [TZ09] with the use of an external solver. By default minisat+ [ES06] is used but a different solver can be used by specifying the pertaining command line option. |
328 |
+ </longdescription> |
329 |
+</pkgmetadata> |
330 |
|
331 |
diff --git a/sci-mathematics/packup/packup-0.6.ebuild b/sci-mathematics/packup/packup-0.6.ebuild |
332 |
new file mode 100644 |
333 |
index 000000000..a7fdd5e9b |
334 |
--- /dev/null |
335 |
+++ b/sci-mathematics/packup/packup-0.6.ebuild |
336 |
@@ -0,0 +1,53 @@ |
337 |
+# Copyright 1999-2022 Gentoo Authors |
338 |
+# Distributed under the terms of the GNU General Public License v2 |
339 |
+ |
340 |
+EAPI=8 |
341 |
+ |
342 |
+inherit optfeature toolchain-funcs |
343 |
+ |
344 |
+DESCRIPTION="PACKage Upgradability Problem solver" |
345 |
+HOMEPAGE="https://sat.inesc-id.pt/~mikolas/sw/packup/" |
346 |
+SRC_URI=" |
347 |
+ https://sat.inesc-id.pt/~mikolas/sw/${PN}/${P}.tgz |
348 |
+ https://sat.inesc-id.pt/~mikolas/sw/${PN}/${P}.1 |
349 |
+ https://sat.inesc-id.pt/~mikolas/sw/${PN}/${P}.1.html |
350 |
+" |
351 |
+ |
352 |
+LICENSE="GPL-3+" |
353 |
+SLOT="0" |
354 |
+KEYWORDS="~amd64" |
355 |
+ |
356 |
+RDEPEND=" |
357 |
+ dev-libs/gmp |
358 |
+ sys-libs/zlib |
359 |
+" |
360 |
+DEPEND=" |
361 |
+ ${RDEPEND} |
362 |
+ sci-mathematics/minisat+ |
363 |
+" |
364 |
+ |
365 |
+PATCHES=( |
366 |
+ "${FILESDIR}/${P}-makefile.patch" |
367 |
+ "${FILESDIR}/${P}-spelling.patch" |
368 |
+ "${FILESDIR}/${P}-c++11.patch" |
369 |
+ "${FILESDIR}/${P}-minisat+-invocation.patch" |
370 |
+) |
371 |
+ |
372 |
+src_compile() { |
373 |
+ tc-export CXX |
374 |
+ emake all |
375 |
+} |
376 |
+ |
377 |
+src_install() { |
378 |
+ dobin packup |
379 |
+ dodoc README.txt |
380 |
+ docinto html |
381 |
+ dodoc "${DISTDIR}/${P}.1.html" |
382 |
+ doman "${DISTDIR}/${P}.1" |
383 |
+ insinto /usr/share/cudf/solvers |
384 |
+ doins "${FILESDIR}/packup" |
385 |
+} |
386 |
+ |
387 |
+pkg_postinst() { |
388 |
+ optfeature "optional solver minisatp" sci-mathematics/minisatp |
389 |
+} |