diff mbox series

[bug#49581,v4] gnu: Add git-issues.

Message ID wir783gaPHI99iaqoN83Gb_1XkYO9jj_dD5vGi-EeiDKFF6hBEHbK1m7WcQOrD-g2QIsvnCrkWnwvx9IwlUlbmMK0GSjSCEr7lqTXAciXnI=@protonmail.com
State New
Headers show
Series [bug#49581,v4] gnu: Add git-issues. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

phodina Nov. 1, 2021, 8:21 p.m. UTC
Hi,

Thanks Sarah for the feedback and tips on how to wrap the programs in the shell script.

In fact the patch is almost done, but I couldn't figure out the correct procedure for the map on line 1324. I get that the list of strings should be mapped into paths to the binaries, but after struggling I gave up and found book about Scheme to learn first.

So here is the patch with the minor issue.

Hope this utility helps.

--8<---------------cut here---------------start------------->8---

Subject: [PATCH v4] gnu: Add git-issue.

* gnu/packages/version-control.scm (git-issue): New variable.

--
2.33.1

Comments

Giovanni Biscuolo Nov. 22, 2022, 5:38 p.m. UTC | #1
Hello phodina and Sarah,

please do you have some updates on this patch?

I can help testing if needed, tomorrow I'm going to test the v4 (the
last one) of your patch and will provide some feedback

Thanks! Gio'
diff mbox series

Patch

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 064212db9f..c685f2f4b5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -41,6 +41,7 @@ 
 ;;; Copyright © 2021 François J. <francois-oss@avalenn.eu>
 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -96,6 +97,7 @@  (define-module (gnu packages version-control)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages guile-xyz)
+  #:use-module (gnu packages haskell-apps)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mail)
@@ -1277,6 +1279,75 @@  (define-public git-flow
 lot easier.")
     (license license:bsd-2)))

+(define-public git-issue
+  (let ((commit "67aacad35888b4c51e2d7be35c86fef137874f12")
+        (revision "1"))
+    (package
+      (name "git-issue")
+      (version (git-version "0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri
+                 (git-reference
+                  (url "https://github.com/dspinellis/git-issue")
+                  (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1z6dpwbikmiq5acpbji4kvmxqc2jw995rfk5703k5mvp5ps9a29q"))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (delete 'build)
+           (add-before 'check 'setup-env
+             (lambda _
+               (setenv "HOME" (getenv "TMPDIR"))
+               (invoke "git" "config" "--global" "user.email" "test")
+               (invoke "git" "config" "--global" "user.name" "Test")
+               (substitute* "test.sh"
+                 (("! git diff") "git diff")
+                 (("#!/bin/sh") (string-append "#!" (which "bash")))
+                 (("gi=.*") (string-append "gi=" (getcwd) "/git-issue.sh\n")))
+               (substitute* "Makefile"
+                 (("shellcheck -x") "shellcheck --exclude=SC2001,SC3043,SC3003 -x"))))
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 (invoke "make" "test"))))
+           (add-before 'install 'patch-paths
+             (lambda* (#:key build-inputs #:allow-other-keys)
+               (let ((out (assoc-ref %outputs "out"))
+                     (paths (map
+                             (lambda (input)
+                               (string-append (assoc-ref build-inputs input) "/bin"))
+                             '("coreutils" "curl" "findutils"
+                               "git-minimal" "grep" "jq" "sed"))))
+                 (for-each
+                  (lambda (program)
+                    (wrap-program
+                        (string-append out "/" program)
+                      `("PATH" prefix ,paths)))
+                  '("bin/git-issue" "lib/git-issue/import-export.sh"))))))))
+      (native-inputs `(("shellcheck" ,shellcheck)))
+      (inputs `(("bash-minimal" ,bash-minimal)
+                ("git" ,git)
+                ("coreutils" ,coreutils)
+                ("grep" ,grep)
+                ("curl" ,curl)
+                ("findutils" ,findutils)
+                ("sed" ,sed)
+                ("util-linux" ,util-linux)
+                ("jq" ,jq)))
+      (synopsis "Git-based decentralized issue management")
+      (description "Git-issue provide a minimalist decentralized issue
+management system based on Git, offering (optional) bidirectional
+integration with GitHub and GitLab issue management.")
+      (home-page "https://github.com/dspinellis/git-issue")
+      (license license:gpl3+))))
+
 (define-public stgit
   (package
     (name "stgit")