GNU bug report logs - #49625
[PATCH WIP] gnu: Add minizinc.

Previous Next

Package: guix-patches;

Reported by: Leo Prikler <leo.prikler <at> student.tugraz.at>

Date: Sun, 18 Jul 2021 19:19:01 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49625 in the body.
You can then email your comments to 49625 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49625; Package guix-patches. (Sun, 18 Jul 2021 19:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Prikler <leo.prikler <at> student.tugraz.at>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 18 Jul 2021 19:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: guix-patches <at> gnu.org
Subject: [PATCH WIP] gnu: Add minizinc.
Date: Sun, 18 Jul 2021 17:03:51 +0200
* gnu/packages/maths.scm (minizinc): New variable.
---
MiniZinc typically wants to be used with the hitherto unpackaged Gecode
(https://www.gecode.org), but getting its RUNPATH correct appears pretty
non-straightforward.  It does however also function with CBC by specifying
‘--solver cbc’.

 gnu/packages/maths.scm | 82 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index b4cf0b5409..dce1b5627f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2837,6 +2837,88 @@ the Cauchy-Schwarz inequality, Stirling's formula, etc.  See the Metamath
 book.")
     (license license:gpl2+)))
 
+(define-public minizinc
+  (package
+    (name "minizinc")
+    (version "2.5.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/MiniZinc/libminizinc")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)
+                         (srfi srfi-1)))
+              (snippet
+               '(begin
+                  ;; Do not advertise proprietary solvers
+                  (with-directory-excursion "cmake/targets"
+                    (let ((targets '("libminizinc_fzn.cmake"
+                                     "libminizinc_gecode.cmake"
+                                     "libminizinc_mip.cmake"
+                                     "libminizinc_nl.cmake"
+                                     "libminizinc_osicbc.cmake"
+                                     "libminizinc_parser.cmake"
+                                     "libmzn.cmake"
+                                     "minizinc.cmake"
+                                     "mzn2doc.cmake")))
+                     (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file (cons* "." ".." targets)))
+                               (scandir ".")))
+                    (substitute* "libmzn.cmake"
+                      (("include\\(cmake/targets/(.*)\\)" all target)
+                       (if (member target targets) all "")))))
+                  (with-directory-excursion "include/minizinc/solvers/MIP"
+                    (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file '("." ".."
+                                                "MIP_osicbc_solverfactory.hh"
+                                                "MIP_osicbc_wrap.hh"
+                                                "MIP_solverinstance.hh"
+                                                "MIP_solverinstance.hpp"
+                                                "MIP_wrap.hh")))
+                               (scandir "."))))
+                  (with-directory-excursion "solvers/MIP"
+                    (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file '("." ".."
+                                                "MIP_osicbc_solverfactory.cpp"
+                                                "MIP_osicbc_wrap.cpp"
+                                                "MIP_solverinstance.cpp"
+                                                "MIP_wrap.cpp")))
+                               (scandir "."))))
+                  (substitute* "CMakeLists.txt"
+                    (("find_package\\(([^ ]*).*\\)" all pkg)
+                     (if (member pkg '("Gecode ""OsiCBC" "Threads"))
+                         all
+                         "")))
+                  ;; TODO: swap out miniz for zlib
+                  #t))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ; no ‘check’ target
+       ))
+    (inputs
+     `(("bison" ,bison)
+       ("flex" ,flex)
+       ("zlib" ,zlib)
+       ;; solvers
+       ("cbc" ,cbc)))
+    (home-page "https://www.minizinc.org")
+    (synopsis "High-level constraint modeling language")
+    (description "MiniZinc is a high-level modeling language for constraint
+satisfaction and optimization problems.  Models are compiled to FlatZinc, a
+language understood by many solvers.")
+    (license license:mpl2.0)))
+
 (define-public mumps
   (package
     (name "mumps")
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49625; Package guix-patches. (Sat, 24 Jul 2021 15:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 49625 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: 49625 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: Add minizinc.
Date: Sat, 24 Jul 2021 17:08:52 +0200
* gnu/packages/maths.scm (minizinc): New variable.
---
 gnu/packages/maths.scm | 130 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 130 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index c052d33214..5f5184c722 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3057,6 +3057,136 @@ the Cauchy-Schwarz inequality, Stirling's formula, etc.  See the Metamath
 book.")
     (license license:gpl2+)))
 
+(define-public minizinc
+  (package
+    (name "minizinc")
+    (version "2.5.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/MiniZinc/libminizinc")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)
+                         (srfi srfi-1)))
+              (snippet
+               '(begin
+                  ;; Do not advertise proprietary solvers
+                  (with-directory-excursion "cmake/targets"
+                    (let ((targets '("libminizinc_fzn.cmake"
+                                     "libminizinc_gecode.cmake"
+                                     "libminizinc_mip.cmake"
+                                     "libminizinc_nl.cmake"
+                                     "libminizinc_osicbc.cmake"
+                                     "libminizinc_parser.cmake"
+                                     "libmzn.cmake"
+                                     "minizinc.cmake"
+                                     "mzn2doc.cmake")))
+                     (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file (cons* "." ".." targets)))
+                               (scandir ".")))
+                    (substitute* "libmzn.cmake"
+                      (("include\\(cmake/targets/(.*)\\)" all target)
+                       (if (member target targets) all "")))))
+                  (with-directory-excursion "include/minizinc/solvers/MIP"
+                    (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file '("." ".."
+                                                "MIP_osicbc_solverfactory.hh"
+                                                "MIP_osicbc_wrap.hh"
+                                                "MIP_solverinstance.hh"
+                                                "MIP_solverinstance.hpp"
+                                                "MIP_wrap.hh")))
+                               (scandir "."))))
+                  (with-directory-excursion "solvers/MIP"
+                    (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file '("." ".."
+                                                "MIP_osicbc_solverfactory.cpp"
+                                                "MIP_osicbc_wrap.cpp"
+                                                "MIP_solverinstance.cpp"
+                                                "MIP_wrap.cpp")))
+                               (scandir "."))))
+                  (substitute* "CMakeLists.txt"
+                    (("find_package\\(([^ ]*).*\\)" all pkg)
+                     (if (member pkg '("Gecode" "OsiCBC" "Threads"))
+                         all
+                         "")))
+                  ;; TODO: swap out miniz for zlib
+                  #t))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ; no ‘check’ target
+       #:modules ((guix build cmake-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-solver-configs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((gecode (assoc-ref inputs "gecode"))
+                   (pkgdatadir (string-append (assoc-ref outputs "out")
+                                                  "/share/minizinc")))
+               (call-with-output-file (string-append pkgdatadir
+                                                     "/Preferences.json")
+                 (lambda (port)
+                   (display "\
+{
+  \"tagDefaults\": [
+    [\"\", \"org.gecode.gecode\"],
+    [\"gecode\", \"org.gecode.gecode\"]
+  ],
+  \"solverDefaults\": []
+}"
+                            port)
+                   (newline port)))
+
+               (mkdir-p (string-append pkgdatadir "/solvers"))
+               (call-with-output-file (string-append pkgdatadir
+                                                     "/solvers/gecode.msc")
+                 (lambda (port)
+                   (format port
+                    "\
+{
+  \"id\": \"org.gecode.gecode\",
+  \"name\": \"Gecode\",
+  \"description\": \"Gecode FlatZinc executable\",
+  \"version\": ~s,
+  \"mznlib\": ~s,
+  \"executable\": ~s,
+  \"supportsMzn\": false,
+  \"supportsFzn\": true,
+  \"needsSolns2Out\": true,
+  \"needsMznExecutable\": false,
+  \"needsStdlibDir\": false,
+  \"isGUIApplication\": false
+}"
+                    (last (string-split gecode #\-))
+                    (string-append gecode "/share/gecode/mznlib")
+                    (string-append gecode "/bin/fzn-gecode"))
+                   (newline port)))))))))
+    (inputs
+     `(("bison" ,bison)
+       ("flex" ,flex)
+       ("zlib" ,zlib)
+       ;; solvers
+       ("cbc" ,cbc)
+       ("gecode" ,gecode)))
+    (home-page "https://www.minizinc.org")
+    (synopsis "High-level constraint modeling language")
+    (description "MiniZinc is a high-level modeling language for constraint
+satisfaction and optimization problems.  Models are compiled to FlatZinc, a
+language understood by many solvers.")
+    (license license:mpl2.0)))
+
 (define-public mumps
   (package
     (name "mumps")
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49625; Package guix-patches. (Sat, 24 Jul 2021 15:12:02 GMT) Full text and rfc822 format available.

Message #11 received at 49625 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: 49625 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add gecode.
Date: Sat, 24 Jul 2021 17:08:51 +0200
* gnu/packages/maths.scm (gecode): New variable.
---
 gnu/packages/maths.scm | 71 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index eeb32d554a..c052d33214 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2008,6 +2008,77 @@ linear and quadratic objectives.  There are limited facilities for nonlinear
 and quadratic objectives using the Simplex algorithm.")
     (license license:epl1.0)))
 
