guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 2d6dbcdb4d2634531def257a5c64de2ce27a5a49
Author: abradd <[email protected]>
AuthorDate: Wed Sep 2 21:34:28 2026 +1000
gnu: python-setools: Enable tests and remove superfluous phase.
* gnu/packages/selinux.scm (python-setools): Enable tests and remove
superfluous phase.
[arguments] <#:tests?>: Enable.
[phases]{fix-target-paths}: Remove phase.
{set-checkolicy-env}: New phase.
[native-inputs]: Add checkpolicy.
Merges: guix/guix!11008
Signed-off-by: Sharlatan Hellseher <[email protected]>
---
gnu/packages/selinux.scm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/gnu/packages/selinux.scm b/gnu/packages/selinux.scm
index 8b606314d5..24b248f585 100644
--- a/gnu/packages/selinux.scm
+++ b/gnu/packages/selinux.scm
@@ -321,7 +321,6 @@ based on required access.")
(build-system pyproject-build-system)
(arguments
(list
- #:tests? #f ; Most tests require access to /usr/bin/checkpolicy
#:test-flags #~(list "tests")
#:phases
#~(modify-phases %standard-phases
@@ -330,11 +329,12 @@ based on required access.")
(lambda* (#:key inputs #:allow-other-keys)
(setenv "SEPOL"
(search-input-file inputs "/lib/libsepol.a"))))
- (add-after 'unpack 'fix-target-paths
- (lambda _
- (substitute* "setup.py"
- (("join\\(sys.prefix")
- (string-append "join(\"" #$output "/\"")))))
+ ;; tests assume /usr/bin/checkpolicy, override with
+ ;; CHECKPOLICY env variable
+ (add-before 'check 'set-checkpolicy-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "CHECKPOLICY"
+ (search-input-file inputs "/bin/checkpolicy"))))
(add-before 'check 'fix-tests
(lambda _
(delete-file-recursively "setools"))))))
@@ -345,7 +345,8 @@ based on required access.")
swig-4.0
python-pytest
python-pytest-qt
- python-setuptools))
+ python-setuptools
+ checkpolicy))
(inputs
(list libsepol
libselinux