aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2020-08-09 15:44:44 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2020-08-09 16:41:11 +0200
commitc43c4d8b39df3b42cad1ff8db35d2bd9806e43d8 (patch)
tree4db48cbe21d9a19042240f9eb3d80538a0d63e77 /gnu
parent6a67aad88e615c3024b05c92905249f777ad5cc4 (diff)
downloadguix-c43c4d8b39df3b42cad1ff8db35d2bd9806e43d8.tar
guix-c43c4d8b39df3b42cad1ff8db35d2bd9806e43d8.tar.gz
gnu: facter: Embed more absolute references.
* gnu/packages/admin.scm (facter)[arguments]: Rename the ‘embed-iproute-reference’ phase to ‘embed-absolute-references’ and make it generic. Implicit inputs like coreutils are captured. References depend on what's found, not a hard-coded list. [inputs]: Add dmidecode, inetutils, pciutils, and util-linux.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/admin.scm84
1 files changed, 45 insertions, 39 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 2374832072..d2d14b909a 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -455,47 +455,53 @@ graphs and can export its output to different formats.")
"0bab3by926gavbhkvp0in82vim575ybj8z6av3b12jdvla1s9rmz"))))
(build-system ruby-build-system)
(arguments
- `(#:phases (modify-phases %standard-phases
- (add-after 'unpack 'delete-facter-ng-gemspec
- (lambda _
- ;; XXX: ruby-build-system incorrectly finds
- ;; facter-ng.gemspec from this directory and tries to
- ;; build that instead of the proper facter.gemspec.
- ;; Just delete it as a workaround, as it appears to
- ;; only exist for backwards-compatibility after the
- ;; facter-ng->facter rename.
- (delete-file "agent/facter-ng.gemspec")
- #t))
- (add-after 'unpack 'embed-iproute-reference
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((iproute (assoc-ref inputs "iproute")))
- ;; Provide an absolute reference to the 'ip' executable
- ;; to avoid propagating it.
- (substitute* "lib/resolvers/networking_linux_resolver.rb"
- (("execute\\('ip")
- (string-append "execute('" iproute "/sbin/ip")))
- #t)))
- (delete 'check)
- (add-after 'wrap 'check
- (lambda* (#:key tests? outputs #:allow-other-keys)
- ;; XXX: The test suite wants to run Bundler and
- ;; complains that the gemspec is invalid. For now
- ;; just make sure that we can run the wrapped
- ;; executable directly.
- (if tests?
- (invoke (string-append (assoc-ref outputs "out")
- "/bin/facter")
- ;; Many facts depend on /sys, /etc/os-release,
- ;; etc, so we only run a small sample.
- "facterversion" "architecture"
- "kernel" "kernelversion")
- (format #t "tests disabled~%"))
- #t)))))
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'delete-facter-ng-gemspec
+ (lambda _
+ ;; XXX: ruby-build-system incorrectly finds
+ ;; facter-ng.gemspec from this directory and tries to
+ ;; build that instead of the proper facter.gemspec.
+ ;; Just delete it as a workaround, as it appears to
+ ;; only exist for backwards-compatibility after the
+ ;; facter-ng->facter rename.
+ (delete-file "agent/facter-ng.gemspec")
+ #t))
+ (add-after 'unpack 'embed-absolute-references
+ ;; Refer to absolute executable file names to avoid propagation.
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* (find-files "lib/resolvers" "\\.rb$")
+ (("execute\\('(which |)([^ ']+)" _ _ name)
+ (string-append "execute('" (or (which name)
+ name))))
+ #t))
+ (delete 'check)
+ (add-after 'wrap 'check
+ (lambda* (#:key tests? outputs #:allow-other-keys)
+ ;; XXX: The test suite wants to run Bundler and
+ ;; complains that the gemspec is invalid. For now
+ ;; just make sure that we can run the wrapped
+ ;; executable directly.
+ (if tests?
+ (invoke (string-append (assoc-ref outputs "out")
+ "/bin/facter")
+ ;; Many facts depend on /sys, /etc/os-release,
+ ;; etc, so we only run a small sample.
+ "facterversion" "architecture"
+ "kernel" "kernelversion")
+ (format #t "tests disabled~%"))
+ #t)))))
(inputs
- `(("iproute" ,iproute)
- ("ruby-hocon" ,ruby-hocon)
+ `(("ruby-hocon" ,ruby-hocon)
("ruby-sys-filesystem" ,ruby-sys-filesystem)
- ("ruby-thor" ,ruby-thor)))
+ ("ruby-thor" ,ruby-thor)
+
+ ;; For ‘embed-absolute-references’.
+ ("dmidecode" ,dmidecode)
+ ("inetutils" ,inetutils) ; for ‘hostname’
+ ("iproute" ,iproute)
+ ("pciutils" ,pciutils)
+ ("util-linux" ,util-linux)))
(synopsis "Collect and display system facts")
(description
"Facter is a tool that gathers basic facts about nodes (systems) such