Subject: Re: bug#26718: Update hexchat to 2.12.4

From: Julien Lepiller <[email-masked]>
Date: Mon, 1 May 2017 09:52:36 +0200

Le Sun, 30 Apr 2017 23:11:24 +0200,
Tobias Geerinckx-Rice <[email-masked]> a écrit :

> On 30/04/17 22:05, Leo Famulari wrote:
> > Then there are changes we make in order to port software to Guix or
> > make other relatively unimportant changes. If they can be done with
> > a sed-like / regex substitution, we do them in build phases. It's
> > helpful to keep them in Scheme, and we don't want to distribute
> > them via `guix build --source`.  
> 
> Ah, I never considered this as a Guix-related fix: shipping symlinks
> to /usr might happen to work on some (?) other systems, but it's
> obviously not how autotools should be used.
> 
> We should serve users with a --source tarball that is either already
> bootstrapped or ready to be, not in some dead-end third state.
> 
> The correct answer in either case is, of course: ‘it's a silly detail,
> Tobias’.
> 
> Kind regards,
> 
> T G-R
> 
Here's the updated patch.
From 1d631e557802e2392df5f744b22cbd8d732b31fa Mon Sep 17 00:00:00 2001
From: Julien Lepiller <[email-masked]>
Date: Sun, 30 Apr 2017 19:21:46 +0200
Subject: [PATCH] gnu: hexchat: Update to 2.12.4.

* gnu/packages/messaging.scm (hexchat): Update to 2.12.4.
---
 gnu/packages/messaging.scm | 35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 59e2b23d3..5754fb2d3 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <[email-masked]>
-;;; Copyright © 2014 Julien Lepiller <[email-masked]>
+;;; Copyright © 2014, 2017 Julien Lepiller <[email-masked]>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email-masked]>
 ;;; Copyright © 2015 Andreas Enge <[email-masked]>
 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <[email-masked]>
@@ -166,17 +166,35 @@ identi.ca and status.net).")
 (define-public hexchat
   (package
     (name "hexchat")
-    (version "2.12.2")
+    (version "2.12.4")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://dl.hexchat.net/hexchat/hexchat-"
                                   version ".tar.xz"))
               (sha256
                (base32
-                "1xnclfbrgbkqndxygi5f27q00jd7yy54jbd1061jmhxa6wzpibbd"))))
+                "0ficrx56knz5y297qb0x5y02339yvyv734z7kpcx1ixvb0qr2dgs"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Delete dangling symlinks to a non-existent ‘/usr’.
+                  (with-directory-excursion "m4"
+                    (for-each (lambda (f) (delete-file f))
+                              '("intltool.m4" "libtool.m4" "lt~obsolete.m4"
+                                "ltoptions.m4" "ltsugar.m4" "ltversion.m4")))
+                  (delete-file-recursively "build-aux")
+                  (delete-file "po/Makefile.in.in")
+                  ;; This file is still required for autoreconf.
+                  (copy-file (string-append (assoc-ref inputs "intltool")
+                                            "/share/intltool/Makefile.in.in")
+                             "po/Makefile.in.in")))))
     (build-system gnu-build-system)
-    (native-inputs `(("pkg-config" ,pkg-config)
-                     ("intltool" ,intltool)))
+    (native-inputs `(("autoconf" ,autoconf)
+                     ("autoconf-archive" ,autoconf-archive)
+                     ("automake" ,automake)
+                     ("intltool" ,intltool)
+                     ("libtool" ,libtool)
+                     ("pkg-config" ,pkg-config)))
     (inputs `(("dbus-glib" ,dbus-glib)
               ("dbus" ,dbus)
               ("enchant" ,enchant)
@@ -190,6 +208,13 @@ identi.ca and status.net).")
               ("luajit" ,luajit)
               ("perl-xml-parser" ,perl-xml-parser)
               ("python-2" ,python-2)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Release 2.12.4 wasn't properly bootstrapped.  Later ones might be!
+         (add-after 'unpack 'bootstrap
+           (lambda* (#:key inputs #:allow-other-keys)
+             (zero? (system* "autoreconf" "-fiv")))))))
     (synopsis "Graphical IRC Client")
     (description
      "HexChat lets you connect to multiple IRC networks at once.  The main
-- 
2.12.2