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

From: Julien Lepiller <[email-masked]>
Date: Sat, 6 May 2017 23:08:34 +0200

Le Sat, 6 May 2017 15:55:18 -0400,
Leo Famulari <[email-masked]> a écrit :

> On Fri, May 05, 2017 at 04:21:57PM -0400, Leo Famulari wrote:
> > On Mon, May 01, 2017 at 09:52:36AM +0200, Julien Lepiller wrote:  
> > > Subject: [PATCH] gnu: hexchat: Update to 2.12.4.
> > > 
> > > * gnu/packages/messaging.scm (hexchat): Update to 2.12.4.  
> > 
> > LGTM, thank you!  
> 
> Sorry, I only checked it for style. It fails to build like this:
> 
> ------
> source is under 'hexchat-2.12.4'
> ;;; /gnu/store/19lkrck1844idbcfq6ajzr0akmr8rshj-hexchat-2.12.4.tar.xz-builder:1:2293:
> warning: possibly unbound variable `inputs' Backtrace:
> In ice-9/boot-9.scm:
>  160: 14 [catch #t #<catch-closure 8c5b80> ...]
> In unknown file:
>    ?: 13 [apply-smob/1 #<catch-closure 8c5b80>]
> In ice-9/boot-9.scm:
>   66: 12 [call-with-prompt prompt0 ...]
> In ice-9/eval.scm:
>  432: 11 [eval # #]
> In ice-9/boot-9.scm:
> 2412: 10 [save-module-excursion #<procedure 8e67c0 at
> ice-9/boot-9.scm:4084:3 ()>] 4089: 9 [#<procedure 8e67c0 at
> ice-9/boot-9.scm:4084:3 ()>] 1734: 8 [%start-stack load-stack
> #<procedure 8f69c0 at ice-9/boot-9.scm:4080:10 ()>] 1739: 7
> [#<procedure 8f86c0 ()>] In unknown file:
>    ?: 6 [primitive-load
> "/gnu/store/19lkrck1844idbcfq6ajzr0akmr8rshj-hexchat-2.12.4.tar.xz-builder"]
> In ice-9/eval.scm: 399: 5 [eval # #]
> In system/base/compile.scm:
>  254: 4 [compile (begin # # # ...) #:from scheme ...]
>  182: 3 [lp (#<procedure objcode->value (x e opts)>) #<objcode
> 8dd020> ...] In ice-9/boot-9.scm:
> 2412: 2 [save-module-excursion #<procedure f924b0 at
> language/objcode/spec.scm:33:9 ()>] In language/objcode/spec.scm:
>   35: 1 [#<procedure f924b0 at language/objcode/spec.scm:33:9 ()>]
> In /gnu/store/19lkrck1844idbcfq6ajzr0akmr8rshj-hexchat-2.12.4.tar.xz-builder:
>    1: 0 [#<procedure f6fdc0 ()>]
> 
> /gnu/store/19lkrck1844idbcfq6ajzr0akmr8rshj-hexchat-2.12.4.tar.xz-builder:1:2293:
> In procedure #<procedure f6fdc0
> ()>: /gnu/store/19lkrck1844idbcfq6ajzr0akmr8rshj-hexchat-2.12.4.tar.xz-builder:1:2293:
> In procedure module-lookup: Unbound variable: inputs builder for
> `/gnu/store/gp1jrrhk8hd46ji2gciyjjpgxr9lhfxc-hexchat-2.12.4.tar.xz.drv'
> failed with exit code 1 @
> build-failed /gnu/store/gp1jrrhk8hd46ji2gciyjjpgxr9lhfxc-hexchat-2.12.4.tar.xz.drv
> - 1 builder for
> `/gnu/store/gp1jrrhk8hd46ji2gciyjjpgxr9lhfxc-hexchat-2.12.4.tar.xz.drv'
> failed with exit code 1 cannot build derivation
> `/gnu/store/g6jrq9a0bj4za1yg0fcx9ni7nkwlm91r-hexchat-2.12.4.drv': 1
> dependencies couldn't be built guix build: error: build failed: build
> of `/gnu/store/g6jrq9a0bj4za1yg0fcx9ni7nkwlm91r-hexchat-2.12.4.drv'
> failed ------
> 
> So, I reverted it with commit
> 2f0ad2a4232549a3bbb43565fa3b82a6c85e59a8.

Indeed, I made a mistake here... So here is a patch that should work
(tested).

From 5e001a92828dd998d5ed5c3b3a2772c1c15e303f 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.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/messaging.scm (hexchat): Update to 2.12.4.
[source]: Remove incorrectly bootstrapped files.
[native-inputs]: Add autoconf, autoconf-archive, automake, libtool,
pkg-config.
[arguments]: Add ‘bootstrap’ phase.
---
 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 9e45b7ad0..89df0970d 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,31 @@ 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")))))
     (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 +204,17 @@ 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)
+             ;; This file is still required for autoreconf.
+             (copy-file (string-append (assoc-ref inputs "intltool")
+                                       "/share/intltool/Makefile.in.in")
+                        "po/Makefile.in.in")
+             (zero? (system* "autoreconf" "-fiv")))))))
     (synopsis "Graphical IRC Client")
     (description
      "HexChat lets you connect to multiple IRC networks at once.  The main
-- 
2.12.2