aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinglu Chen <public@yoctocell.xyz>2021-05-25 13:46:04 +0200
committerXinglu Chen <public@yoctocell.xyz>2021-05-25 13:46:04 +0200
commit693191fd688d75aaa81d613eb337ae637b63dc50 (patch)
tree5d40ae8199559446e355edeaa249362fcca9fcf4
parent585f1487d6e4bbeea54741949922e85cc30baf90 (diff)
Rewrite Guix package definition
* git-email.scm: Rename to ... * guix.scm: ... this, and remove the package for the stable release. I will hopefully get around to package it in Guix proper someday... * doc/git-email.texi (Installation): Add node for installing with Guix. (Contributing): Add instructions for creating a development environment with Guix. Signed-off-by: Xinglu Chen <public@yoctocell.xyz>
-rw-r--r--doc/git-email.texi15
-rw-r--r--git-email.scm103
-rw-r--r--guix.scm87
3 files changed, 100 insertions, 105 deletions
diff --git a/doc/git-email.texi b/doc/git-email.texi
index 72c4592..d581656 100644
--- a/doc/git-email.texi
+++ b/doc/git-email.texi
@@ -116,8 +116,10 @@ should checkout @uref{https://git.kyleam.com/piem, piem}.
@node Installation
@chapter Installation
-You can install it by cloning this repo and adding @samp{git-email} to
-your @samp{load-path}.
+@samp{git-email} is not yet available in any package repositories, so
+you have to install it manually by cloning the Git repo and adding @samp{git-email} to
+your @code{load-path}. Or, you can install it using one of the options
+listed below.
@menu
* Nix::
@@ -148,6 +150,11 @@ You can install the package with
nix profile install "git+https://git.sr.ht/~yoctocell/git-email#git-email@{-full-git,-git@}"
@end example
+@node Guix
+
+You can install git-email with guix by running @command{guix install
+--install-from-file=guix.scm}.
+
@node Usage
@chapter Usage
@@ -336,6 +343,10 @@ You are welcome to send patches and bug reports to the
@uref{https://lists.sr.ht/~yoctocell/git-email-devel, git-email-devel}
mailing list.
+If you are using @uref{https://guix.gnu.org/, GNU Guix}, you can create
+a development environment by running @command{guix environment
+--load=guix.scm} (see the @file{guix.scm} file for more details).
+
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include fdl-1.3.texi
diff --git a/git-email.scm b/git-email.scm
deleted file mode 100644
index e6d804f..0000000
--- a/git-email.scm
+++ /dev/null
@@ -1,103 +0,0 @@
-;;; Guix package definition for git-email
-;;;
-;;; Copyright (C) 2021 all contributors <~yoctocell/git-email-devel@lists.sr.ht>
-;;;
-;;; This program 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.
-;;;
-;;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
-
-(define-module (git-email)
- #:use-module (guix packages)
- #:use-module (guix build utils)
- #:use-module (guix build-system emacs)
- #:use-module (guix gexp)
- #:use-module (guix git-download)
- #:use-module ((guix licenses) #:prefix license:)
- #:use-module (gnu packages version-control)
- #:use-module (gnu packages mail)
- #:use-module (gnu packages texinfo)
- #:use-module (gnu packages emacs)
- #:use-module (gnu packages emacs-xyz)
- #:use-module (ice-9 popen)
- #:use-module (ice-9 rdelim))
-
-;;; Commentary:
-;;;
-;;; This file contains package definitinons for git-email. One is for
-;;; the stable release, the other for the development version.
-;;;
-;;; Code:
-
-;;; Stable release
-
-(define-public git-email
- (package
- (name "git-email")
- (version "0.2.0")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://git.sr.ht/~yoctocell/git-email")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32 "09vmh3x1rjxxl9g9p01afil1zlpk7rf0pjmzyvcbid9wczyllkhq"))
- ;; (modules '((guix build utils)))
- (snippet
- ;; Not yet in Guix proper
- '(delete-file "git-email-piem.el"))))
- (build-system emacs-build-system)
- (propagated-inputs
- `(("emacs" ,emacs)
- ("emacs-magit" ,emacs-magit)
- ("notmuch" ,notmuch)))
- (license license:gpl3+)
- (home-page "https://sr.ht/~yoctocell/git-email")
- (synopsis "Integrate git with email")
- (description "git-email provides functions for formatting and sending Git patches
-via email, without leaving Emacs.")))
-
-
-;;; Development version
-
-(define %source-dir
- (dirname (current-filename)))
-
-;; Copied from guile-daemon.
-(define (git-output . args)
- "Execute 'git ARGS ...' command and return its output without trailing
-newspace."
- (with-directory-excursion %source-dir
- (let* ((port (apply open-pipe* OPEN_READ "git" args))
- (output (read-string port)))
- (close-port port)
- (string-trim-right output #\newline))))
-
-;; (define-public git-email-dev
-;; (let ((commit (git-output "rev-parse" "--short" "HEAD")))
-;; (package
-;; (inherit git-email)
-;; (name "git-email-dev")
-;; (version (git-version "0.2.0" "0" commit))
-;; (source (local-file %source-dir
-;; #:recursive? #t
-;; #:select? (git-predicate %source-dir)))
-;; (native-inputs
-;; `(("texinfo" ,texinfo)))
-;; (propagated-inputs
-;; `(("emacs" ,emacs)
-;; ("emacs-magit" ,emacs-magit)
-;; ("notmuch" ,notmuch)
-;; ,@(package-propagated-inputs git-email))))))
-
-
diff --git a/guix.scm b/guix.scm
new file mode 100644
index 0000000..068aa81
--- /dev/null
+++ b/guix.scm
@@ -0,0 +1,87 @@
+;;; Guix package definition for git-email
+;;;
+;;; Copyright (C) 2021 all contributors <~yoctocell/git-email-devel@lists.sr.ht>
+;;;
+;;; This program 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.
+;;;
+;;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+(use-modules (guix packages)
+ (guix build utils)
+ (guix build-system emacs)
+ (guix gexp)
+ (guix profiles)
+ (guix git-download)
+ ((guix licenses) #:prefix license:)
+ (gnu packages version-control)
+ (gnu packages mail)
+ (gnu packages texinfo)
+ (gnu packages emacs)
+ (gnu packages emacs-xyz)
+ (gnu packages base)
+ (ice-9 popen)
+ (ice-9 rdelim))
+
+;;; Commentary:
+;;;
+;;; This file contains the package definitinon for git-email. Run
+;;; `guix environment --load=guix.scm' to create a development
+;;; environment.
+;;;
+;;; Code:
+
+(define* (git-output source-dir #:rest args)
+ "Execute 'git ARGS ...' command and return its output without trailing
+newspace."
+ (with-directory-excursion source-dir
+ (let* ((port (apply open-pipe* OPEN_READ "git" args))
+ (output (read-string port)))
+ (close-port port)
+ (string-trim-right output #\newline))))
+
+(define (current-commit source-dir)
+ (git-output source-dir "rev-parse" "HEAD"))
+
+(define-public git-email-dev
+ (let* ((source-dir (dirname (current-filename)))
+ (commit (current-commit source-dir))
+ (revision "0"))
+ (package
+ (name "git-email-dev")
+ (version (git-version "0.2.0" revision commit))
+ (source (local-file source-dir
+ #:recursive? #t
+ #:select? (git-predicate source-dir)))
+ (build-system emacs-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ ;; piem is not yet packaged in Guix.
+ (add-after 'unpack 'remove-piem
+ (lambda _
+ (delete-file "git-email-piem.el")))
+ (add-before 'install 'makeinfo
+ (lambda _
+ (invoke "makeinfo" "doc/git-email.texi"))))))
+ (native-inputs
+ `(("texinfo" ,texinfo)))
+ (propagated-inputs
+ `(("emacs" ,emacs)
+ ("emacs-magit" ,emacs-magit)
+ ("notmuch" ,notmuch)))
+ (license license:gpl3+)
+ (home-page "https://sr.ht/~yoctocell/git-email")
+ (synopsis "Format and send Git patches in Emacs")
+ (description "This package provides utilities for formatting and
+sending Git patches via Email, without leaving Emacs."))))
+
+git-email-dev