Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: sci-mathematics/mccs/files/, sci-mathematics/mccs/
Date: Thu, 28 Apr 2022 07:45:39
Message-Id: 1651131913.c6c93bbbc8d75d5ee0dff344851c104b477f6cc0.Alessandro-Barbieri@gentoo
1 commit: c6c93bbbc8d75d5ee0dff344851c104b477f6cc0
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Thu Apr 28 07:45:13 2022 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Thu Apr 28 07:45:13 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c6c93bbb
7
8 sci-mathematics/mccs: new package, add 1.1
9
10 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
11
12 sci-mathematics/mccs/Manifest | 2 +
13 sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch | 12 ++++
14 sci-mathematics/mccs/files/mccs-1.1-glpk.patch | 20 ++++++
15 .../mccs/files/mccs-1.1-respect-flags.patch | 12 ++++
16 sci-mathematics/mccs/mccs-1.1.ebuild | 73 ++++++++++++++++++++++
17 sci-mathematics/mccs/metadata.xml | 15 +++++
18 6 files changed, 134 insertions(+)
19
20 diff --git a/sci-mathematics/mccs/Manifest b/sci-mathematics/mccs/Manifest
21 new file mode 100644
22 index 000000000..da9bbea2a
23 --- /dev/null
24 +++ b/sci-mathematics/mccs/Manifest
25 @@ -0,0 +1,2 @@
26 +DIST mccs-1.1-srcs.tgz 65553 BLAKE2B be7a1852bb6adaba6e8e02b1efbed44a1b60ef856facb55ca9a572a6ade77b8f24616feba9ac73a587f81a09c4ea19d1ec25281b49962bfbc2c35dc469cdeb29 SHA512 95cd0af58115202dc1bb8deaae28b25662e06cbbcb195c608a01083d4c602bcc1ede213dbc4e8ece7b9ab4afc9ef419fa57c284602dc0c908595e77710281de4
27 +DIST mccs_1.1-9.debian.tar.xz 7360 BLAKE2B cbd52e4b30db898648348c0b6486c4338bb417b38ff7c982df246c985a017d4064b7816f44fc71df11a11bcc0260c20feb075384e9b8a0d0aa1d16dae7a65b99 SHA512 dcdb6296647748d0a484c48b5ef9fe1e663bf0a54e170e0418b9a7a791d2f7f5d6de20543e2c593721fc6dca2f43f7dc4f0c61b87295b8db96dd58b6bf75d700
28
29 diff --git a/sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch b/sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch
30 new file mode 100644
31 index 000000000..05231563c
32 --- /dev/null
33 +++ b/sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch
34 @@ -0,0 +1,12 @@
35 +diff '--color=auto' -ru /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/makefile mccs-1.1/makefile
36 +--- /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/makefile 2022-04-28 09:30:48.441298635 +0200
37 ++++ mccs-1.1/makefile 2022-04-28 09:36:58.810650226 +0200
38 +@@ -163,7 +163,7 @@
39 + ar rcs libccudf.a $(OBJDIR)/cudf.tab.o $(OBJDIR)/cudf.l.o $(OBJDIR)/cudf_hash_table.o $(OBJDIR)/cudf_tools.o
40 +
41 + libccudf.so: $(OBJDIR)/cudf.tab.o $(OBJDIR)/cudf.l.o $(OBJDIR)/cudf_hash_table.o $(OBJDIR)/cudf_tools.o
42 +- $(CCC) -shared -W1,-soname,libccudf.so -o libccudf.so \
43 ++ $(CCC) -shared -Wl,-soname,libccudf.so -o libccudf.so \
44 + $(OBJDIR)/cudf.tab.o $(OBJDIR)/cudf.l.o $(OBJDIR)/cudf_hash_table.o $(OBJDIR)/cudf_tools.o
45 +
46 + $(OBJDIR)/cudf_hash_table.o: $(SRCLIB)/cudf_hash_table.c $(SRCLIB)/cudf_hash_table.h
47
48 diff --git a/sci-mathematics/mccs/files/mccs-1.1-glpk.patch b/sci-mathematics/mccs/files/mccs-1.1-glpk.patch
49 new file mode 100644
50 index 000000000..55fb1d2c9
51 --- /dev/null
52 +++ b/sci-mathematics/mccs/files/mccs-1.1-glpk.patch
53 @@ -0,0 +1,20 @@
54 +diff '--color=auto' -ru /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/make.local mccs-1.1/make.local
55 +--- /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/make.local 2022-04-28 09:26:16.480900398 +0200
56 ++++ mccs-1.1/make.local 2022-04-28 09:29:29.136724492 +0200
57 +@@ -11,13 +11,13 @@
58 + ifeq ($(USEGLPK),1)
59 +
60 + # Path to GLPK main dir
61 +-GLPKDIR=$(PWD)/../glpk
62 ++GLPKDIR=/usr/lib
63 +
64 + # Path to the GPLK include files
65 +-GLPKINC=$(GLPKDIR)/include/
66 ++GLPKINC=/usr/include
67 +
68 + # GPLK library path and options
69 +-GLPKLD=-L${GLPKDIR}/lib -lglpk -Wl,-rpath,${GLPKDIR}/lib
70 ++GLPKLD=-L${GLPKDIR} -lglpk
71 +
72 + endif
73 +
74
75 diff --git a/sci-mathematics/mccs/files/mccs-1.1-respect-flags.patch b/sci-mathematics/mccs/files/mccs-1.1-respect-flags.patch
76 new file mode 100644
77 index 000000000..11b5454ce
78 --- /dev/null
79 +++ b/sci-mathematics/mccs/files/mccs-1.1-respect-flags.patch
80 @@ -0,0 +1,12 @@
81 +diff '--color=auto' -ru /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/make.local mccs-1.1/make.local
82 +--- a/make.local 2022-04-28 08:46:08.604422769 +0200
83 ++++ b/make.local 2022-04-28 08:47:58.444566394 +0200
84 +@@ -107,7 +107,7 @@
85 +
86 + INC=-I$(OBJDIR) -I$(SRCDIR) -I$(SRCLIB)
87 + #CCCOPT=-g -Wall
88 +-CCCOPT=-Wall -O6
89 ++CCCOPT=-Wall $(CXXFLAGS)
90 + CCC=$(CXX) $(CCCOPT) $(LDFLAGS)
91 +
92 +
93
94 diff --git a/sci-mathematics/mccs/mccs-1.1.ebuild b/sci-mathematics/mccs/mccs-1.1.ebuild
95 new file mode 100644
96 index 000000000..91d76b64d
97 --- /dev/null
98 +++ b/sci-mathematics/mccs/mccs-1.1.ebuild
99 @@ -0,0 +1,73 @@
100 +# Copyright 1999-2022 Gentoo Authors
101 +# Distributed under the terms of the GNU General Public License v2
102 +
103 +EAPI=7
104 +
105 +inherit flag-o-matic optfeature toolchain-funcs
106 +
107 +DESCRIPTION="Multi Criteria CUDF Solver"
108 +HOMEPAGE="https://www.i3s.unice.fr/~cpjm/misc/mccs.html"
109 +SRC_URI="
110 + https://www.i3s.unice.fr/~cpjm/misc/${P}-srcs.tgz
111 + http://deb.debian.org/debian/pool/main/m/mccs/${PN}_${PV}-9.debian.tar.xz
112 +"
113 +
114 +LICENSE="BSD"
115 +SLOT="0"
116 +KEYWORDS="~amd64"
117 +IUSE="glpk lpsolve"
118 +
119 +RDEPEND="
120 + glpk? ( sci-mathematics/glpk )
121 + lpsolve? ( sci-mathematics/lpsolve )
122 +"
123 +DEPEND="${RDEPEND}"
124 +
125 +BDEPEND="
126 + dev-util/quilt
127 + sys-devel/bison
128 + virtual/yacc
129 +"
130 +
131 +src_prepare() {
132 + export QUILT_PATCHES="${WORKDIR}/debian/patches"
133 + export QUILT_SERIES="${QUILT_PATCHES}/series"
134 + quilt push -a || die
135 + eapply "${FILESDIR}/${P}-respect-flags.patch"
136 + eapply "${FILESDIR}/${P}-glpk.patch"
137 + eapply "${FILESDIR}/${P}-fix-Wl.patch"
138 + eapply_user
139 +
140 + if use glpk; then
141 + sed \
142 + -e "s|#USEGLPK=1|USEGLPK=1|g" \
143 + -e "s|GLPKDIR=/usr/lib|GLPKDIR=/usr/$(get_libdir)|g" \
144 + -i make.local || die
145 + fi
146 + if use lpsolve; then
147 + sed -e "s|LPSOLVEDIR=/usr/lib|LPSOLVEDIR=/usr/$(get_libdir)|g" -i make.local || die
148 + else
149 + sed -e "s|USELPSOLVE=1|#USELPSOLVE=1|g" -i make.local || die
150 + fi
151 +}
152 +
153 +src_compile() {
154 + tc-export CXX
155 + append-cxxflags "-std=c++14"
156 + MAKEOPTS="-j1" emake libccudf.so
157 + MAKEOPTS="-j1" emake mccs
158 +}
159 +
160 +src_install() {
161 + dodoc README CHANGES
162 + dodoc -r examples
163 +
164 + dobin sciplp cbclp wbopb mccs
165 + exeinto "/usr/libexec/${PN}"
166 + doexe solve{paranoid,trendy}
167 + dolib.so libccudf.so
168 +}
169 +
170 +pkg_postinst() {
171 + optfeature "in order to use cbclp" sci-libs/coinor-cbc
172 +}
173
174 diff --git a/sci-mathematics/mccs/metadata.xml b/sci-mathematics/mccs/metadata.xml
175 new file mode 100644
176 index 000000000..be6050f22
177 --- /dev/null
178 +++ b/sci-mathematics/mccs/metadata.xml
179 @@ -0,0 +1,15 @@
180 +<?xml version="1.0" encoding="UTF-8"?>
181 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
182 +<pkgmetadata>
183 + <maintainer type="person">
184 + <email>lssndrbarbieri@×××××.com</email>
185 + <name>Alessandro Barbieri</name>
186 + </maintainer>
187 + <use>
188 + <flag name="glpk">enable GLPK as solver</flag>
189 + <flag name="lpsolve">enable lpsolve as solver </flag>
190 + </use>
191 + <longdescription lang="en">
192 +mccs (which stands for Multi Criteria CUDF Solver) is a CUDF problem solver developed at UNS during the European MANCOOSI project. mccs take as input a CUDF problem and computes the best solution according to a set of criteria. It relies on a Integer Programming solver or a Pseudo Boolean solver to achieve its task. mccs can use a wide set of underlying solvers like Cplex, Gurobi, Lpsolver, Glpk, CbC, SCIP or WBO.
193 + </longdescription>
194 +</pkgmetadata>