Subject: bug#73081: installer crash: iso-codes is too old

From: Roman Scherer <[email-masked]>
Date: Fri, 27 Sep 2024 14:03:49 +0200

Hi Ricardo and Ludo,

I tried to address the comments mentioned by Ludo and tested them by
booting into the installer. It seems to work now. I don't see it
crashing anymore.

Please find the patches attached to this mail.

Could you please review them, and if ok merge them?

Thanks, Roman.

From 7fefef83a062a97d7c41e3e0d145abd9d5b1101b Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: Roman Scherer <[email-masked]>
Date: Fri, 27 Sep 2024 11:00:27 +0200
Subject: [PATCH 1/3] gnu: iso-codes: Rename to iso-codes/pinned.

* doc/build.scm
* gnu/installer.scm
* gnu/packages/fcitx.scm
* gnu/packages/fcitx5.scm
* gnu/packages/gnome.scm
* gnu/packages/gstreamer.scm
* gnu/packages/gtk.scm
* gnu/packages/ibus.scm
* gnu/packages/iso-codes.scm
* gnu/packages/kde-frameworks.scm
* gnu/packages/kde-plasma.scm
* gnu/packages/mate.scm
* gnu/packages/photo.scm
* gnu/packages/video.scm

Change-Id: Ia98fee15a27009583fee822cf411512727b1aa27
---
 doc/build.scm                   |  4 ++--
 gnu/installer.scm               | 12 ++++++------
 gnu/packages/fcitx.scm          |  4 ++--
 gnu/packages/fcitx5.scm         |  4 ++--
 gnu/packages/gnome.scm          | 20 ++++++++++----------
 gnu/packages/gstreamer.scm      |  2 +-
 gnu/packages/gtk.scm            |  4 ++--
 gnu/packages/ibus.scm           |  2 +-
 gnu/packages/iso-codes.scm      |  2 +-
 gnu/packages/kde-frameworks.scm |  6 +++---
 gnu/packages/kde-plasma.scm     |  4 ++--
 gnu/packages/mate.scm           |  4 ++--
 gnu/packages/photo.scm          |  2 +-
 gnu/packages/video.scm          |  2 +-
 14 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/doc/build.scm b/doc/build.scm
index 5d9fff9517..664766a1f5 100644
--- a/doc/build.scm
+++ b/doc/build.scm
@@ -1061,7 +1061,7 @@ (define* (localization-helper-module source
                  (bindtextdomain "guix-manual"
                                  #+(guix-manual-text-domain source))
                  (bindtextdomain "iso_639-3"      ;language names
-                                 #+(file-append iso-codes
+                                 #+(file-append iso-codes/pinned
                                                 "/share/locale"))
                  (setenv "LANGUAGE" ,language)
                  (write (gettext ,str ,domain))))
