guix_mirror_bot pushed a commit to branch master
in repository guix.
commit dab4770613ed57f1a0c5f7231f8657e2a82189ad
Author: Liliana Marie Prikler <[email protected]>
AuthorDate: Tue Sep 2 11:31:06 2025 +0200
gnu: Add python-clingcon.
* gnu/packages/potassco.scm (python-clingcon): New variable.
---
gnu/packages/potassco.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index 08120663f6..b344eb7076 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -508,6 +508,45 @@ Python code.")))
as a theory to clingo from Python code. It also supports running clingo-dl
directly from the python command line.")))
+(define-public python-clingcon
+ (package
+ (inherit clingcon)
+ (name "python-clingcon")
+ (version (package-version clingcon))
+ (arguments
+ (cons*
+ #:configure-flags
+ #~(list "-DPYCLINGCON_ENABLE=pip"
+ (string-append "-DCMAKE_MODULE_PATH="
+ #$(this-package-native-input
"python-scikit-build")
+ "/lib/cmake/modules"))
+ #:imported-modules `(,@%cmake-build-system-modules
+ (guix build python-build-system))
+ #:modules '((guix build cmake-build-system)
+ ((guix build python-build-system) #:prefix python:)
+ (guix build utils))
+ (substitute-keyword-arguments (package-arguments clingcon)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'install-distinfo
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (with-directory-excursion (python:site-packages inputs
outputs)
+ (let ((dir (string-append "clingcon-" #$version
".dist-info")))
+ (mkdir-p dir)
+ (call-with-output-file (string-append dir "/METADATA")
+ (lambda (port)
+ (format port "Metadata-Version: 1.1~%")
+ (format port "Name: clingcon~%")
+ (format port "Version: ~a~%" #$version))))))))))))
+ (inputs (modify-inputs (package-inputs clingcon)
+ (prepend python-wrapper)))
+ (propagated-inputs (list python-clingo python-cffi))
+ (native-inputs (modify-inputs (package-native-inputs clingcon)
+ (prepend python-scikit-build)))
+ (synopsis "Python bindings for clingcon")
+ (description "This package allows users to add the clingcon propagator
+as a theory to clingo from Python code.")))
+
(define-public python-clingox
(package
(name "python-clingox")