unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#44821] [PATCH] gnu: Add diff-so-fancy.
@ 2020-11-23 17:14 EuAndreh via Guix-patches via
  2020-11-23 18:59 ` [bug#44821] [PATCH v2] " EuAndreh via Guix-patches via
  2020-11-23 19:47 ` [bug#44821] [PATCH] " EuAndreh via Guix-patches via
  0 siblings, 2 replies; 9+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-11-23 17:14 UTC (permalink / raw)
  To: 44821; +Cc: EuAndreh

* 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





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

* [bug#44821] [PATCH v2] gnu: Add diff-so-fancy.
  2020-11-23 17:14 [bug#44821] [PATCH] gnu: Add diff-so-fancy EuAndreh via Guix-patches via
@ 2020-11-23 18:59 ` EuAndreh via Guix-patches via
  2020-11-25 23:08   ` Leo Famulari
  2020-11-23 19:47 ` [bug#44821] [PATCH] " EuAndreh via Guix-patches via
  1 sibling, 1 reply; 9+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-11-23 18:59 UTC (permalink / raw)
  To: 44821; +Cc: EuAndreh

* 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





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

* [bug#44821] [PATCH] gnu: Add diff-so-fancy.
  2020-11-23 17:14 [bug#44821] [PATCH] gnu: Add diff-so-fancy EuAndreh via Guix-patches via
  2020-11-23 18:59 ` [bug#44821] [PATCH v2] " EuAndreh via Guix-patches via
@ 2020-11-23 19:47 ` EuAndreh via Guix-patches via
  1 sibling, 0 replies; 9+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-11-23 19:47 UTC (permalink / raw)
  To: 44821; +Cc: EuAndreh

* 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@tobias.gr>
 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
-;;; Copyright © 2017 André <eu@euandre.org>
+;;; Copyright © 2017, 2020 EuAndreh <eu@euandre.org>
 ;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
 ;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@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





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

* [bug#44821] [PATCH v2] gnu: Add diff-so-fancy.
  2020-11-23 18:59 ` [bug#44821] [PATCH v2] " EuAndreh via Guix-patches via
@ 2020-11-25 23:08   ` Leo Famulari
  2020-11-26 15:20     ` EuAndreh via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2020-11-25 23:08 UTC (permalink / raw)
  To: 44821; +Cc: eu

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?




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

* [bug#44821] [PATCH v2] gnu: Add diff-so-fancy.
  2020-11-25 23:08   ` Leo Famulari
@ 2020-11-26 15:20     ` EuAndreh via Guix-patches via
  2020-11-26 19:00       ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-11-26 15:20 UTC (permalink / raw)
  To: Leo Famulari, 44821

Leo Famulari <leo@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?




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

* [bug#44821] [PATCH v2] gnu: Add diff-so-fancy.
  2020-11-26 15:20     ` EuAndreh via Guix-patches via
@ 2020-11-26 19:00       ` Leo Famulari
  2020-11-26 19:44         ` EuAndreh via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2020-11-26 19:00 UTC (permalink / raw)
  To: EuAndreh; +Cc: 44821

On Thu, Nov 26, 2020 at 12:20:17PM -0300, EuAndreh wrote:
> Leo Famulari <leo@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.




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

* [bug#44821] [PATCH v2] gnu: Add diff-so-fancy.
  2020-11-26 19:00       ` Leo Famulari
@ 2020-11-26 19:44         ` EuAndreh via Guix-patches via
  2020-12-03 22:14           ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-11-26 19:44 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 44821

Leo Famulari <leo@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"))?




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

* [bug#44821] [PATCH v2] gnu: Add diff-so-fancy.
  2020-11-26 19:44         ` EuAndreh via Guix-patches via
@ 2020-12-03 22:14           ` Ludovic Courtès
  2020-12-03 23:16             ` EuAndreh via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2020-12-03 22:14 UTC (permalink / raw)
  To: EuAndreh; +Cc: 44821, Leo Famulari

Hi,

EuAndreh <eu@euandre.org> skribis:

> Leo Famulari <leo@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’.




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

* [bug#44821] [PATCH v2] gnu: Add diff-so-fancy.
  2020-12-03 22:14           ` Ludovic Courtès
@ 2020-12-03 23:16             ` EuAndreh via Guix-patches via
  0 siblings, 0 replies; 9+ messages in thread
From: EuAndreh via Guix-patches via @ 2020-12-03 23:16 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 44821, , Leo Famulari

Ludovic Courtès <ludo@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 :)




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

end of thread, other threads:[~2020-12-04 20:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 17:14 [bug#44821] [PATCH] gnu: Add diff-so-fancy EuAndreh via Guix-patches via
2020-11-23 18:59 ` [bug#44821] [PATCH v2] " EuAndreh via Guix-patches via
2020-11-25 23:08   ` Leo Famulari
2020-11-26 15:20     ` EuAndreh via Guix-patches via
2020-11-26 19:00       ` Leo Famulari
2020-11-26 19:44         ` EuAndreh via Guix-patches via
2020-12-03 22:14           ` Ludovic Courtès
2020-12-03 23:16             ` EuAndreh via Guix-patches via
2020-11-23 19:47 ` [bug#44821] [PATCH] " EuAndreh via Guix-patches via

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).