@@ -1080,7 +1080,7 @@ (define* (localization-helper-module source
           (define %iso639-languages
             (vector->list
              (assoc-ref (call-with-input-file
-                            #+(file-append iso-codes
+                            #+(file-append iso-codes/pinned
                                            "/share/iso-codes/json/iso_639-3.json")
                           json->scm)
                         "639-3")))
diff --git a/gnu/installer.scm b/gnu/installer.scm
index 3792fc7e35..53af01261e 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -146,10 +146,10 @@ (define* (compute-locale-step #:key
 
   (let* ((supported-locales #~(supported-locales->locales
                                #+(glibc-supported-locales)))
-         (iso-codes #~(string-append #$iso-codes "/share/iso-codes/json/"))
-         (iso639-3 #~(string-append #$iso-codes "iso_639-3.json"))
-         (iso639-5 #~(string-append #$iso-codes "iso_639-5.json"))
-         (iso3166 #~(string-append #$iso-codes "iso_3166-1.json"))
+         (iso-codes #~(string-append #$iso-codes/pinned "/share/iso-codes/json/"))
+         (iso639-3 #~(string-append #$iso-codes/pinned "iso_639-3.json"))
+         (iso639-5 #~(string-append #$iso-codes/pinned "iso_639-5.json"))
+         (iso3166 #~(string-append #$iso-codes/pinned "iso_3166-1.json"))
          (locales-file (build-compiled-file
                         locales-name
                         #~`(quote ,#$supported-locales)))
@@ -437,9 +437,9 @@ (define (installer-program)
             ;; (e.g., "French" is always displayed as "français", but
             ;; "Belgium" could be translated to Dutch, French, or German.)
             (bindtextdomain "iso_639-3"           ;languages
-                            #+(file-append iso-codes "/share/locale"))
+                            #+(file-append iso-codes/pinned "/share/locale"))
             (bindtextdomain "iso_3166-1"          ;territories
-                            #+(file-append iso-codes "/share/locale"))
+                            #+(file-append iso-codes/pinned "/share/locale"))
 
             ;; Likewise for XKB keyboard layout names.
             (bindtextdomain "xkeyboard-config"
diff --git a/gnu/packages/fcitx.scm b/gnu/packages/fcitx.scm
index b21b269926..11bf73610c 100644
--- a/gnu/packages/fcitx.scm
+++ b/gnu/packages/fcitx.scm
@@ -206,7 +206,7 @@ (define-public fcitx
            gtk+-2
            gtk+
            icu4c
-           iso-codes
+           iso-codes/pinned
            json-c
            libxkbfile
            libxml2
@@ -245,7 +245,7 @@ (define-public fcitx-configtool
       ("gettext"    ,gettext-minimal)
       ("gtk2"       ,gtk+-2)
       ("gtk3"       ,gtk+)
-      ("iso-codes"  ,iso-codes)))
+      ("iso-codes"  ,iso-codes/pinned)))
    (home-page "https://fcitx-im.org/wiki/Configtool")
    (synopsis "Graphic Fcitx configuration tool")
    (description
diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm
index 4ad7fa98ca..c4c2b565db 100644
--- a/gnu/packages/fcitx5.scm
+++ b/gnu/packages/fcitx5.scm
@@ -111,7 +111,7 @@ (define-public fcitx5
        ("gdk-pixbuf" ,gdk-pixbuf)
        ("gettext" ,gettext-minimal)
        ("glib" ,glib)
-       ("iso-codes" ,iso-codes)
+       ("iso-codes" ,iso-codes/pinned)
        ("json-c" ,json-c)
        ("libevent" ,libevent)
        ("libuuid" ,util-linux "lib")
@@ -469,7 +469,7 @@ (define-public fcitx5-configtool
            xkeyboard-config
            libxkbfile
            gettext-minimal
-           iso-codes))
+           iso-codes/pinned))
     (native-inputs
      (list extra-cmake-modules pkg-config))
     (home-page "https://github.com/fcitx/fcitx5-configtool")
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index b9da31b1f1..892302f391 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1825,7 +1825,7 @@ (define-public libnma
     (inputs
      (list gcr-3
            (if (supported-package? gtk) gtk gtk+)
-           iso-codes
+           iso-codes/pinned
            mobile-broadband-provider-info
            network-manager))
     (synopsis "Network Manager's applet library")
@@ -2318,7 +2318,7 @@ (define-public gnome-desktop
      (list gsettings-desktop-schemas
            gtk
            gtk+
-           iso-codes
+           iso-codes/pinned
            libseccomp
            libx11
            xkeyboard-config))
@@ -4905,7 +4905,7 @@ (define-public libxklavier
      ;; Required by libxklavier.pc.
      (list glib libxml2))
     (inputs
-     (list iso-codes libxi libxkbfile xkbcomp xkeyboard-config))
+     (list iso-codes/pinned libxi libxkbfile xkbcomp xkeyboard-config))
     (home-page "https://www.freedesktop.org/wiki/Software/LibXklavier/")
     (synopsis "High-level API for X Keyboard Extension")
     (description
@@ -7322,7 +7322,7 @@ (define-public epiphany
            gst-plugins-base
            gst-plugins-good
            gstreamer
-           iso-codes
+           iso-codes/pinned
            json-glib
            libadwaita
            libarchive
@@ -9178,7 +9178,7 @@ (define-public gdm
            gnome-session
            gnome-settings-daemon
            gtk+
-           iso-codes
+           iso-codes/pinned
            libcanberra
            libgudev
            linux-pam
@@ -11502,7 +11502,7 @@ (define-public gspell
              (setenv "ASPELL_DICT_DIR"
                      (search-input-directory inputs "/lib/aspell")))))))
     (inputs
-     (list iso-codes))
+     (list iso-codes/pinned))
     (native-inputs
      (list `(,glib "bin")
            gobject-introspection
@@ -11842,7 +11842,7 @@ (define-public sound-juicer
            gst-plugins-good
            gstreamer
            gtk+
-           iso-codes
+           iso-codes/pinned
            libcanberra
            libdiscid
            libmusicbrainz
@@ -12784,7 +12784,7 @@ (define-public geary
            gspell
            gsound
            gtk+
-           iso-codes
+           iso-codes/pinned
            json-glib
            libcanberra
            libgee
@@ -13248,7 +13248,7 @@ (define-public parlatype
            gst-plugins-good
            gstreamer
            gtk+
-           iso-codes
+           iso-codes/pinned
            pocketsphinx
            pulseaudio
            sphinxbase))
@@ -13645,7 +13645,7 @@ (define-public libgda
     (build-system meson-build-system)
     (native-inputs
      (list intltool
-           iso-codes
+           iso-codes/pinned
            `(,glib "bin")
            gnome-common
            gettext-minimal
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index c4791757a7..13c8734e68 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -562,7 +562,7 @@ (define-public gst-plugins-base
      (list alsa-lib
            cdparanoia
            graphene
-           iso-codes
+           iso-codes/pinned
            libjpeg-turbo
            libogg
            libpng
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 2c40d4468d..2742427008 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1069,7 +1069,7 @@ (define-public gtk+
            cups
            graphene
            harfbuzz
-           iso-codes
+           iso-codes/pinned
            json-glib-minimal
            libxml2
            rest))
@@ -1361,7 +1361,7 @@ (define-public gtk
            gst-plugins-bad              ;provides gstreamer-player
            gst-plugins-base             ;provides gstreamer-gl
            harfbuzz
-           iso-codes
+           iso-codes/pinned
            json-glib
            libcloudproviders            ;for cloud-providers support
            libgudev                     ;for gstreamer-gl
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 07f5b90f67..2f4211c385 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -195,7 +195,7 @@ (define-public ibus-minimal
            dconf
            glib
            gtk+
-           iso-codes
+           iso-codes/pinned
            json-glib
            libnotify
            libx11
diff --git a/gnu/packages/iso-codes.scm b/gnu/packages/iso-codes.scm
index d2bace6a3c..147cc9174b 100644
--- a/gnu/packages/iso-codes.scm
+++ b/gnu/packages/iso-codes.scm
@@ -68,7 +68,7 @@ (define-public iso-codes/official
 information.")
     (license license:gpl2+)))           ; some bits use the lgpl2
 
-(define-public iso-codes
+(define-public iso-codes/pinned
   ;; This package should be used universally within Guix, e.g., as an input to
   ;; other Guix packages or in the Guix System installer's country selector.
   (hidden-package
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 88f79615f0..974fd1c4dd 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -1129,7 +1129,7 @@ (define-public ki18n
     (native-inputs
      (list extra-cmake-modules python-minimal tzdata-for-tests))
     (inputs
-     (list qtbase qtdeclarative iso-codes))
+     (list qtbase qtdeclarative iso-codes/pinned))
     (arguments
      (list
       #:phases
@@ -1173,7 +1173,7 @@ (define-public ki18n-5
     (native-inputs
      (list extra-cmake-modules))
     (inputs
-     (list qtbase-5 qtdeclarative-5 qtscript iso-codes))))
+     (list qtbase-5 qtdeclarative-5 qtscript iso-codes/pinned))))
 
 (define-public kidletime
   (package
@@ -2359,7 +2359,7 @@ (define-public kcontacts
     (build-system qt-build-system)
     (native-inputs (list extra-cmake-modules
                          ;; for test
-                         iso-codes))
+                         iso-codes/pinned))
     (inputs (list qtdeclarative))
     (propagated-inputs
      (list ;; As required by KF6ContactsConfig.cmake.
diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm
index 56213bed08..d36cfde21b 100644
--- a/gnu/packages/kde-plasma.scm
+++ b/gnu/packages/kde-plasma.scm
@@ -2051,7 +2051,7 @@ (define-public plasma-desktop
                   libxkbfile
                   libxcursor
                   libxkbcommon))
-    (propagated-inputs (list iso-codes kirigami kcmutils plasma-workspace))
+    (propagated-inputs (list iso-codes/pinned kirigami kcmutils plasma-workspace))
     (arguments
      (list #:qtbase qtbase
            #:phases
@@ -2726,7 +2726,7 @@ (define-public plasma-workspace
                   dbus
                   fontconfig
                   icu4c
-                  iso-codes
+                  iso-codes/pinned
                   plasma-activities
                   plasma-activities-stats
                   karchive
diff --git a/gnu/packages/mate.scm b/gnu/packages/mate.scm
index f83d26b26b..ca987cca7c 100644
--- a/gnu/packages/mate.scm
+++ b/gnu/packages/mate.scm
@@ -244,7 +244,7 @@ (define-public mate-desktop
            yelp-tools
            gtk-doc/stable))
     (inputs
-     (list gtk+ libxrandr iso-codes startup-notification))
+     (list gtk+ libxrandr iso-codes/pinned startup-notification))
     (propagated-inputs
      (list dconf)) ; mate-desktop-2.0.pc
     (home-page "https://mate-desktop.org/")
@@ -1432,7 +1432,7 @@ (define-public pluma
            gtk+
            gtksourceview-4
            gdk-pixbuf
-           iso-codes
+           iso-codes/pinned
            libcanberra
            libx11
            libsm
diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index 96f5bbec50..ec32de2990 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -598,7 +598,7 @@ (define-public darktable
            gsettings-desktop-schemas
            gtk+
            imath
-           iso-codes          ;optional, for language names in the preferences
+           iso-codes/pinned          ;optional, for language names in the preferences
            json-glib
            lcms
            lensfun                   ;optional, for the lens distortion plugin
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 64ac69da46..1d2ab5fbeb 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -6155,7 +6155,7 @@ (define-public gaupol
            python-pycairo ; Required or else clicking on a subtitle line fails.
            python-chardet ; Optional: Character encoding detection.
            gtkspell3 ; Optional: Inline spell-checking.
-           iso-codes ; Optional: Translations.
+           iso-codes/pinned ; Optional: Translations.
            gstreamer
            gst-libav
            gst-plugins-base

base-commit: e6a771c7baf9662b4c9832045ad86c8b92b46bb3
-- 
2.46.0

From 6c651fbaef76daa87b01c37a3a119b7bbfbb3917 Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
In-Reply-To: <[email-masked]>
References: <[email-masked]>
From: Roman Scherer <[email-masked]>
Date: Fri, 27 Sep 2024 11:14:02 +0200
Subject: [PATCH 2/3] gnu: Add iso-codes.

* gnu/packages/iso-codes.scm (iso-codes): New variable.

Change-Id: I2d945a2daf98d111c04a3c30f0779e39644a5e2e
---
 gnu/packages/iso-codes.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/packages/iso-codes.scm b/gnu/packages/iso-codes.scm
index 147cc9174b..8c51777dda 100644
--- a/gnu/packages/iso-codes.scm
+++ b/gnu/packages/iso-codes.scm
@@ -87,6 +87,20 @@ (define-public iso-codes/pinned
               (("(Taiwan), [^\"]*" _ name) name))))))
      (synopsis "Various ISO standards as used by GNU@tie{}Guix"))))
 
+(define-public iso-codes
+  (package
+    (inherit iso-codes/pinned)
+    (version "4.17.0")
+    (source (origin
+              (inherit (package-source iso-codes/pinned))
+              (uri (git-reference
+                    (url (package-home-page iso-codes/pinned))
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name (package-name iso-codes/pinned) version))
+              (sha256
+               (base32
+                "0a77b9aid68vakhsa3l3lx2jav5q9fp7vn50mwmzkr2lkr2l4k41"))))))
+
 (define-public python-iso639
   (package
     (name "python-iso639")
-- 
2.46.0

From ba1046d61eecd9d88483e5730bec4c0e23e96bc9 Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
In-Reply-To: <[email-masked]>
References: <[email-masked]>
From: Roman Scherer <[email-masked]>
Date: Fri, 27 Sep 2024 11:14:44 +0200
Subject: [PATCH 3/3] gnu: installer: Use iso-codes.

* gnu/installer.scm (compute-locale-step): Use Use iso-codes.

Change-Id: I9a69f7accee965cf5deb2c1b23ce3fda579d465a
---
 gnu/installer.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnu/installer.scm b/gnu/installer.scm
index 53af01261e..3792fc7e35 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -146,10 +146,10 @@ (define* (compute-locale-step #:key
 
   (let* ((supported-locales #~(supported-locales->locales
                                #+(glibc-supported-locales)))
-         (iso-codes #~(string-append #$iso-codes/pinned "/share/iso-codes/json/"))
-         (iso639-3 #~(string-append #$iso-codes/pinned "iso_639-3.json"))
-         (iso639-5 #~(string-append #$iso-codes/pinned "iso_639-5.json"))
-         (iso3166 #~(string-append #$iso-codes/pinned "iso_3166-1.json"))
+         (iso-codes #~(string-append #$iso-codes "/share/iso-codes/json/"))
+         (iso639-3 #~(string-append #$iso-codes "iso_639-3.json"))
+         (iso639-5 #~(string-append #$iso-codes "iso_639-5.json"))
+         (iso3166 #~(string-append #$iso-codes "iso_3166-1.json"))
          (locales-file (build-compiled-file
                         locales-name
                         #~`(quote ,#$supported-locales)))
@@ -437,9 +437,9 @@ (define (installer-program)
             ;; (e.g., "French" is always displayed as "français", but
             ;; "Belgium" could be translated to Dutch, French, or German.)
             (bindtextdomain "iso_639-3"           ;languages
-                            #+(file-append iso-codes/pinned "/share/locale"))
+                            #+(file-append iso-codes "/share/locale"))
             (bindtextdomain "iso_3166-1"          ;territories
-                            #+(file-append iso-codes/pinned "/share/locale"))
+                            #+(file-append iso-codes "/share/locale"))
 
             ;; Likewise for XKB keyboard layout names.
             (bindtextdomain "xkeyboard-config"
-- 
2.46.0