Subject: [bug#27790] text-editor: mg

From: ng0 <[email-masked]>
Date: Wed, 26 Jul 2017 14:30:20 +0000

Patches.

1: Update
2: Fetch via https
3: new phase to use our "diff"
-- 
ng0
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://n0is.noblogs.org/my-keys
https://www.infotropique.org https://krosos.org
From ff4bcddd0eeeb1de283ef0931ac73d698026d6c6 Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Wed, 26 Jul 2017 14:21:21 +0000
Subject: [PATCH 1/3] gnu: mg: Update to 20170401.

* gnu/packages/text-editors.scm (mg): Update to 20170401.
---
 gnu/packages/text-editors.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 756c2beab..7b9732ab8 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2016 Carlo Zancanaro <[email-masked]>
 ;;; Copyright © 2017 Eric Bavier <[email-masked]>
 ;;; Copyright © 2017 Feng Shu <[email-masked]>
-;;; Copyright © 2017 ng0 <[email-masked]>
+;;; Copyright © 2017 ng0 <[email-masked]>
 ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -234,14 +234,14 @@ Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings.  e3 can be used on
 (define-public mg
   (package
     (name "mg")
-    (version "20161005")
+    (version "20170401")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://homepage.boetes.org/software/mg/mg-"
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0qaydk2cy765n9clghmi5gdnpwn15y2v0fj6r0jcm0v7d89vbz5p"))
+                "1arasswgdadbb265rahq3867r9s54jva6k4m3p5n0f8mgjqhhdha"))
               (modules '((guix build utils)))
               (snippet
                '(begin
-- 
2.13.3

From e21e12416918266b7f3660b62ccd2784012c00f0 Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Wed, 26 Jul 2017 14:22:54 +0000
Subject: [PATCH 2/3] gnu: mg: Fetch source via HTTPS.

* gnu/packages/text-editors.scm (mg)[source]: Use HTTPS.
---
 gnu/packages/text-editors.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 7b9732ab8..7357df7fb 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -237,7 +237,7 @@ Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings.  e3 can be used on
     (version "20170401")
     (source (origin
               (method url-fetch)
-              (uri (string-append "http://homepage.boetes.org/software/mg/mg-"
+              (uri (string-append "https://homepage.boetes.org/software/mg/mg-"
                                   version ".tar.gz"))
               (sha256
                (base32
-- 
2.13.3

From cc80c01c3732f8881a05c6afea0fff363311ffa0 Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Wed, 26 Jul 2017 14:24:56 +0000
Subject: [PATCH 3/3] gnu: mg: Add new phase to find 'diff'.

* gnu/packages/text-editors.scm (mg)[phases]: Add new 'correct-location-of-difftool'.
---
 gnu/packages/text-editors.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 7357df7fb..7843c120a 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -261,6 +261,12 @@ Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings.  e3 can be used on
                           "CC=gcc")
        #:phases (modify-phases %standard-phases
                   (delete 'configure)
+                  (add-before 'build 'correct-location-of-difftool
+                    (lambda _
+                      (substitute* "buffer.c"
+                        (("/usr/bin/diff")
+                         (which "diff")))
+                      #t))
                   (add-before 'install 'patch-tutorial-location
                     (lambda* (#:key outputs #:allow-other-keys)
                       (substitute* "mg.1"
-- 
2.13.3