Subject: bug#57952: closed (Close patch)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 30 Sep 2022 10:41:02 +0000

Your bug report

#57952: [PATCH] gnu: Add guix-send-email.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
57952: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57952
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Close patch
From: Efraim Flashner <[email-masked]>
To: [email-masked]
Date: Fri, 30 Sep 2022 13:39:50 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

The consensus is that this would be part of a useful cookbook article,
but there are better options for the namespace of 'guix send-email'

-- 
Efraim Flashner   <[email-masked]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Subject: [PATCH] gnu: Add guix-send-email.
From: Efraim Flashner <[email-masked]>
To: [email-masked]
Cc: Efraim Flashner <[email-masked]>
Date: Tue, 20 Sep 2022 13:00:54 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/guix-extensions.scm (guix-send-email): New variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add guix-extensions.
---
 gnu/local.mk                     |  1 +
 gnu/packages/guix-extensions.scm | 62 ++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 gnu/packages/guix-extensions.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 238fb72bc5..ba28788776 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -295,6 +295,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..bb23b59de4
--- /dev/null
+++ b/gnu/packages/guix-extensions.scm
@@ -0,0 +1,62 @@
+;;; Copyright © 2022 Efraim Flashner <[email-masked]>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(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 version-control))
+
+(define-public guix-send-email
+  (package
+    (name "guix-send-email")
+    (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/send-email.scm"))
+                 (git            #$(this-package-input "git"))
+                 (git-send-email (assoc-ref %build-inputs "git:send-email")))
+             (mkdir-p (dirname dest))
+             (with-output-to-file dest
+               (lambda ()
+                 (format #t
+"(define-module (guix extensions send-email)~@
+                #:use-module (guix scripts)~@
+                #:export (guix-send-email))~@
+~@
+(define-command (guix-send-email . args)~@
+                (category extension)~@
+                (synopsis \"Replace 'guix send-email' with 'git send-email'\")~@
+                (setenv \"GIT_EXEC_PATH\" \"~a/libexec/git-core\")~@
+                (apply system* \"~a/bin/git\" \"send-email\" args))~%"
+                 git-send-email git)))))))
+    (home-page "")  ; Should be documentation location for GUIX_EXTENSIONS_PATH
+    (inputs
+     `(("git" ,git)
+       ("git:send-email" ,git "send-email")))
+    (synopsis "Replace @code{guix send-email} with @code{git send-email}")
+    (description "This Guix extension provides a shell redirect from @code{guix
+send-email} to @code{git send-email}.")
+    ;; The package definition is longer than the code;
+    ;; let this serve as the declaration of the license.
+    (license license:gpl3+)))

base-commit: 5a9e3b7c3981f684f601e2d21e8202223b384de9
-- 
2.37.3