gnu: sudo: Separate Python output.

The Python plugin of "sudo" drags the Python interpreter to the closure of
Guix System. Put it in a separate output.

* gnu/packages/admin.scm (sudo)[arguments]: Add a 'separate-python-output
phase, that's populating ...
[outputs]: ... the new "python" output.
This commit is contained in:
Mathieu Othacehe 2020-06-06 10:54:58 +02:00
parent ea5d9bf991
commit 173d22a1c0
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -1375,6 +1375,7 @@ (define-public sudo
(delete-file-recursively "lib/zlib") (delete-file-recursively "lib/zlib")
#t)))) #t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs (list "out" "python"))
(arguments (arguments
`(#:configure-flags `(#:configure-flags
(list (string-append "--docdir=" (assoc-ref %outputs "out") (list (string-append "--docdir=" (assoc-ref %outputs "out")
@ -1432,7 +1433,22 @@ (define-public sudo
(substitute* "plugins/sudoers/Makefile.in" (substitute* "plugins/sudoers/Makefile.in"
(("^pre-install:" match) (("^pre-install:" match)
(string-append match "\ndisabled-" match))) (string-append match "\ndisabled-" match)))
#t))) #t))
(add-after 'install 'separate-python-output
(lambda* (#:key target outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(out:python (assoc-ref outputs "python")))
(if target
(mkdir-p (string-append out:python "/empty"))
(for-each
(lambda (file)
(let ((old (string-append out "/" file))
(new (string-append out:python "/" file)))
(mkdir-p (dirname new))
(rename-file old new)))
(list "libexec/sudo/python_plugin.so"
"libexec/sudo/python_plugin.la")))
#t))))
;; XXX: The 'testsudoers' test series expects user 'root' to exist, but ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
;; the chroot's /etc/passwd doesn't have it. Turn off the tests. ;; the chroot's /etc/passwd doesn't have it. Turn off the tests.