gnu: gecode: Use gexps.

* gnu/packages/maths.scm (gecode): Use gexps. Reindent package.

Change-Id: I5a644d25f2d62c3245b0770fe99c20c3ef380ffc
This commit is contained in:
Andreas Enge 2024-05-15 13:29:34 +02:00
parent 75f3cca50a
commit 12d23e3ac9
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

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