Subject: Re: [bug#78137] [PATCH electronics-team] gnu: gtkwave: Update to 3.4.0-0.bb978d9.
From: Maxim Cournoyer <[email-masked]>
To: Cayetano Santos <[email-masked]>
Cc: [email-masked], Ekaitz Zarraga <[email-masked]>
Date: Fri, 16 May 2025 22:02:36 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Cayetano Santos <[email-masked]> writes:

> * gnu/packages/fpga.scm (gtkwave): Update to 3.4.0-0.bb978d9.
>
> Change-Id: I38aabca14c2789ad7b3bc304b7018644dc6d0fa6
> ---
>
> Update package and fetch from its new home at github, branch master. Note that branch lts comprises the v3.x series.
>
> [source]: Switch to git-fetch, new uri.
> [version]: Switch to branch master, version 3.4.
> [build-system]: Switch to meson-build-system.
> [native-inputs]: Add new requirements.

Please explicit the inputs added.

> [inputs]: Add libfst and tcllib.
> [homepage]: Update URL.

The change log should be part of the commit message proper.

>  gnu/packages/fpga.scm | 68 +++++++++++++++++++++++--------------------
>  1 file changed, 36 insertions(+), 32 deletions(-)
>
> diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm
> index 4fcd6a47a6..fc44166bff 100644
> --- a/gnu/packages/fpga.scm
> +++ b/gnu/packages/fpga.scm
> @@ -53,6 +53,7 @@ (define-module (gnu packages fpga)
>    #:use-module (gnu packages cpp)
>    #:use-module (gnu packages elf)
>    #:use-module (gnu packages flex)
> +  #:use-module (gnu packages freedesktop)
>    #:use-module (gnu packages gawk)
>    #:use-module (gnu packages gdb)
>    #:use-module (gnu packages gettext)
> @@ -77,6 +78,7 @@ (define-module (gnu packages fpga)
>    #:use-module (gnu packages ruby)
>    #:use-module (gnu packages qt)
>    #:use-module (gnu packages readline)
> +  #:use-module (gnu packages shells)
>    #:use-module (gnu packages sphinx)
>    #:use-module (gnu packages tcl)
>    #:use-module (gnu packages texinfo)
> @@ -434,39 +436,41 @@ (define-public nextpnr-ice40
>        (license license:expat))))
>  
>  (define-public gtkwave
> -  (package
> -    (name "gtkwave")
> -    (version "3.3.121")
> -    (source
> -     (origin
> -       (method url-fetch)
> -       (uri (list (string-append "mirror://sourceforge/gtkwave/"
> -                                 "gtkwave-gtk3-" version "/"
> -                                 "gtkwave-gtk3-" version ".tar.gz")
> -                  (string-append "https://gtkwave.sourceforge.net/"
> -                                 "gtkwave-" version ".tar.gz")))
> -       (sha256
> -        (base32 "0ikk49zyar5aiq7pg9whi4nfzq7xm8sz7bn3b6vaylkdimw4bajl"))))
> -    (build-system glib-or-gtk-build-system)
> -    (native-inputs
> -     (list gperf pkg-config))
> -    (inputs
> -     (list gtk+ tcl tk))
> -    (arguments
> -     (list #:configure-flags
> -           #~(list "--enable-gtk3"
> -                   (string-append "--with-tcl="
> -                    (assoc-ref %build-inputs "tcl")
> -                    "/lib")
> -                   (string-append "--with-tk="
> -                                  (assoc-ref %build-inputs "tk")
> -                                  "/lib"))))
> -    (synopsis "Waveform viewer for FPGA simulator trace files")
> -    (description "This package is a waveform viewer for FPGA
> +  ;; there are no releases in master branch, which includes 3.4.0
> +  (let ((commit "bb978d9d667d569b9153ffa34007e300302907dc")
> +        (revision "0"))
> +    (package
> +      (name "gtkwave")
> +      (version (git-version "3.4.0" revision commit)) ; version from meson.build
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/gtkwave/gtkwave")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32 "1nv27cpz5937cb6bkhpw8w0ji6hm9xr8f0znvfwzfl1fwwypf23y"))))
> +      (build-system meson-build-system)
> +      (native-inputs (list desktop-file-utils
> +                           flex
> +                           `(,glib "bin")
> +                           gobject-introspection
> +                           gperf
> +                           perl
> +                           pkg-config
> +                           tcsh))
> +      (inputs (list gtk
> +                    gtk+
> +                    `(,gtk+ "bin")
> +                    libfst
> +                    tcllib))
> +      (synopsis "Waveform viewer for FPGA simulator trace files")
> +      (description "This package is a waveform viewer for FPGA
>  simulator trace files (@dfn{FST}).")
> -    (home-page "https://gtkwave.sourceforge.net/")
> -    ;; Exception against free government use in tcl_np.c and tcl_np.h.
> -    (license (list license:gpl2+ license:expat license:tcl/tk))))
> +      (home-page "https://github.com/gtkwave/gtkwave")
> +      ;; Exception against free government use in tcl_np.c and tcl_np.h.
> +      (license (list license:gpl2+ license:expat license:tcl/tk)))))

I've taken the liberty to make these changes locally:

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/fpga.scm
@@ -82,7 +82,6 @@ (define-module (gnu packages fpga)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
-  #:use-module (gnu packages shells)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages texinfo)
@@ -481,7 +480,9 @@ (define-public nextpnr-ice40
   (deprecated-package "nextpnr-ice40" nextpnr))
 
 (define-public gtkwave
-  ;; There are no recent tag releases
+  ;; The last release is more than 2 years old, and there are improvements in
+  ;; the master branch, such as GTK 4 support: pick the latest commit that
+  ;; passes their CI.
   (let ((commit "bb978d9d667d569b9153ffa34007e300302907dc")
         (revision "0"))
     (package
@@ -500,20 +501,17 @@ (define-public gtkwave
       (build-system meson-build-system)
+      (arguments (list #:glib-or-gtk? #t))       
       (native-inputs (list desktop-file-utils
                            flex
-                           `(,glib "bin")
+                           `(,glib "bin") ;for glib-mkenums
                            gobject-introspection
                            gperf
-                           perl
-                           pkg-config
-                           tcsh))
+                           pkg-config))
       (inputs (list gtk
                     gtk+
-                    `(,gtk+ "bin")
-                    libfst
-                    tcllib))
+                    `(,gtk "bin")
+                    libfst))
       (synopsis "Waveform viewer for FPGA simulator trace files")
-      (description "This package is a waveform viewer for FPGA
-simulator trace files (@dfn{FST}).")
+      (description "This package is a waveform viewer for @acronym{FST, FPGA
+Simulator Trace} files.")
       (home-page "https://github.com/gtkwave/gtkwave")
       ;; Exception against free government use in tcl_np.c and tcl_np.h.
       (license (list license:gpl2+ license:expat license:tcl/tk)))))
--8<---------------cut here---------------end--------------->8---

I've tried making more explicit the comment explaining why we use a
snapshot from git.

I've removed inputs that were not detected by the build systems and
apparently unused: perl, tcsh and tcllib.

I've used the #:glib-or-gtk? argument, to wrap the binaries and ensure
they could run by themselves from a pure environment.

I've fixed the description to use @acronym and not @dfn.

Adjusted the change log message a bit and pushed!

-- 
Thanks,
Maxim