GNU bug report logs -
#44821
[PATCH] gnu: Add diff-so-fancy.
Previous Next
Reported by: EuAndreh <eu <at> euandre.org>
Date: Mon, 23 Nov 2020 17:16:01 UTC
Severity: normal
Tags: patch
Done: Leo Famulari <leo <at> famulari.name>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44821 in the body.
You can then email your comments to 44821 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Mon, 23 Nov 2020 17:16:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
EuAndreh <eu <at> euandre.org>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Mon, 23 Nov 2020 17:16:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/version-control.scm (diff-so-fancy): New variable.
---
gnu/packages/version-control.scm | 40 ++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1842528ff6..7d64b6440c 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)
@@ -2775,6 +2776,45 @@ 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)))
+ (build-system copy-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'symlink-executable
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (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"))
+ #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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Mon, 23 Nov 2020 19:01:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 44821 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/version-control.scm (diff-so-fancy): New variable.
---
Differs from previous patch by having ncurses as a propagated input.
gnu/packages/version-control.scm | 42 ++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1842528ff6..708f24437d 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)
@@ -2775,6 +2776,47 @@ 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)))
+ (propagated-inputs
+ `(("ncurses" ,ncurses)))
+ (build-system copy-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'symlink-executable
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (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"))
+ #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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Mon, 23 Nov 2020 19:48:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 44821 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/version-control.scm (diff-so-fancy): New variable.
---
Now also update copyright notice.
gnu/packages/version-control.scm | 44 +++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1842528ff6..900f233483 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
;;; Copyright © 2017 Vasile Dumitrascu <va511e <at> yahoo.com>
;;; Copyright © 2017 Clément Lassieur <clement <at> lassieur.org>
-;;; Copyright © 2017 André <eu <at> euandre.org>
+;;; Copyright © 2017, 2020 EuAndreh <eu <at> euandre.org>
;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke <at> fastmail.com>
;;; Copyright © 2017 Stefan Reichör <stefan <at> xsteve.at>
;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust <at> gmail.com>
@@ -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)
@@ -2775,6 +2776,47 @@ 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)))
+ (propagated-inputs
+ `(("ncurses" ,ncurses)))
+ (build-system copy-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'symlink-executable
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (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"))
+ #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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Wed, 25 Nov 2020 23:09:02 GMT)
Full text and
rfc822 format available.
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
On Mon, Nov 23, 2020 at 03:59:50PM -0300, EuAndreh via Guix-patches via wrote:
> * gnu/packages/version-control.scm (diff-so-fancy): New variable.
> ---
> Differs from previous patch by having ncurses as a propagated input.
It's impractical to propagate ncurses — ncurses is very widely used and
this will cause "profile conflicts" if anyone tries to make a profile
that refers to multiple versions of ncurses.
Is there any way to make the built package refer explicitly to the
ncurses store directory, so that it can be a regular input?
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Wed, 25 Nov 2020 23:09:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Thu, 26 Nov 2020 15:21:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 44821 <at> debbugs.gnu.org (full text, mbox):
Leo Famulari <leo <at> famulari.name> writes:
> It's impractical to propagate ncurses — ncurses is very widely used and
> this will cause "profile conflicts" if anyone tries to make a profile
> that refers to multiple versions of ncurses.
>
> Is there any way to make the built package refer explicitly to the
> ncurses store directory, so that it can be a regular input?
I'm not sure. How could I accomplish that?
I put ncurses as a propagates input because diff-so-fancy relies on it
for the execution.
Maybe a "(wrap-program ...)" could solve that? I think it would solve
the problem you raised, right?
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Thu, 26 Nov 2020 19:01:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 44821 <at> debbugs.gnu.org (full text, mbox):
On Thu, Nov 26, 2020 at 12:20:17PM -0300, EuAndreh wrote:
> Leo Famulari <leo <at> famulari.name> writes:
>
> > It's impractical to propagate ncurses — ncurses is very widely used and
> > this will cause "profile conflicts" if anyone tries to make a profile
> > that refers to multiple versions of ncurses.
> >
> > Is there any way to make the built package refer explicitly to the
> > ncurses store directory, so that it can be a regular input?
>
> I'm not sure. How could I accomplish that?
>
> I put ncurses as a propagates input because diff-so-fancy relies on it
> for the execution.
>
> Maybe a "(wrap-program ...)" could solve that? I think it would solve
> the problem you raised, right?
Yes, perhaps, or you could substitute the calls to ncurses with the full
store path of the ncurses executable.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Thu, 26 Nov 2020 20:01:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 44821 <at> debbugs.gnu.org (full text, mbox):
Leo Famulari <leo <at> famulari.name> writes:
> Yes, perhaps, or you could substitute the calls to ncurses with the full
> store path of the ncurses executable.
How would I do that? With a (substitute* ... (which "xdg-open"))?
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Thu, 03 Dec 2020 22:15:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 44821 <at> debbugs.gnu.org (full text, mbox):
Hi,
EuAndreh <eu <at> euandre.org> skribis:
> Leo Famulari <leo <at> famulari.name> writes:
>
>> Yes, perhaps, or you could substitute the calls to ncurses with the full
>> store path of the ncurses executable.
>
> How would I do that? With a (substitute* ... (which "xdg-open"))?
Yes, something like that. Note that ‘xdg-open’ does not come from the
‘ncurses’ package though.
Let’s chat on IRC if anything’s unclear!
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Fri, 04 Dec 2020 18:28:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 44821 <at> debbugs.gnu.org (full text, mbox):
Ludovic Courtès <ludo <at> gnu.org> writes:
> Yes, something like that. Note that ‘xdg-open’ does not come from the
> ‘ncurses’ package though.
>
> Let’s chat on IRC if anything’s unclear!
I got the gist, but just didn't stop to work on it yet. I will soon :)
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Fri, 04 Dec 2020 20:09:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 44821 <at> debbugs.gnu.org (full text, mbox):
* 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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Sat, 05 Dec 2020 05:15:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 44821 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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!
[0001-gnu-Add-diff-so-fancy.patch (text/plain, attachment)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#44821
; Package
guix-patches
.
(Sat, 05 Dec 2020 11:56:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 44821 <at> debbugs.gnu.org (full text, mbox):
From: Leo Famulari <leo <at> 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
Reply sent
to
Leo Famulari <leo <at> famulari.name>
:
You have taken responsibility.
(Sat, 05 Dec 2020 17:58:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
EuAndreh <eu <at> euandre.org>
:
bug acknowledged by developer.
(Sat, 05 Dec 2020 17:58:02 GMT)
Full text and
rfc822 format available.
Message #46 received at 44821-done <at> debbugs.gnu.org (full text, mbox):
On Sat, Dec 05, 2020 at 08:55:42AM -0300, EuAndreh wrote:
> From: Leo Famulari <leo <at> 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
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 03 Jan 2021 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.