summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-06-06 10:54:58 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-06-08 10:53:11 +0200
commit173d22a1c03450c804b2c7fab1393670fef45606 (patch)
treed6818c39b548e5c8e7e1297ca8465dff49c9413e /gnu/packages
parentea5d9bf9916d532005842f220f7da6e522151f6a (diff)
downloadguix-173d22a1c03450c804b2c7fab1393670fef45606.tar.gz
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.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/admin.scm18
1 files changed, 17 insertions, 1 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index bb93f7efb1..bcbdf9b395 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1375,6 +1375,7 @@ system administrator.")
                   (delete-file-recursively "lib/zlib")
                   #t))))
     (build-system gnu-build-system)
+    (outputs (list "out" "python"))
     (arguments
      `(#:configure-flags
        (list (string-append "--docdir=" (assoc-ref %outputs "out")
@@ -1432,7 +1433,22 @@ system administrator.")
              (substitute* "plugins/sudoers/Makefile.in"
                (("^pre-install:" 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
        ;; the chroot's /etc/passwd doesn't have it.  Turn off the tests.