+(define-public gecode
+  (package
+    (name "gecode")
+    (version "6.2.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Gecode/gecode")
+                    (commit (string-append "release-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; delete generated sources
+                  (for-each delete-file
+                            '("gecode/kernel/var-imp.hpp"
+                              "gecode/kernel/var-type.hpp"))))))
+    (outputs '("out" "examples"))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list (string-append "GLDFLAGS=-Wl,-rpath="
+                            (assoc-ref %outputs "out")
+                            "/lib")
+             "--enable-examples=no")
+       #:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (ice-9 rdelim)
+                  (ice-9 popen))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'build 'build-examples
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "make" "compileexamples")))
+         ;; The Makefile disrespects GLDFLAGS for some reason, so we have to
+         ;; patch it ourselves... *sigh*
+         (add-after 'install 'fix-rpath
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
+               (for-each
+                (lambda (file)
+                  (let* ((pipe (open-pipe* OPEN_READ "patchelf"
+                                          "--print-rpath" file))
+                         (line (read-line pipe)))
+                    (and (zero? (close-pipe pipe))
+                         (invoke "patchelf" "--set-rpath"
+                                 (string-append libdir ":" line)
+                                 file))))
+                (find-files libdir ".*\\.so$")))))
+         (add-after 'install 'install-examples
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "make" "installexamples"
+                     (string-append "bindir=" (assoc-ref outputs "examples")
+                                    "/bin"))))
+         ;; Tests depend on installed libraries.
+         (delete 'check)
+         (add-after 'fix-rpath 'check
+           (assoc-ref %standard-phases 'check)))))
+    (native-inputs
+     `(("patchelf" ,patchelf)
+       ("perl" ,perl)
+       ("sed" ,sed)))
+    (home-page "https://www.gecode.org")
+    (synopsis "Toolkit for developing constraint-based systems")
+    (description "Gecode is a C++ toolkit for developing constraint-based
+systems and applications.  It provides a modular and extensible solver.")
+    (license license:expat)))
+
 (define-public libflame
   (package
     (name "libflame")
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49625; Package guix-patches. (Sat, 24 Jul 2021 18:26:01 GMT) Full text and rfc822 format available.

Message #14 received at 49625 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Leo Prikler <leo.prikler <at> student.tugraz.at>, 49625 <at> debbugs.gnu.org
Subject: Re: [bug#49625] [PATCH WIP] gnu: Add minizinc.
Date: Sat, 24 Jul 2021 20:25:11 +0200
[Message part 1 (text/plain, inline)]
Hi,

> +    (inputs
> +     `(("bison" ,bison)
> +       ("flex" ,flex)

"bison" and "flex" are usually only used at compile time,
so these should probably be native inputs.  As a test,
you can use "guix gc --references" to test if a reference to
"bison" and "flex" is retained (if there's no reference,
then they should probably be native-inputs).

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49625; Package guix-patches. (Sun, 25 Jul 2021 22:24:02 GMT) Full text and rfc822 format available.

Message #17 received at 49625 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: 49625 <at> debbugs.gnu.org
Subject: [PATCH v2 2/2] gnu: Add minizinc.
Date: Mon, 26 Jul 2021 00:23:41 +0200
* gnu/packages/maths.scm (minizinc): New variable.
---
 gnu/packages/maths.scm | 130 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 130 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index c052d33214..d72a534f30 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3057,6 +3057,136 @@ the Cauchy-Schwarz inequality, Stirling's formula, etc.  See the Metamath
 book.")
     (license license:gpl2+)))
 
+(define-public minizinc
+  (package
+    (name "minizinc")
+    (version "2.5.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/MiniZinc/libminizinc")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)
+                         (srfi srfi-1)))
+              (snippet
+               '(begin
+                  ;; Do not advertise proprietary solvers
+                  (with-directory-excursion "cmake/targets"
+                    (let ((targets '("libminizinc_fzn.cmake"
+                                     "libminizinc_gecode.cmake"
+                                     "libminizinc_mip.cmake"
+                                     "libminizinc_nl.cmake"
+                                     "libminizinc_osicbc.cmake"
+                                     "libminizinc_parser.cmake"
+                                     "libmzn.cmake"
+                                     "minizinc.cmake"
+                                     "mzn2doc.cmake")))
+                     (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file (cons* "." ".." targets)))
+                               (scandir ".")))
+                    (substitute* "libmzn.cmake"
+                      (("include\\(cmake/targets/(.*)\\)" all target)
+                       (if (member target targets) all "")))))
+                  (with-directory-excursion "include/minizinc/solvers/MIP"
+                    (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file '("." ".."
+                                                "MIP_osicbc_solverfactory.hh"
+                                                "MIP_osicbc_wrap.hh"
+                                                "MIP_solverinstance.hh"
+                                                "MIP_solverinstance.hpp"
+                                                "MIP_wrap.hh")))
+                               (scandir "."))))
+                  (with-directory-excursion "solvers/MIP"
+                    (for-each delete-file
+                              (remove
+                               (lambda (file)
+                                 (member file '("." ".."
+                                                "MIP_osicbc_solverfactory.cpp"
+                                                "MIP_osicbc_wrap.cpp"
+                                                "MIP_solverinstance.cpp"
+                                                "MIP_wrap.cpp")))
+                               (scandir "."))))
+                  (substitute* "CMakeLists.txt"
+                    (("find_package\\(([^ ]*).*\\)" all pkg)
+                     (if (member pkg '("Gecode" "OsiCBC" "Threads"))
+                         all
+                         "")))
+                  ;; TODO: swap out miniz for zlib
+                  #t))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ; no ‘check’ target
+       #:modules ((guix build cmake-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-solver-configs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((gecode (assoc-ref inputs "gecode"))
+                   (pkgdatadir (string-append (assoc-ref outputs "out")
+                                                  "/share/minizinc")))
+               (call-with-output-file (string-append pkgdatadir
+                                                     "/Preferences.json")
+                 (lambda (port)
+                   (display "\
+{
+  \"tagDefaults\": [
+    [\"\", \"org.gecode.gecode\"],
+    [\"gecode\", \"org.gecode.gecode\"]
+  ],
+  \"solverDefaults\": []
+}"
+                            port)
+                   (newline port)))
+
+               (mkdir-p (string-append pkgdatadir "/solvers"))
+               (call-with-output-file (string-append pkgdatadir
+                                                     "/solvers/gecode.msc")
+                 (lambda (port)
+                   (format port
+                    "\
+{
+  \"id\": \"org.gecode.gecode\",
+  \"name\": \"Gecode\",
+  \"description\": \"Gecode FlatZinc executable\",
+  \"version\": ~s,
+  \"mznlib\": ~s,
+  \"executable\": ~s,
+  \"supportsMzn\": false,
+  \"supportsFzn\": true,
+  \"needsSolns2Out\": true,
+  \"needsMznExecutable\": false,
+  \"needsStdlibDir\": false,
+  \"isGUIApplication\": false
+}"
+                    (last (string-split gecode #\-))
+                    (string-append gecode "/share/gecode/mznlib")
+                    (string-append gecode "/bin/fzn-gecode"))
+                   (newline port)))))))))
+    (native-inputs
+     `(("bison" ,bison)
+       ("flex" ,flex)))
+    (inputs
+     `(("cbc" ,cbc)
+       ("gecode" ,gecode)
+       ("zlib" ,zlib)))
+    (home-page "https://www.minizinc.org")
+    (synopsis "High-level constraint modeling language")
+    (description "MiniZinc is a high-level modeling language for constraint
+satisfaction and optimization problems.  Models are compiled to FlatZinc, a
+language understood by many solvers.")
+    (license license:mpl2.0)))
+
 (define-public mumps
   (package
     (name "mumps")
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#49625; Package guix-patches. (Sun, 25 Jul 2021 22:24:02 GMT) Full text and rfc822 format available.

Message #20 received at 49625 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: 49625 <at> debbugs.gnu.org
Subject: [PATCH v2 1/2] gnu: Add gecode.
Date: Mon, 26 Jul 2021 00:23:40 +0200
* gnu/packages/maths.scm (gecode): New variable.
---
 gnu/packages/maths.scm | 71 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index eeb32d554a..c052d33214 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2008,6 +2008,77 @@ linear and quadratic objectives.  There are limited facilities for nonlinear
 and quadratic objectives using the Simplex algorithm.")
     (license license:epl1.0)))
 
