[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: gnu: sudo: Separate Python output.
From: |
guix-commits |
Subject: |
02/02: gnu: sudo: Separate Python output. |
Date: |
Mon, 8 Jun 2020 04:54:42 -0400 (EDT) |
mothacehe pushed a commit to branch master
in repository guix.
commit 173d22a1c03450c804b2c7fab1393670fef45606
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat Jun 6 10:54:58 2020 +0200
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.
---
gnu/packages/admin.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index bb93f7e..bcbdf9b 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.