all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: EuAndreh via Guix-patches via <guix-patches@gnu.org>
To: leo@famulari.name
Cc: 44821@debbugs.gnu.org
Subject: [bug#44821] [PATCH v4] gnu: Add diff-so-fancy.
Date: Sat,  5 Dec 2020 08:55:42 -0300	[thread overview]
Message-ID: <20201205115542.15427-1-eu@euandre.org> (raw)
In-Reply-To: <X8sXOwVL9R7NbBAS@jasmine.lan>

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





  reply	other threads:[~2020-12-05 11:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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     ` EuAndreh via Guix-patches via [this message]
2020-12-05 17:56       ` bug#44821: [PATCH v4] " Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201205115542.15427-1-eu@euandre.org \
    --to=guix-patches@gnu.org \
    --cc=44821@debbugs.gnu.org \
    --cc=eu@euandre.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.