summary refs log tree commit diff
path: root/gnu/packages/selinux.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-13 13:57:55 +0200
committerMarius Bakke <marius@gnu.org>2022-08-13 19:24:35 +0200
commit46bb84bb577711140c31fedebd3a01920a5c331f (patch)
tree388d57e2a3399a4488d2c4086dbce4df03242357 /gnu/packages/selinux.scm
parent71d07d821dec93bdb6a308f53bd3b38a627a33a7 (diff)
downloadguix-46bb84bb577711140c31fedebd3a01920a5c331f.tar.gz
gnu: python-sepolgen: Use G-expression and remove labels.
* gnu/packages/selinux.scm (python-sepolgen)[arguments]: Convert to
G-expression.  Don't refer to python by label.
[inputs]: Remove labels.
Diffstat (limited to 'gnu/packages/selinux.scm')
-rw-r--r--gnu/packages/selinux.scm66
1 files changed, 34 insertions, 32 deletions
diff --git a/gnu/packages/selinux.scm b/gnu/packages/selinux.scm
index d1243de00e..cb17a3e659 100644
--- a/gnu/packages/selinux.scm
+++ b/gnu/packages/selinux.scm
@@ -251,39 +251,41 @@ binary policies.")
   (package/inherit libsepol
     (name "python-sepolgen")
     (arguments
-     `(#:modules ((srfi srfi-1)
-                  (guix build gnu-build-system)
-                  (guix build utils))
-       ,@(substitute-keyword-arguments (package-arguments libsepol)
-           ((#:phases phases)
-            `(modify-phases ,phases
-               (delete 'portability)
-               (replace 'enter-dir
-                 (lambda _ (chdir "python/sepolgen")))
-               ;; By default all Python files would be installed to
-               ;; $out/gnu/store/...-python-.../, so we override the
-               ;; PACKAGEDIR to fix this.
-               (add-after 'enter-dir 'fix-target-path
-                 (lambda* (#:key inputs outputs #:allow-other-keys)
-                   (let ((get-python-version
-                          ;; FIXME: copied from python-build-system
-                          (lambda (python)
-                            (let* ((version     (last (string-split python #\-)))
-                                   (components  (string-split version #\.))
-                                   (major+minor (take components 2)))
-                              (string-join major+minor ".")))))
-                     (substitute* "src/sepolgen/Makefile"
-                       (("^PACKAGEDIR.*")
-                        (string-append "PACKAGEDIR="
-                                       (assoc-ref outputs "out")
-                                       "/lib/python"
-                                       (get-python-version
-                                        (assoc-ref inputs "python"))
-                                       "/site-packages/sepolgen")))
-                     (substitute* "src/share/Makefile"
-                       (("\\$\\(DESTDIR\\)") (assoc-ref outputs "out")))))))))))
+     (substitute-keyword-arguments (package-arguments libsepol)
+       ((#:modules _ #~%gnu-build-system-modules)
+        '((srfi srfi-1)
+          (guix build gnu-build-system)
+          (guix build utils)))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (delete 'portability)
+            (replace 'enter-dir
+              (lambda _ (chdir "python/sepolgen")))
+            ;; By default all Python files would be installed to
+            ;; $out/gnu/store/...-python-.../, so we override the
+            ;; PACKAGEDIR to fix this.
+            (add-after 'enter-dir 'fix-target-path
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let ((get-python-version
+                       ;; FIXME: copied from python-build-system
+                       (lambda (python)
+                         (let* ((version     (last (string-split python #\-)))
+                                (components  (string-split version #\.))
+                                (major+minor (take components 2)))
+                           (string-join major+minor "."))))
+                      (python (dirname (dirname (search-input-file
+                                                 inputs "bin/python3")))))
+                  (substitute* "src/sepolgen/Makefile"
+                    (("^PACKAGEDIR.*")
+                     (string-append "PACKAGEDIR="
+                                    #$output
+                                    "/lib/python"
+                                    (get-python-version python)
+                                    "/site-packages/sepolgen")))
+                  (substitute* "src/share/Makefile"
+                    (("\\$\\(DESTDIR\\)") #$output)))))))))
     (inputs
-     `(("python" ,python-wrapper)))
+     (list python-wrapper))
     (native-inputs '())
     (synopsis "Python module for generating SELinux policies")
     (description