diff mbox series

[bug#70130] gnu: Add emacs-stgit-2.

Message ID PAXP251MB034804BA6AB148963B84A49EF33F2@PAXP251MB0348.EURP251.PROD.OUTLOOK.COM
State New
Headers show
Series [bug#70130] gnu: Add emacs-stgit-2. | expand

Commit Message

Sergio Pastor Pérez April 1, 2024, 7:54 p.m. UTC
* gnu/packages/emacs-xyz.scm (emacs-stgit-2): New variable.

Change-Id: I0231d35ae94ce26eb4a9e55f70d78ab33c5f03e3
---
 gnu/packages/emacs-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)


base-commit: 9e9ec741d0dc5ce58f8d21d31800ff2cafce128f

Comments

Christopher Baines April 15, 2024, 6:52 p.m. UTC | #1
Sergio Pastor Pérez <sergio.pastorperez@outlook.es> writes:

> * gnu/packages/emacs-xyz.scm (emacs-stgit-2): New variable.
>
> Change-Id: I0231d35ae94ce26eb4a9e55f70d78ab33c5f03e3
> ---
>  gnu/packages/emacs-xyz.scm | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
> index 977aa89729..4999048625 100644
> --- a/gnu/packages/emacs-xyz.scm
> +++ b/gnu/packages/emacs-xyz.scm
> @@ -7552,6 +7552,32 @@ (define-public emacs-standard-dirs
>  configuration, cache, and other data.")
>      (license license:gpl3+)))
>  
> +(define-public emacs-stgit-2
> +  (package
> +    (inherit stgit-2)

Package inheritance across modules is problomatic [1], which is probably
what's causing the issue with QA/the data service processing this.

You can avoid this by moving the package definition to the
version-control module where stgit-2 is defined.

1: https://guix.gnu.org/en/manual/devel/en/html_node/Cyclic-Module-Dependencies.html
diff mbox series

Patch

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 977aa89729..4999048625 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -7552,6 +7552,32 @@  (define-public emacs-standard-dirs
 configuration, cache, and other data.")
     (license license:gpl3+)))
 
+(define-public emacs-stgit-2
+  (package
+    (inherit stgit-2)
+    (name "emacs-stgit")
+    (build-system emacs-build-system)
+    (native-inputs '())
+    (inputs (list stgit-2 git))
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'chdir
+                     (lambda _
+                       (chdir "contrib")))
+                   (add-after 'chdir 'patch-paths
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (let ((stgit (search-input-file inputs "/bin/stg"))
+                             (git (search-input-file inputs "/bin/git")))
+                         (substitute* "stgit.el"
+                           (("\"stg\"")
+                            (string-append "\"" stgit "\""))
+                           (("\"git\"")
+                            (string-append "\"" git "\"")))))))))
+    (synopsis "Run Stgit within Emacs")
+    (description
+     "This package provides an Emacs-based interface to the Stgit.")))
+
 (define-public emacs-string-inflection
   (package
     (name "emacs-string-inflection")