From c6c93bbbc8d75d5ee0dff344851c104b477f6cc0 Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Thu, 28 Apr 2022 09:45:13 +0200 Subject: [PATCH] sci-mathematics/mccs: new package, add 1.1 Signed-off-by: Alessandro Barbieri --- sci-mathematics/mccs/Manifest | 2 + .../mccs/files/mccs-1.1-fix-Wl.patch | 12 +++ .../mccs/files/mccs-1.1-glpk.patch | 20 +++++ .../mccs/files/mccs-1.1-respect-flags.patch | 12 +++ sci-mathematics/mccs/mccs-1.1.ebuild | 73 +++++++++++++++++++ sci-mathematics/mccs/metadata.xml | 15 ++++ 6 files changed, 134 insertions(+) create mode 100644 sci-mathematics/mccs/Manifest create mode 100644 sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch create mode 100644 sci-mathematics/mccs/files/mccs-1.1-glpk.patch create mode 100644 sci-mathematics/mccs/files/mccs-1.1-respect-flags.patch create mode 100644 sci-mathematics/mccs/mccs-1.1.ebuild create mode 100644 sci-mathematics/mccs/metadata.xml diff --git a/sci-mathematics/mccs/Manifest b/sci-mathematics/mccs/Manifest new file mode 100644 index 0000000000..da9bbea2a6 --- /dev/null +++ b/sci-mathematics/mccs/Manifest @@ -0,0 +1,2 @@ +DIST mccs-1.1-srcs.tgz 65553 BLAKE2B be7a1852bb6adaba6e8e02b1efbed44a1b60ef856facb55ca9a572a6ade77b8f24616feba9ac73a587f81a09c4ea19d1ec25281b49962bfbc2c35dc469cdeb29 SHA512 95cd0af58115202dc1bb8deaae28b25662e06cbbcb195c608a01083d4c602bcc1ede213dbc4e8ece7b9ab4afc9ef419fa57c284602dc0c908595e77710281de4 +DIST mccs_1.1-9.debian.tar.xz 7360 BLAKE2B cbd52e4b30db898648348c0b6486c4338bb417b38ff7c982df246c985a017d4064b7816f44fc71df11a11bcc0260c20feb075384e9b8a0d0aa1d16dae7a65b99 SHA512 dcdb6296647748d0a484c48b5ef9fe1e663bf0a54e170e0418b9a7a791d2f7f5d6de20543e2c593721fc6dca2f43f7dc4f0c61b87295b8db96dd58b6bf75d700 diff --git a/sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch b/sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch new file mode 100644 index 0000000000..05231563c6 --- /dev/null +++ b/sci-mathematics/mccs/files/mccs-1.1-fix-Wl.patch @@ -0,0 +1,12 @@ +diff '--color=auto' -ru /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/makefile mccs-1.1/makefile +--- /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/makefile 2022-04-28 09:30:48.441298635 +0200 ++++ mccs-1.1/makefile 2022-04-28 09:36:58.810650226 +0200 +@@ -163,7 +163,7 @@ + ar rcs libccudf.a $(OBJDIR)/cudf.tab.o $(OBJDIR)/cudf.l.o $(OBJDIR)/cudf_hash_table.o $(OBJDIR)/cudf_tools.o + + libccudf.so: $(OBJDIR)/cudf.tab.o $(OBJDIR)/cudf.l.o $(OBJDIR)/cudf_hash_table.o $(OBJDIR)/cudf_tools.o +- $(CCC) -shared -W1,-soname,libccudf.so -o libccudf.so \ ++ $(CCC) -shared -Wl,-soname,libccudf.so -o libccudf.so \ + $(OBJDIR)/cudf.tab.o $(OBJDIR)/cudf.l.o $(OBJDIR)/cudf_hash_table.o $(OBJDIR)/cudf_tools.o + + $(OBJDIR)/cudf_hash_table.o: $(SRCLIB)/cudf_hash_table.c $(SRCLIB)/cudf_hash_table.h diff --git a/sci-mathematics/mccs/files/mccs-1.1-glpk.patch b/sci-mathematics/mccs/files/mccs-1.1-glpk.patch new file mode 100644 index 0000000000..55fb1d2c9d --- /dev/null +++ b/sci-mathematics/mccs/files/mccs-1.1-glpk.patch @@ -0,0 +1,20 @@ +diff '--color=auto' -ru /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/make.local mccs-1.1/make.local +--- /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/make.local 2022-04-28 09:26:16.480900398 +0200 ++++ mccs-1.1/make.local 2022-04-28 09:29:29.136724492 +0200 +@@ -11,13 +11,13 @@ + ifeq ($(USEGLPK),1) + + # Path to GLPK main dir +-GLPKDIR=$(PWD)/../glpk ++GLPKDIR=/usr/lib + + # Path to the GPLK include files +-GLPKINC=$(GLPKDIR)/include/ ++GLPKINC=/usr/include + + # GPLK library path and options +-GLPKLD=-L${GLPKDIR}/lib -lglpk -Wl,-rpath,${GLPKDIR}/lib ++GLPKLD=-L${GLPKDIR} -lglpk + + endif + diff --git a/sci-mathematics/mccs/files/mccs-1.1-respect-flags.patch b/sci-mathematics/mccs/files/mccs-1.1-respect-flags.patch new file mode 100644 index 0000000000..11b5454ce5 --- /dev/null +++ b/sci-mathematics/mccs/files/mccs-1.1-respect-flags.patch @@ -0,0 +1,12 @@ +diff '--color=auto' -ru /var/tmp/portage/sci-mathematics/mccs-1.1/work/mccs-1.1/make.local mccs-1.1/make.local +--- a/make.local 2022-04-28 08:46:08.604422769 +0200 ++++ b/make.local 2022-04-28 08:47:58.444566394 +0200 +@@ -107,7 +107,7 @@ + + INC=-I$(OBJDIR) -I$(SRCDIR) -I$(SRCLIB) + #CCCOPT=-g -Wall +-CCCOPT=-Wall -O6 ++CCCOPT=-Wall $(CXXFLAGS) + CCC=$(CXX) $(CCCOPT) $(LDFLAGS) + + diff --git a/sci-mathematics/mccs/mccs-1.1.ebuild b/sci-mathematics/mccs/mccs-1.1.ebuild new file mode 100644 index 0000000000..91d76b64d4 --- /dev/null +++ b/sci-mathematics/mccs/mccs-1.1.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic optfeature toolchain-funcs + +DESCRIPTION="Multi Criteria CUDF Solver" +HOMEPAGE="https://www.i3s.unice.fr/~cpjm/misc/mccs.html" +SRC_URI=" + https://www.i3s.unice.fr/~cpjm/misc/${P}-srcs.tgz + http://deb.debian.org/debian/pool/main/m/mccs/${PN}_${PV}-9.debian.tar.xz +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="glpk lpsolve" + +RDEPEND=" + glpk? ( sci-mathematics/glpk ) + lpsolve? ( sci-mathematics/lpsolve ) +" +DEPEND="${RDEPEND}" + +BDEPEND=" + dev-util/quilt + sys-devel/bison + virtual/yacc +" + +src_prepare() { + export QUILT_PATCHES="${WORKDIR}/debian/patches" + export QUILT_SERIES="${QUILT_PATCHES}/series" + quilt push -a || die + eapply "${FILESDIR}/${P}-respect-flags.patch" + eapply "${FILESDIR}/${P}-glpk.patch" + eapply "${FILESDIR}/${P}-fix-Wl.patch" + eapply_user + + if use glpk; then + sed \ + -e "s|#USEGLPK=1|USEGLPK=1|g" \ + -e "s|GLPKDIR=/usr/lib|GLPKDIR=/usr/$(get_libdir)|g" \ + -i make.local || die + fi + if use lpsolve; then + sed -e "s|LPSOLVEDIR=/usr/lib|LPSOLVEDIR=/usr/$(get_libdir)|g" -i make.local || die + else + sed -e "s|USELPSOLVE=1|#USELPSOLVE=1|g" -i make.local || die + fi +} + +src_compile() { + tc-export CXX + append-cxxflags "-std=c++14" + MAKEOPTS="-j1" emake libccudf.so + MAKEOPTS="-j1" emake mccs +} + +src_install() { + dodoc README CHANGES + dodoc -r examples + + dobin sciplp cbclp wbopb mccs + exeinto "/usr/libexec/${PN}" + doexe solve{paranoid,trendy} + dolib.so libccudf.so +} + +pkg_postinst() { + optfeature "in order to use cbclp" sci-libs/coinor-cbc +} diff --git a/sci-mathematics/mccs/metadata.xml b/sci-mathematics/mccs/metadata.xml new file mode 100644 index 0000000000..be6050f224 --- /dev/null +++ b/sci-mathematics/mccs/metadata.xml @@ -0,0 +1,15 @@ + + + + + lssndrbarbieri@gmail.com + Alessandro Barbieri + + + enable GLPK as solver + enable lpsolve as solver + + +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. + +