Subject: [bug#61433] [PATCH 1/2] gnu: python-clingo: Install distribution information.

From: Liliana Marie Prikler <[email-masked]>
Date: Sat, 11 Feb 2023 15:50:34 +0100

* gnu/packages/maths.scm (python-clingo)[#:phases]: Add ‘install-distinfo’.
---
 gnu/packages/maths.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0da47943fd..61122f09af 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2717,7 +2717,17 @@ (define-public python-clingo
                   (("ctl\\.solve\\(on_statistics=on_statistics\\)" all)
                    (string-append
                     all
-                    "; self.skipTest(\"You shall not fail.\")")))))))))
+                    "; self.skipTest(\"You shall not fail.\")")))))
+            (add-after 'install 'install-distinfo
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (with-directory-excursion (python:site-packages inputs outputs)
+                   (let ((dir (string-append "clingo-" #$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: clingo~%")
+                         (format port "Version: ~a~%" #$version)))))))))))
     (inputs (list clingo python-wrapper))
     (propagated-inputs (list python-cffi))
     (native-inputs (modify-inputs (package-native-inputs clingo)
-- 
2.39.1