From patchwork Thu Oct 6 16:39:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 43174 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 268DE27BBEA; Thu, 6 Oct 2022 18:36:48 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, 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 809E227BBE9 for ; Thu, 6 Oct 2022 18:36:47 +0100 (BST) Received: from localhost ([::1]:50700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogUne-0005Ya-L5 for patchwork@mira.cbaines.net; Thu, 06 Oct 2022 13:36:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogTul-0000uZ-6N for guix-patches@gnu.org; Thu, 06 Oct 2022 12:40:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogTuk-000216-UJ for guix-patches@gnu.org; Thu, 06 Oct 2022 12:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogTuk-0002ZD-Pd for guix-patches@gnu.org; Thu, 06 Oct 2022 12:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58339] [PATCH 1/2] gnu: Add guix-hello. References: <20221006163609.2280960-1-zimon.toutoune@gmail.com> In-Reply-To: <20221006163609.2280960-1-zimon.toutoune@gmail.com> Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Oct 2022 16:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58339 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58339@debbugs.gnu.org Cc: Efraim Flashner , zimoun Received: via spool by 58339-submit@debbugs.gnu.org id=B58339.16650743939840 (code B ref 58339); Thu, 06 Oct 2022 16:40:02 +0000 Received: (at 58339) by debbugs.gnu.org; 6 Oct 2022 16:39:53 +0000 Received: from localhost ([127.0.0.1]:33377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogTua-0002Yb-IP for submit@debbugs.gnu.org; Thu, 06 Oct 2022 12:39:52 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:36475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogTuW-0002YB-R7 for 58339@debbugs.gnu.org; Thu, 06 Oct 2022 12:39:49 -0400 Received: by mail-wr1-f53.google.com with SMTP id j7so3571937wrr.3 for <58339@debbugs.gnu.org>; Thu, 06 Oct 2022 09:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=5hd1zsUjzN4zgLFAE+R5oYL7ED+3i3nPHUYXzXElBAY=; b=L74f1rzZA+gLVuMXOOkAuglerWJ3RL9YLe2q49h37eMbM4RfuBitMl0W7QEOSNd85T UO4nd6CywnNf+seVrNf9uIz+a53sgJ6yflTgBKXf0aquOHs7ieqXqzQrm3c2CzCzOBzR lHtzZVtQOYgfsJgRPrJpDF2gxLR1A3AtAuhudyvTG51G5I2xgA36pF+aM5R+O3bvyzRc qjxBzpLzF/Vs7PHvOBthtOQvWtvBZ6DOnDlrHNwhzbWRkLG4vg8Jy2otBmdrzP0vP43Y g8HCrEojmjjRzEDXIdPmFvzR4Sl5meG2RbJCjtY3mzUt+N3v08khKfmYQ8BAFpniZd3r C3kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=5hd1zsUjzN4zgLFAE+R5oYL7ED+3i3nPHUYXzXElBAY=; b=KwYzMLILm28UdjbB8hIod56CAuv/b9VL1H+q04j/LDUEQlwK3pB/EKAgTVNuNerz7j T9CsU0Gjced05vqONnInltF90zaVB4Fo+uEjtGGuBqqOspnm+EheglAMPDMkpACgYmB3 fVMKftXuGU6e75sWdFnSE0dTcd6Pucqje3HukBKrktY8WTRiD4FsisqNV+DexIxwjUib 4YaxDhfXxY2C3Ap3uX0uBDCObzEDn8qnbS791fR0L9PQYCHpntBbmJ1MA1e+4BLRaBPf /MNDsmhQ1jCY6tGaPHnAibxCjTw24vKMJA8Xu4hGL7/5IRoHJ+OuGEcN4+g5RtshvAxP CDhw== X-Gm-Message-State: ACrzQf1efZEgqBUTc0EiQlOR2trW7M+qGDCwkXkYDT0cJl94Tnr6zC6i Ly3uhFe6PaSOCVcWjmnBFcf0BbzG8fk= X-Google-Smtp-Source: AMsMyM5iueP7SUwuOp5IbJvhlsYDu5MeiEt4+b+40Ognw2y0Z3pp5uIDfzI42VJGbbP8kWp5R5RVog== X-Received: by 2002:adf:a40c:0:b0:22e:47fe:7ea3 with SMTP id d12-20020adfa40c000000b0022e47fe7ea3mr567265wra.248.1665074382605; Thu, 06 Oct 2022 09:39:42 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id w3-20020a1cf603000000b003b95ed78275sm5592534wmc.20.2022.10.06.09.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 09:39:42 -0700 (PDT) From: zimoun Date: Thu, 6 Oct 2022 18:39:34 +0200 Message-Id: <20221006163935.2282212-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 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 From: Efraim Flashner * gnu/packages/guix-extensions.scm (guix-hello): New variable. * gnu/local.mk (GNU_SYSTEM_MODULES): Add guix-extensions. Co-authored-by: zimoun --- gnu/local.mk | 1 + gnu/packages/guix-extensions.scm | 60 ++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 gnu/packages/guix-extensions.scm diff --git a/gnu/local.mk b/gnu/local.mk index 5976cbe90c..7bf1c34995 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -299,6 +299,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/guile.scm \ %D%/packages/guile-wm.scm \ %D%/packages/guile-xyz.scm \ + %D%/packages/guix-extensions.scm \ %D%/packages/gv.scm \ %D%/packages/gxmessage.scm \ %D%/packages/hardware.scm \ diff --git a/gnu/packages/guix-extensions.scm b/gnu/packages/guix-extensions.scm new file mode 100644 index 0000000000..6294c15f3d --- /dev/null +++ b/gnu/packages/guix-extensions.scm @@ -0,0 +1,60 @@ +;;; Copyright © 2022 Efraim Flashner +;;; Copyright © 2022 Simon Tournier +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages guix-extensions) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:use-module (gnu packages base)) + +(define-public guix-hello + (package + (name "guix-hello") + (version "0") + (source #f) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let ((dest (string-append #$output + "/share/guix/extensions/hello.scm")) + (hello #$(this-package-input "hello"))) + (mkdir-p (dirname dest)) + (with-output-to-file dest + (lambda () + (format #t + "(define-module (guix extensions hello)~@ + #:use-module (guix scripts)~@ + #:export (guix-hello))~@ +~@ +(define-command (guix-hello . args)~@ + (category extension)~@ + (synopsis \"world\")~@ + (apply system* \"~a/bin/hello\" args))~%" + hello))))))) + (home-page "") ; Should be documentation location for GUIX_EXTENSIONS_PATH + (inputs + (list hello)) + (synopsis "Example of Guix sub-command extension") + (description "This Guix extension provides a shell redirection from +@code{guix hello} to @code{hello}.") + ;; The package definition is longer than the code; + ;; let this serve as the declaration of the license. + (license license:gpl3+)))