From patchwork Mon Aug 9 00:26:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sarah Morgensen X-Patchwork-Id: 31915 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F00D327BC78; Mon, 9 Aug 2021 01:27:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 537D327BC6B for ; Mon, 9 Aug 2021 01:27:09 +0100 (BST) Received: from localhost ([::1]:56088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCt8G-0003nJ-Ax for patchwork@mira.cbaines.net; Sun, 08 Aug 2021 20:27:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCt8A-0003nA-Q1 for guix-patches@gnu.org; Sun, 08 Aug 2021 20:27:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43536) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCt8A-0006vJ-I9 for guix-patches@gnu.org; Sun, 08 Aug 2021 20:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCt8A-0002Eh-Ck for guix-patches@gnu.org; Sun, 08 Aug 2021 20:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48369] [PATCH] gnu: Add rset. In-Reply-To: <20210511205831.165732-1-stefan@xsteve.at> Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Aug 2021 00:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48369 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Stefan =?utf-8?q?Reich=C3=B6r?= Cc: 48369@debbugs.gnu.org Received: via spool by 48369-submit@debbugs.gnu.org id=B48369.16284687988564 (code B ref 48369); Mon, 09 Aug 2021 00:27:02 +0000 Received: (at 48369) by debbugs.gnu.org; 9 Aug 2021 00:26:38 +0000 Received: from localhost ([127.0.0.1]:55082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCt7m-0002E2-7X for submit@debbugs.gnu.org; Sun, 08 Aug 2021 20:26:38 -0400 Received: from out0.migadu.com ([94.23.1.103]:14618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCt7e-0002Do-Tm for 48369@debbugs.gnu.org; Sun, 08 Aug 2021 20:26:36 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1628468788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=DXNp6zKl1yBwGuWua8Hns1mPVpZOr0sjCd0Mej1tQL0=; b=DKZ1oPjOZgp+eXmJE4lUwWnlT1ifNzHLzEPBAytaBx0Rex4/7tHTIfYXjibW2BV0GyXMON bPS6Un7VzeYaAglAp+4pIVmooO3apNWn/jh2okt/LrL3LtvRqD7okKKw+lZSUp9Nhr5DNH NTQTctjbaBvHo/hWPJYGMY/wVeSVoHQ= From: Sarah Morgensen References: <20210511205831.165732-1-stefan@xsteve.at> Date: Sun, 08 Aug 2021 17:26:26 -0700 Message-ID: <867dgvlaz1.fsf@mgsn.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Stefan, Thanks for the patch. Sorry it's taken so long for someone to take a look at this! This utility certainly looks interesting. I'm not a committer, but I tested out this patch. It doesn't apply on master anymore, so I manually applied it and was able to build it. However, it looks like it expects a number of utilities to be in specific places, such as /usr/bin/install (which caused rinstall to just... do nothing). It could also be problematic if it's attempting to invoke such absolute paths on a remote machine. I'm not sure exactly how rset works, though. I was able to enable and pass tests with the modifications in the patch attached below. I don't know rset itself though, so I don't know if there might be other hardcoded things that need to be substituted. I also bumped it to 2.2 and made a few minor tweaks to the description. I noticed you didn't add a copyright line, but I wasn't sure whether the omission was intentional, so I didn't add one for you. Go ahead and send an updated patch to this bug number (48369@debbugs.gnu.org) if you'd like to add one, or make any other changes :) The following is after the modifications I've made: * Package review checklist (WIP - comments welcome!) A check indicates that I've verified the item. 1. [X] Package builds (guix build package) [X] x86_64 [ ] aarch64 [ ] armhf [ ] powerpc64le [ ] i686 [ ] i586 [ ] mips64le 2. [X] Build is reproducible (guix build --rounds=n package) 3. [X] Tests enabled (if available) or disabled with in-source comment 4. [X] No extraneous dependencies (guix size package) 5. [X] No unnecessary pre-built binaries/blobs 6. [X] Dependencies unvendored when available in Guix 7. [X] Cross-compile friendly (cc-for-target, patches with inputs) 8. [X] License matches source 9. [X] No problematic lints (guix lint package) 10. [X] Formatting follows guidelines - [X] Lines wrap at 80 characters - [X] Indentation passes etc/indent-code.el - [X] Two spaces used between sentences New packages: 11. [X] Source url is robust * mirror:// used with url-fetch when possible * No auto-generated archives from source repo (prefer cloning) 12. [X] Synopsis is short, descriptive, and meaningful to a wide audience 13. [X] Description is objective, takes 5-10 lines, uses full sentences, and provides the information users need to decide whether the software fits their needs. Stefan Reichör writes: > * gnu/packages/admin.scm (rset): New variable. > --- > gnu/packages/admin.scm | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > > diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm > index fdcbf28a6a..c17609c442 100644 > --- a/gnu/packages/admin.scm > +++ b/gnu/packages/admin.scm > @@ -3371,6 +3371,41 @@ Intel DRM Driver.") > (supported-systems '("i686-linux" "x86_64-linux")) > (license license:expat))) > > +(define-public rset > + (package > + (name "rset") > + (version "2.1") > + (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 "150my3lvql3m6jn1c12x81jx990nqh5g02v6r9a5j51ds39shr39")))) > + (build-system gnu-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (replace 'configure > + (lambda* (#:key outputs #:allow-other-keys) > + (invoke "./configure")))) > + #:make-flags > + (list (string-append "PREFIX=" (assoc-ref %outputs "out")) > + ,(string-append "CC=" (cc-for-target))) > + #:tests? #f)) ; TODO: test target requires ruby, curl, uname > + (home-page "http://scriptedconfiguration.org") > + (synopsis "Configure systems using any scripting language") > + (description > + "rset(1) operates by staging files on a remote system, then executing > +instructions embedded in the pln(5) files. Any interpreter capable of running > +scripts read over a pipe may be specified. The bundled utilities rinstall(1) > +and rsub(1) provide an easy 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 fabric > (package > (name "fabric") --- Sarah 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