Subject: [PATCH] gnu: Add rset. * gnu/packages/admin.scm (rset): New variable. --- gnu/packages/admin.scm | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index eda269f148..4bf17d57e5 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -142,6 +142,7 @@ #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (gnu packages web) + #:use-module (gnu packages wget) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xml) #:use-module (gnu packages xorg)) @@ -3425,6 +3426,84 @@ Intel DRM Driver.") (supported-systems '("i686-linux" "x86_64-linux")) (license license:expat))) +(define-public rset + (package + (name "rset") + (version "2.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/eradman/rset/") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0dk75an8axf4480lirwj1vyq1nd18kq5lwz6gdg6hgk3a4rwpv8j")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list (string-append "PREFIX=" %output) + (string-append "CC=" ,(cc-for-target))) + #:test-target "test" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "rutils.c" + (("/usr/bin/install") + (string-append (assoc-ref inputs "coreutils") "/bin/install"))) + (substitute* "config.h" + (("(LOCAL_INTERPRETER \")/bin/sh" _ start) + (string-append start (assoc-ref inputs "bash") "/bin/sh"))) + ;; Paths on Guix tend to be much longer, so increase buffer size. + (substitute* "input.h" + (("#define PLN_OPTION_SIZE 64") + "#define PLN_OPTION_SIZE 128")))) + (add-after 'patch-paths 'patch-tests + (lambda _ + ;; Input files must be writable for pipe tests. + (for-each make-file-writable (find-files "tests/input")) + (substitute* (find-files "tests") + (("(#!|local_interpreter=)/bin/sh" _ start) + (string-append start (which "sh")))) + (substitute* '("tests/stubs/ssh" "tests/stubs/tar") + (("/bin/echo") (which "echo"))) + (substitute* "tests/test_miniquark.rb" + ;; Make sure the test can see PATH. + ((":unsetenv_others=>true") ":unsetenv_others=>false")) + (substitute* '("tests/cmd_pipe_stdin.c" "tests/test_rset.rb") + (("/bin/cat") (which "cat")) + ;; /bin/cat is in a fixed-size buffer, so increase the size. + (("char \\*cmd_argv\\[16\\];") "char *cmd_argv[256];")) + (substitute* "tests/test_rset.rb" + (("output_size: 20") "output_size: 66") + (("strlen: 20") "strlen: 66") + (("/usr/bin/env ruby") (which "ruby")) + (("\"/bin/sh") (string-append "\"" (which "sh"))) + ;; Make the sure the test can see our PATH. + (("\\{\"PATH\"=>\"/bin:/usr/bin\"\\}, ") "")))) + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + ;; ./configure must be called with no arguments, or it fails. + (invoke "./configure")))))) + (inputs + `(("coreutils" ,coreutils) + ("bash" ,bash-minimal))) + (native-inputs + `(("ruby" ,ruby) + ("wget" ,wget) + ("inetutils" ,inetutils))) + (home-page "http://scriptedconfiguration.org") + (synopsis "Configure systems using any scripting language") + (description + "@command{rset} operates by staging files on a remote system, then +executing instructions embedded in the @code{pln(5)} (Progressive Language +Notation) files. Any interpreter capable of running scripts read over a pipe +may be specified. The bundled utilities @command{rinstall} and @command{rsub} +provide a means of installing and modifying configuration files, and +capabilities are added by writing utility scripts which are sent along +with configuration data.") + (license license:isc))) + (define-public neofetch (package (name "neofetch") base-commit: c8e2be3b32fe784a9db52d8a1a12902ab12ae7cb -- 2.31.1