GNU bug report logs - #58339
[PATCH 0/2] Add simple Guix extensions as example

Previous Next

Package: guix-patches;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Thu, 6 Oct 2022 16:37:01 UTC

Severity: normal

Tags: moreinfo, patch

Full log


View this message in rfc822 format

From: zimoun <zimon.toutoune <at> gmail.com>
To: 58339 <at> debbugs.gnu.org
Cc: zimoun <zimon.toutoune <at> gmail.com>
Subject: [bug#58339] [PATCH 2/2] gnu: Add guix-example.
Date: Thu,  6 Oct 2022 18:39:35 +0200
* gnu/packages/guix-extensions.scm (guix-example): New variable.
---
 gnu/packages/guix-extensions.scm | 39 +++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guix-extensions.scm b/gnu/packages/guix-extensions.scm
index 6294c15f3d..6541630ddd 100644
--- a/gnu/packages/guix-extensions.scm
+++ b/gnu/packages/guix-extensions.scm
@@ -19,7 +19,44 @@ (define-module (gnu packages guix-extensions)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix build-system trivial)
-  #:use-module (gnu packages base))
+  #:use-module (guix build-system guile)
+  #:use-module (guix git-download)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages package-management))
+
+(define-public guix-example
+  (let ((commit "d600bd742dae9df86e980a25cf1d0ac71ee01438")
+        (revision "0"))
+    (package
+      (name "guix-example")
+      (version (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://gitlab.com/zimoun/guix-example")
+               (commit commit)))
+         (file-name (string-append name version "-checkout"))
+         (sha256
+          (base32
+           "0s48b5a1i0vkx5lq7jn9b46zzqv2g3dli7b54sd9365dszqjqzmx"))))
+      (build-system guile-build-system)
+      (arguments
+       '(#:phases (modify-phases %standard-phases
+                    (add-after 'install 'move-to-extension-directory
+                      (lambda* (#:key outputs #:allow-other-keys)
+                        (let* ((out (assoc-ref outputs "out"))
+                               (target (string-append
+                                        out
+                                        "/share/guix/extensions/example.scm")))
+                          (mkdir-p (dirname target))
+                          (rename-file (car (find-files out "example.scm"))
+                                       target)))))))
+      (native-inputs (list (lookup-package-input guix "guile") guix))
+      (home-page "") ; Should be documentation location for GUIX_EXTENSIONS_PATH
+      (synopsis "Example of Guix sub-command extension")
+      (description "This Guix extension provides a simple example to extend Guix subcommands.")
+      (license license:gpl3+))))
 
 (define-public guix-hello
   (package
-- 
2.36.0





This bug report was last modified 2 years and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.