aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-09-16 10:12:29 +0200
committerLudovic Courtès <ludo@gnu.org>2024-09-16 10:13:55 +0200
commit432a6ece6bed569bf8abca51dccbb5476c069f88 (patch)
tree742579749247c8868aa6a5adc884523a4ad55f6b /gnu
parent79726a0507e09d31a838d1a42ab734dfa9fff3d0 (diff)
downloadguix-432a6ece6bed569bf8abca51dccbb5476c069f88.tar
guix-432a6ece6bed569bf8abca51dccbb5476c069f88.tar.gz
gnu: sudo: Use gexps and remove input labels.
* gnu/packages/admin.scm (sudo)[arguments]: Use gexps; use ‘search-input-file’ rather than ‘assoc-ref’. [inputs]: Remove labels. Change-Id: I0ea13751c5e34d1ad14035e8c2b8e7e4a7d5f8e1
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/admin.scm135
1 files changed, 68 insertions, 67 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index f842abea78..832834707f 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -2059,77 +2059,78 @@ system administrator.")
(build-system gnu-build-system)
(outputs (list "out"))
(arguments
- `(#:configure-flags
- (list (string-append "--docdir=" (assoc-ref %outputs "out")
- "/share/doc/" ,name "-" ,version)
-
- "--with-logpath=/var/log/sudo.log"
- "--with-rundir=/var/run/sudo" ; must be cleaned up at boot time
- "--with-vardir=/var/db/sudo"
- "--with-iologdir=/var/log/sudo-io"
-
- ;; 'visudo.c' expects _PATH_MV to be defined, but glibc doesn't
- ;; provide it.
- (string-append "CPPFLAGS=-D_PATH_MV=\\\""
- (assoc-ref %build-inputs "coreutils")
- "/bin/mv\\\"")
-
- ;; When cross-compiling, assume we have a working 'snprintf' and
- ;; 'vsnprintf' (which we do, when using glibc). The default
- ;; choice fails with undefined references to 'sudo_snprintf' &
- ;; co. when linking.
- ,@(if (%current-target-system)
- '("ac_cv_have_working_snprintf=yes"
- "ac_cv_have_working_vsnprintf=yes")
- '()))
+ (list #:configure-flags
+ #~(list (string-append "--docdir=" #$output
+ "/share/doc/" #$name "-" #$version)
+
+ "--with-logpath=/var/log/sudo.log"
+ "--with-rundir=/var/run/sudo" ; must be cleaned up at boot time
+ "--with-vardir=/var/db/sudo"
+ "--with-iologdir=/var/log/sudo-io"
+
+ ;; 'visudo.c' expects _PATH_MV to be defined, but glibc doesn't
+ ;; provide it.
+ (string-append "CPPFLAGS=-D_PATH_MV=\\\""
+ (search-input-file %build-inputs "/bin/mv")
+ "\\\"")
+
+ ;; When cross-compiling, assume we have a working 'snprintf' and
+ ;; 'vsnprintf' (which we do, when using glibc). The default
+ ;; choice fails with undefined references to 'sudo_snprintf' &
+ ;; co. when linking.
+ #$@(if (%current-target-system)
+ '("ac_cv_have_working_snprintf=yes"
+ "ac_cv_have_working_vsnprintf=yes")
+ '()))
+
+ ;; Avoid non-determinism; see <http://bugs.gnu.org/21918>.
+ #:parallel-build? #f
- ;; Avoid non-determinism; see <http://bugs.gnu.org/21918>.
- #:parallel-build? #f
-
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'pre-configure
- (lambda _
- (substitute* "src/sudo_usage.h.in"
- ;; Do not capture 'configure' arguments since we would
- ;; unduly retain references, and also because the
- ;; CPPFLAGS above would close the string literal
- ;; prematurely.
- (("@CONFIGURE_ARGS@") "\"\""))
- (substitute* (find-files "." "Makefile\\.in")
- ;; Allow installation as non-root.
- (("-o [[:graph:]]+ -g [[:graph:]]+")
- "")
- ;; Don't try to create /etc/sudoers.
- (("^install: (.*)install-sudoers(.*)" _ before after)
- (string-append "install: " before after "\n"))
- ;; Don't try to create /run/sudo.
- (("\\$\\(DESTDIR\\)\\$\\(rundir\\)")
- "$(TMPDIR)/dummy")
- ;; Install example sudo{,_logsrvd}.conf to the right place.
- (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
- "$(DESTDIR)/$(docdir)/examples")
- ;; Don't try to create /var/db/sudo.
- (("\\$\\(DESTDIR\\)\\$\\(vardir\\)")
- "$(TMPDIR)/dummy"))
-
- ;; ‘Checking existing [/etc/]sudoers file for syntax errors’ is
- ;; not the task of the build system, and fails.
- (substitute* "plugins/sudoers/Makefile.in"
- (("^pre-install:" match)
- (string-append match "\ndisabled-" match))))))
-
- ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
- ;; the chroot's /etc/passwd doesn't have it. Turn off the tests.
- #:tests? #f))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'pre-configure
+ (lambda _
+ (substitute* "src/sudo_usage.h.in"
+ ;; Do not capture 'configure' arguments since we would
+ ;; unduly retain references, and also because the
+ ;; CPPFLAGS above would close the string literal
+ ;; prematurely.
+ (("@CONFIGURE_ARGS@")
+ "\"\""))
+ (substitute* (find-files "." "Makefile\\.in")
+ ;; Allow installation as non-root.
+ (("-o [[:graph:]]+ -g [[:graph:]]+")
+ "")
+ ;; Don't try to create /etc/sudoers.
+ (("^install: (.*)install-sudoers(.*)" _ before
+ after)
+ (string-append "install: " before after "\n"))
+ ;; Don't try to create /run/sudo.
+ (("\\$\\(DESTDIR\\)\\$\\(rundir\\)")
+ "$(TMPDIR)/dummy")
+ ;; Install example sudo{,_logsrvd}.conf to the right place.
+ (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
+ "$(DESTDIR)/$(docdir)/examples")
+ ;; Don't try to create /var/db/sudo.
+ (("\\$\\(DESTDIR\\)\\$\\(vardir\\)")
+ "$(TMPDIR)/dummy"))
+
+ ;; ‘Checking existing [/etc/]sudoers file for syntax errors’ is
+ ;; not the task of the build system, and fails.
+ (substitute* "plugins/sudoers/Makefile.in"
+ (("^pre-install:" match)
+ (string-append match "\ndisabled-" match))))))
+
+ ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
+ ;; the chroot's /etc/passwd doesn't have it. Turn off the tests.
+ #:tests? #f))
(native-inputs
(list groff))
(inputs
- `(("coreutils" ,coreutils)
- ,@(if (target-hurd?)
- '()
- `(("linux-pam" ,linux-pam)))
- ("zlib" ,zlib)))
+ (append (list coreutils zlib)
+ (if (target-hurd?)
+ '()
+ (list linux-pam))))
(home-page "https://www.sudo.ws/")
(synopsis "Run commands as root")
(description