diff options
author | Andreas Enge <andreas@enge.fr> | 2025-07-21 13:04:35 +0200 |
---|---|---|
committer | Andreas Enge <andreas@enge.fr> | 2025-07-22 15:19:04 +0200 |
commit | 348c75949043a41dc8771a26f63fd29018aabfea (patch) | |
tree | bc796b7cccda434666f68ff4168c0dc2756d21eb | |
parent | 1187787c6fbf65cf2bfbc8860ba4ab154a0e3f94 (diff) |
gnu: glucose: Remove non-free code.
The parallel version of glucose (glucose-syrup) has usage restrictions
and cannot be used to take part in competitions.
* gnu/packages/maths.scm (glucose)[origin]: Add modules and snippet.
[arguments]<#:phases>{'install}: Remove installation targets. Add symlink.
Fixes: guix/guix#1296
Change-Id: Id351d9e3f7bac46157c8695381d1cf40fc60e4c7
-rw-r--r-- | gnu/packages/maths.scm | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index d8ddf6a66c..771b454e30 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -3108,37 +3108,56 @@ fixed point (16.16) format.") (package (name "glucose") (version "4.2.1") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/audemard/glucose") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0zrn4hnkf8k95dc3s3acydl1bqkr8a0axw56g7n562lx7zj7sd62")))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/audemard/glucose") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0zrn4hnkf8k95dc3s3acydl1bqkr8a0axw56g7n562lx7zj7sd62")) + (modules '((guix build utils))) + (snippet + ;; Remove code related to the parallel version as non-free; + ;; from parallel/Main.cc: + ;; "The parallel version of Glucose (all files modified + ;; since Glucose 3.0 releases, 2013) cannot be used in any + ;; competitive event" + '(begin + (delete-file-recursively "parallel") + (substitute* "CMakeLists.txt" + (("^add_library\\(glucosep.*$") + "") + (("^add_executable\\(glucose-syrup.*$") + "") + (("^target_link_libraries\\(glucose-syrup.*$") + "")))))) (build-system cmake-build-system) (arguments (list - #:tests? #f ; there are no tests + #:tests? #f ;there are no tests #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON" (string-append "-DCMAKE_BUILD_RPATH=" #$output "/lib")) - #:phases #~(modify-phases %standard-phases - (replace 'install - (lambda _ - (for-each - (lambda (bin) - (install-file bin (string-append #$output "/bin"))) - '("glucose-simp" "glucose-syrup")) - (for-each - (lambda (lib) - (install-file lib (string-append #$output "/lib"))) - '("libglucose.so" "libglucosep.so"))))))) + #:phases + #~(modify-phases %standard-phases + (replace 'install + (lambda _ + (install-file "libglucose.so" + (string-append #$output "/lib")) + (install-file "glucose-simp" + (string-append #$output "/bin")) + ;; Add a symbolic link with the customary name used until + ;; the parallel version was written, and which is expected + ;; by Sage. + (symlink "glucose-simp" + (string-append #$output "/bin/glucose"))))))) (inputs (list zlib)) (home-page "https://www.labri.fr/perso/lsimon/research/glucose/") (synopsis "SAT Solver") - (description "Glucose is a SAT solver based on a scoring scheme introduced + (description + "Glucose is a SAT solver based on a scoring scheme introduced in 2009 for the clause learning mechanism of so called “Modern” SAT solvers. It is designed to be parallel.") (license license:expat))) |