all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#44821] [PATCH v3] gnu: Add diff-so-fancy.
       [not found] <871rg5o26c.fsf@euandre.org>
@ 2020-12-04 20:08 ` EuAndreh via Guix-patches via
  2020-12-05  5:14   ` Leo Famulari
  0 siblings, 1 reply; 4+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-12-04 20:08 UTC (permalink / raw)
  To: eu; +Cc: 44821, leo

* gnu/packages/version-control.scm (diff-so-fancy): New variable.
---
Fixed the unnecessary propagated input as suggested.

I've also removed the copyright update, as is was already done on 
another patch.

 gnu/packages/version-control.scm | 46 ++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index a8e6d2c4b9..e8b5adef27 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -55,6 +55,7 @@
   #:use-module (guix git-download)
   #:use-module (guix hg-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system perl)
@@ -2811,6 +2812,51 @@ for historians.")
     (home-page "https://www.gnu.org/software/gnu-arch/")
     (license license:gpl2)))                      ;version 2 only
 
+(define-public diff-so-fancy
+  (package
+    (name "diff-so-fancy")
+    (version "1.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/so-fancy/diff-so-fancy")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0aavxahzha2mms4vdwysk79pa6wzswpfwgsq2hwaxnaf66maahfl"))))
+    (inputs
+     `(("perl" ,perl)
+       ("ncurses" ,ncurses)))
+    (build-system copy-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'symlink-executable
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (ncurses (assoc-ref inputs "ncurses"))
+                   (perl (assoc-ref inputs "perl")))
+               (mkdir (string-append out "/bin"))
+               ;; diff-so-fancy looks for lib/ under the directory
+               ;; it is in
+               (symlink (string-append out "/diff-so-fancy")
+                        (string-append out "/bin/diff-so-fancy"))
+               (wrap-program (string-append out "/diff-so-fancy")
+                 `("PATH" ":" prefix (,(string-append ncurses "/bin")
+                                      ,(string-append perl "/bin"))))
+               #t))))
+       #:install-plan
+       '(("lib" "lib")
+         ("diff-so-fancy" "diff-so-fancy"))))
+    (home-page "https://github.com/so-fancy/diff-so-fancy")
+    (synopsis "Makes diffs more human friendly and readable")
+    (description
+     "@code{diff-so-fancy} strives to make your diffs human readable instead
+of machine readable.  This helps improve code quality and helps you spot
+defects faster.")
+    (license license:expat)))
+
 (define-public go-github-go-git
   (package
     (name "go-github-go-git")
-- 
2.29.2





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#44821] [PATCH v3] gnu: Add diff-so-fancy.
  2020-12-04 20:08 ` [bug#44821] [PATCH v3] gnu: Add diff-so-fancy EuAndreh via Guix-patches via
@ 2020-12-05  5:14   ` Leo Famulari
  2020-12-05 11:55     ` [bug#44821] [PATCH v4] " EuAndreh via Guix-patches via
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Famulari @ 2020-12-05  5:14 UTC (permalink / raw)
  To: EuAndreh; +Cc: 44821

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

On Fri, Dec 04, 2020 at 05:08:27PM -0300, EuAndreh wrote:
> * gnu/packages/version-control.scm (diff-so-fancy): New variable.
> ---
> Fixed the unnecessary propagated input as suggested.

Thanks!

> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'install 'symlink-executable
> +           (lambda* (#:key outputs inputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out"))
> +                   (ncurses (assoc-ref inputs "ncurses"))
> +                   (perl (assoc-ref inputs "perl")))
> +               (mkdir (string-append out "/bin"))
> +               ;; diff-so-fancy looks for lib/ under the directory
> +               ;; it is in

I should have noticed it sooner but I think it's better to adjust how
diff-so-fancy finds the library than to work around this unusual
expectation.

I attached a revised patch that does this. Can you test if it works for
you?

It simplifies the symlink-executable phase, adds a patch-lib-path phase,
and adjusts the install-plan accordingly.

If it works then we should be done!

[-- Attachment #2: 0001-gnu-Add-diff-so-fancy.patch --]
[-- Type: text/plain, Size: 2810 bytes --]

From e2aa936812873408292c7c23e160cd5390e90a60 Mon Sep 17 00:00:00 2001
From: EuAndreh <eu@euandre.org>
Date: Fri, 4 Dec 2020 23:45:28 -0500
Subject: [PATCH] gnu: Add diff-so-fancy.

* gnu/packages/version-control.scm (diff-so-fancy): New variable.

Signed-off-by: Leo Famulari <leo@famulari.name>
---
 gnu/packages/version-control.scm | 47 ++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index eec57b3b6d..da04fdcb93 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -2812,6 +2812,53 @@ for historians.")
     (home-page "https://www.gnu.org/software/gnu-arch/")
     (license license:gpl2)))                      ;version 2 only
 
+(define-public diff-so-fancy
+  (package
+    (name "diff-so-fancy")
+    (version "1.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/so-fancy/diff-so-fancy")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0aavxahzha2mms4vdwysk79pa6wzswpfwgsq2hwaxnaf66maahfl"))))
+    (inputs
+     `(("perl" ,perl)
+       ("ncurses" ,ncurses)))
+    (build-system copy-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-lib-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
+               (substitute* "diff-so-fancy"
+                 (("use lib.*$")
+                  (string-append "use lib " lib "\n")))
+               #t)))
+         (add-after 'install 'symlink-executable
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (ncurses (assoc-ref inputs "ncurses"))
+                   (perl (assoc-ref inputs "perl")))
+               (wrap-program (string-append out "/bin/diff-so-fancy")
+                 `("PATH" ":" prefix (,(string-append ncurses "/bin")
+                                      ,(string-append perl "/bin"))))
+               #t))))
+       #:install-plan
+       '(("lib" "lib")
+         ("diff-so-fancy" "bin/"))))
+    (home-page "https://github.com/so-fancy/diff-so-fancy")
+    (synopsis "Makes diffs more human friendly and readable")
+    (description
+     "@code{diff-so-fancy} strives to make your diffs human readable instead
+of machine readable.  This helps improve code quality and helps you spot
+defects faster.")
+    (license license:expat)))
+
 (define-public go-github-go-git
   (package
     (name "go-github-go-git")
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#44821] [PATCH v4] gnu: Add diff-so-fancy.
  2020-12-05  5:14   ` Leo Famulari
@ 2020-12-05 11:55     ` EuAndreh via Guix-patches via
  2020-12-05 17:56       ` bug#44821: " Leo Famulari
  0 siblings, 1 reply; 4+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-12-05 11:55 UTC (permalink / raw)
  To: leo; +Cc: 44821

From: Leo Famulari <leo@famulari.name>

* gnu/packages/version-control.scm (diff-so-fancy): New variable.
---
Thanks for the revised patch. The only thing missing was the proper
escaping of the substituted path:
  (string-append "use lib '" lib "';\n")))

The lib path had to be between quotes, with a final semicolon.

I've taken yours and only fixed this part. I've tested it, and it works.

 gnu/packages/version-control.scm | 47 ++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index eec57b3b6d..12e708e4e8 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -2812,6 +2812,53 @@ for historians.")
     (home-page "https://www.gnu.org/software/gnu-arch/")
     (license license:gpl2)))                      ;version 2 only
 
