From patchwork Tue Dec 21 10:27:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 35509 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 29EB527BBEA; Tue, 21 Dec 2021 10:28:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A09F227BBE9 for ; Tue, 21 Dec 2021 10:28:09 +0000 (GMT) Received: from localhost ([::1]:35960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzcNM-0000We-QV for patchwork@mira.cbaines.net; Tue, 21 Dec 2021 05:28:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzcNH-0000WT-99 for guix-patches@gnu.org; Tue, 21 Dec 2021 05:28:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzcNH-0000RZ-0T for guix-patches@gnu.org; Tue, 21 Dec 2021 05:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzcNG-0004Ez-Jb for guix-patches@gnu.org; Tue, 21 Dec 2021 05:28:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52699] [PATCH] gnu: Add nar-herder. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Dec 2021 10:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52699 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52699@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164008244116234 (code B ref -1); Tue, 21 Dec 2021 10:28:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2021 10:27:21 +0000 Received: from localhost ([127.0.0.1]:52444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzcMb-0004Dm-Et for submit@debbugs.gnu.org; Tue, 21 Dec 2021 05:27:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:37600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzcMX-0004DZ-OK for submit@debbugs.gnu.org; Tue, 21 Dec 2021 05:27:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzcMX-0000UG-HN for guix-patches@gnu.org; Tue, 21 Dec 2021 05:27:17 -0500 Received: from mira.cbaines.net ([212.71.252.8]:56408) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzcMV-0000Pg-O2 for guix-patches@gnu.org; Tue, 21 Dec 2021 05:27:17 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 561CC27BBE9 for ; Tue, 21 Dec 2021 10:27:12 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 031baa00 for ; Tue, 21 Dec 2021 10:27:11 +0000 (UTC) From: Christopher Baines Date: Tue, 21 Dec 2021 10:27:11 +0000 Message-Id: <20211221102711.30382-1-mail@cbaines.net> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 * gnu/packages/package-management.scm (nar-herder): New variable. --- gnu/packages/package-management.scm | 109 ++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 12736c6caf..feb56f2a9b 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -1441,6 +1441,115 @@ (define-public guix-jupyter in an isolated environment, in separate namespaces.") (license license:gpl3+))) +(define-public nar-herder + (let ((commit "049dfec287fa948cac6682d0a047bc0ed356f0bf") + (revision "1")) + (package + (name "nar-herder") + (version (git-version "0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.cbaines.net/git/guix/nar-herder") + (commit commit))) + (sha256 + (base32 + "1bkn6avcyp2rcrqaync65b8yn9dvxlkjpk3mdk5nsy527dzhs5ws")) + (file-name (string-append name "-" version "-checkout")))) + (build-system gnu-build-system) + (arguments + `(#:modules (((guix build guile-build-system) + #:select (target-guile-effective-version)) + ,@%gnu-build-system-modules) + #:imported-modules ((guix build guile-build-system) + ,@%gnu-build-system-modules) + #:phases + (modify-phases %standard-phases + (add-before 'build 'set-GUILE_AUTO_COMPILE + (lambda _ + ;; To avoid warnings relating to 'guild'. + (setenv "GUILE_AUTO_COMPILE" "0") + #t)) + (add-after 'install 'wrap-executable + (lambda* (#:key inputs outputs target #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (guile (assoc-ref inputs "guile")) + (version (target-guile-effective-version)) + (scm (string-append out "/share/guile/site/" version)) + (go (string-append out "/lib/guile/" version "/site-ccache"))) + (for-each + (lambda (file) + (simple-format (current-error-port) "wrapping: ~A\n" file) + (let ((guile-inputs (list + "guile-json" + "guile-gcrypt" + "guix" + "guile-lib" + "guile-sqlite3" + "gnutls" + "guile-fibers"))) + (wrap-program file + `("GUILE_LOAD_PATH" ":" prefix + (,scm ,(string-join + (map (lambda (input) + (simple-format + #f "~A/share/guile/site/~A" + (assoc-ref inputs input) + version)) + guile-inputs) + ":"))) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix + (,go ,(string-join + (map (lambda (input) + (simple-format + #f "~A/lib/guile/~A/site-ccache" + (assoc-ref inputs input) + version)) + guile-inputs) + ":")))))) + (find-files bin))) + #t)) + (delete 'strip)))) ; As the .go files aren't compatible + (native-inputs + (list pkg-config + autoconf + automake + gnutls + + ;; Guile libraries are needed here for cross-compilation. + guile-3.0 + guile-json-4 + guile-gcrypt + guix + guile-fibers + guile-lib + guile-sqlite3)) + (inputs + (list bash-minimal + guile-3.0)) + (propagated-inputs + (list guile-json-4 + guile-gcrypt + guix + guile-fibers + guile-lib + guile-sqlite3 + gnutls)) + (home-page "https://git.cbaines.net/guix/nar-herder") + (synopsis "Utility for managing and serving nars") + (description + "The Nar Herder is a utility for managing a collection of +nars (normalized archives, in the context of Guix) along with the +corresponding narinfo files which contain some signed metadata. + +It can assist in serving a collection of nars, moving them between machines, +or mirroring an existing collection of nars. + +It's currently a working prototype, many designed features aren't implemented, +and the error handling is very rough.") + (license license:gpl3+)))) + (define-public gcab (package (name "gcab")