+(define-public gecode
+  (package
+    (name "gecode")
+    (version "6.2.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Gecode/gecode")
+                    (commit (string-append "release-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; delete generated sources
+                  (for-each delete-file
+                            '("gecode/kernel/var-imp.hpp"
+                              "gecode/kernel/var-type.hpp"))))))
+    (outputs '("out" "examples"))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list (string-append "GLDFLAGS=-Wl,-rpath="
+                            (assoc-ref %outputs "out")
+                            "/lib")
+             "--enable-examples=no")
+       #:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (ice-9 rdelim)
+                  (ice-9 popen))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'build 'build-examples
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "make" "compileexamples")))
+         ;; The Makefile disrespects GLDFLAGS for some reason, so we have to
+         ;; patch it ourselves... *sigh*
+         (add-after 'install 'fix-rpath
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
+               (for-each
+                (lambda (file)
+                  (let* ((pipe (open-pipe* OPEN_READ "patchelf"
+                                          "--print-rpath" file))
+                         (line (read-line pipe)))
+                    (and (zero? (close-pipe pipe))
+                         (invoke "patchelf" "--set-rpath"
+                                 (string-append libdir ":" line)
+                                 file))))
+                (find-files libdir ".*\\.so$")))))
+         (add-after 'install 'install-examples
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "make" "installexamples"
+                     (string-append "bindir=" (assoc-ref outputs "examples")
+                                    "/bin"))))
+         ;; Tests depend on installed libraries.
+         (delete 'check)
+         (add-after 'fix-rpath 'check
+           (assoc-ref %standard-phases 'check)))))
+    (native-inputs
+     `(("patchelf" ,patchelf)
+       ("perl" ,perl)
+       ("sed" ,sed)))
+    (home-page "https://www.gecode.org")
+    (synopsis "Toolkit for developing constraint-based systems")
+    (description "Gecode is a C++ toolkit for developing constraint-based
+systems and applications.  It provides a modular and extensible solver.")
+    (license license:expat)))
+
 (define-public libflame
   (package
     (name "libflame")
-- 
2.32.0





Reply sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
You have taken responsibility. (Sat, 25 Sep 2021 13:26:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Prikler <leo.prikler <at> student.tugraz.at>:
bug acknowledged by developer. (Sat, 25 Sep 2021 13:26:02 GMT) Full text and rfc822 format available.

Message #25 received at 49625-done <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 49625-done <at> debbugs.gnu.org
Subject: [PATCH WIP] gnu: Add minizinc.
Date: Sat, 25 Sep 2021 15:25:10 +0200
Pushed v2.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 24 Oct 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.