+(define-public diff-so-fancy
+  (package
+    (name "diff-so-fancy")
+    (version "1.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/so-fancy/diff-so-fancy")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0aavxahzha2mms4vdwysk79pa6wzswpfwgsq2hwaxnaf66maahfl"))))
+    (inputs
+     `(("perl" ,perl)
+       ("ncurses" ,ncurses)))
+    (build-system copy-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-lib-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
+               (substitute* "diff-so-fancy"
+                 (("use lib.*$")
+                  (string-append "use lib '" lib "';\n")))
+               #t)))
+         (add-after 'install 'symlink-executable
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (ncurses (assoc-ref inputs "ncurses"))
+                   (perl (assoc-ref inputs "perl")))
+               (wrap-program (string-append out "/bin/diff-so-fancy")
+                 `("PATH" ":" prefix (,(string-append ncurses "/bin")
+                                      ,(string-append perl "/bin"))))
+               #t))))
+       #:install-plan
+       '(("lib" "lib")
+         ("diff-so-fancy" "bin/"))))
+    (home-page "https://github.com/so-fancy/diff-so-fancy")
+    (synopsis "Makes diffs more human friendly and readable")
+    (description
+     "@code{diff-so-fancy} strives to make your diffs human readable instead
+of machine readable.  This helps improve code quality and helps you spot
+defects faster.")
+    (license license:expat)))
+
 (define-public go-github-go-git
   (package
     (name "go-github-go-git")
-- 
2.29.2





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#44821: [PATCH v4] gnu: Add diff-so-fancy.
  2020-12-05 11:55     ` [bug#44821] [PATCH v4] " EuAndreh via Guix-patches via
@ 2020-12-05 17:56       ` Leo Famulari
  0 siblings, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2020-12-05 17:56 UTC (permalink / raw)
  To: EuAndreh; +Cc: 44821-done

On Sat, Dec 05, 2020 at 08:55:42AM -0300, EuAndreh wrote:
> From: Leo Famulari <leo@famulari.name>
> 
> * gnu/packages/version-control.scm (diff-so-fancy): New variable.
> ---
> Thanks for the revised patch. The only thing missing was the proper
> escaping of the substituted path:
>   (string-append "use lib '" lib "';\n")))
> 
> The lib path had to be between quotes, with a final semicolon.
> 
> I've taken yours and only fixed this part. I've tested it, and it works.

Great! Pushed as 32a3367930844b242b57ea634c2de43e4ea3b57b




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-05 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <871rg5o26c.fsf@euandre.org>
2020-12-04 20:08 ` [bug#44821] [PATCH v3] gnu: Add diff-so-fancy EuAndreh via Guix-patches via
2020-12-05  5:14   ` Leo Famulari
2020-12-05 11:55     ` [bug#44821] [PATCH v4] " EuAndreh via Guix-patches via
2020-12-05 17:56       ` bug#44821: " Leo Famulari

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.