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.
This commit is contained in:
Marius Bakke 2022-08-13 13:57:55 +02:00
parent 71d07d821d
commit 46bb84bb57
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA

View File

@ -251,39 +251,41 @@ binary policies.")
(package/inherit libsepol (package/inherit libsepol
(name "python-sepolgen") (name "python-sepolgen")
(arguments (arguments
`(#:modules ((srfi srfi-1) (substitute-keyword-arguments (package-arguments libsepol)
(guix build gnu-build-system) ((#:modules _ #~%gnu-build-system-modules)
(guix build utils)) '((srfi srfi-1)
,@(substitute-keyword-arguments (package-arguments libsepol) (guix build gnu-build-system)
((#:phases phases) (guix build utils)))
`(modify-phases ,phases ((#:phases phases)
(delete 'portability) #~(modify-phases #$phases
(replace 'enter-dir (delete 'portability)
(lambda _ (chdir "python/sepolgen"))) (replace 'enter-dir
;; By default all Python files would be installed to (lambda _ (chdir "python/sepolgen")))
;; $out/gnu/store/...-python-.../, so we override the ;; By default all Python files would be installed to
;; PACKAGEDIR to fix this. ;; $out/gnu/store/...-python-.../, so we override the
(add-after 'enter-dir 'fix-target-path ;; PACKAGEDIR to fix this.
(lambda* (#:key inputs outputs #:allow-other-keys) (add-after 'enter-dir 'fix-target-path
(let ((get-python-version (lambda* (#:key inputs #:allow-other-keys)
;; FIXME: copied from python-build-system (let ((get-python-version
(lambda (python) ;; FIXME: copied from python-build-system
(let* ((version (last (string-split python #\-))) (lambda (python)
(components (string-split version #\.)) (let* ((version (last (string-split python #\-)))
(major+minor (take components 2))) (components (string-split version #\.))
(string-join major+minor "."))))) (major+minor (take components 2)))
(substitute* "src/sepolgen/Makefile" (string-join major+minor "."))))
(("^PACKAGEDIR.*") (python (dirname (dirname (search-input-file
(string-append "PACKAGEDIR=" inputs "bin/python3")))))
(assoc-ref outputs "out") (substitute* "src/sepolgen/Makefile"
"/lib/python" (("^PACKAGEDIR.*")
(get-python-version (string-append "PACKAGEDIR="
(assoc-ref inputs "python")) #$output
"/site-packages/sepolgen"))) "/lib/python"
(substitute* "src/share/Makefile" (get-python-version python)
(("\\$\\(DESTDIR\\)") (assoc-ref outputs "out"))))))))))) "/site-packages/sepolgen")))
(substitute* "src/share/Makefile"
(("\\$\\(DESTDIR\\)") #$output)))))))))
(inputs (inputs
`(("python" ,python-wrapper))) (list python-wrapper))
(native-inputs '()) (native-inputs '())
(synopsis "Python module for generating SELinux policies") (synopsis "Python module for generating SELinux policies")
(description (description