unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#73073] [PATCH 0/6] Allow origin with label as inputs.
@ 2024-09-06 15:51 Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 1/6] guix: packages: " Simon Tournier
                   ` (7 more replies)
  0 siblings, 8 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 15:51 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier, maxim.cournoyer

Hi,

As discussed in bug#73034 [1], these 5 packages – farstream,
gnulib-checkout, smithforth, gnome-recipes and dmd-bootstrap – have an
origin inside the ’arguments’ package record.

This is annoying because these origins are hidden from
’package-direct-sources’; see module (guix packages).

I consider this is bug. :-)  Hence this prposal for fixing it.

Moreover and tangentially, it appears to me an anti-pattern of the
functional paradigm: The data from the impure outside should be handled
by the ’source’ record field, or otherwise by ’inputs’, ’native-inputs’
or ’propagated-inputs’ record fields; let say only ’inputs’ for
simplicity.

To my knowledge, using the old style with label, we strove on this
principle.  However, using the “new style” [2], it does not offer to
have labels with plain package symbol.  In other words, for example,
this snippet does not work:

      (list gdmd which
            `("phobos"
              ,(origin
                 (method git-fetch)
                 (uri (git-reference
                       (url "https://github.com/dlang/phobos")
                       (commit (string-append "v" version))))
                 (file-name (git-file-name "phobos" version))
                 (sha256
                  (base32
                   "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))))))

The reason is because ’sanitize-inputs’; see module (guix packages).

    ((_ (list args ...))
     (add-input-labels args ...))
    ((_ inputs)
     (maybe-add-input-labels inputs))))

Roughly speaking, because the ’inputs’ starts by the term ’list’ then
’add-input-labels’ is applied, else it applies ’maybe-add-input-labels’.

Note that:

    (define (add-input-labels . inputs)
      "Add labels to all of INPUTS if needed (this is the rest-argument version of
    'maybe-add-input-labels')."
      (maybe-add-input-labels inputs))

The procedure ’maybe-add-input-labels’ reads: if the first element of
the ’inputs’ record field is using the “old style“ then return all
as-is, assuming all are “old style”.  Else apply to all the ’inputs’
elements the procedure ’add-input-label’.

Hence the simple proposal:

--8<---------------cut here---------------start------------->8---
diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..5fea44c2bb 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -676,6 +676,8 @@ (define (add-input-label input)
               "_")
          ,obj
          ,@(if (string=? output "out") '() (list output)))))
+    (((? string? label) obj) ;Allow old style as sometimes requires by origin in inputs
+     `(,label ,obj))
     (x
      `("_" ,x))))
--8<---------------cut here---------------end--------------->8---

This allows to write ’inputs’ as above. :-)  As done with the 5 packages.

And it does not hurt the new style.  Maybe “guix style” would need to be
adjusted too?

WDYT?

Cheers,
simon


1: [bug#73034] [PATCH v3 0/3] Fix annoyances of Git and update to 2.46.0
Maxim Cournoyer <maxim.cournoyer@gmail.com>
Fri, 06 Sep 2024 13:17:33 +0900
id:87msklct5u.fsf@gmail.com
https://issues.guix.gnu.org/73034
https://issues.guix.gnu.org/msgid/87msklct5u.fsf@gmail.com
https://yhetil.org/guix/87msklct5u.fsf@gmail.com

2: https://guix.gnu.org/en/blog/2021/the-big-change/

Simon Tournier (6):
  guix: packages: Allow origin with label as inputs.
  gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs.
  gnu: smithforth: Move system.fs origin from phases to native-inputs.
  gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  gnu: farstream: Move common origin from phases to native-inputs.
  gnu: gnulib: Move phobos origin from phases to native-inputs.

 gnu/packages/build-tools.scm | 18 ++++++++++--------
 gnu/packages/dlang.scm       | 22 ++++++++++++----------
 gnu/packages/forth.scm       | 20 +++++++++++---------
 gnu/packages/freedesktop.scm | 24 +++++++++++++-----------
 gnu/packages/gnome.scm       | 22 ++++++++++++----------
 guix/packages.scm            |  2 ++
 6 files changed, 60 insertions(+), 48 deletions(-)


base-commit: 7d2ced8d6d9c38327592d312376d59a8c37fc160
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 1/6] guix: packages: Allow origin with label as inputs.
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
@ 2024-09-06 15:54 ` Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 2/6] gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs Simon Tournier
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 15:54 UTC (permalink / raw)
  To: 73073
  Cc: Simon Tournier, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
	Tobias Geerinckx-Rice

* guix/packages.scm (add-input-label): Allow the old style pattern using label
as it is sometimes required by origins listed under inputs record field.

Change-Id: I799612976a0051d4c953969d12d71913c9243cd4
---
 guix/packages.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..5fea44c2bb 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -676,6 +676,8 @@ (define (add-input-label input)
               "_")
          ,obj
          ,@(if (string=? output "out") '() (list output)))))
+    (((? string? label) obj) ;Allow old style as sometimes requires by origin in inputs
+     `(,label ,obj))
     (x
      `("_" ,x))))
 
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 2/6] gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs.
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 1/6] guix: packages: " Simon Tournier
@ 2024-09-06 15:54 ` Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 3/6] gnu: smithforth: Move system.fs " Simon Tournier
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 15:54 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (dmd-bootstrap)[arguments]<phases>: Move git-manpages
origin from here...
[native-inputs]: ...to here.

Change-Id: I10cb5f628dad2fdbb01df58134996bdcd0b73d62
---
 gnu/packages/dlang.scm | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 8bf0ee685e..d7a15f0214 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -456,15 +456,7 @@ (define dmd-bootstrap
             (lambda _
               (symlink "." "dmd")  ;to please the build system expected layout
               (copy-recursively
-               #$(origin
-                   (method git-fetch)
-                   (uri (git-reference
-                         (url "https://github.com/dlang/phobos")
-                         (commit (string-append "v" version))))
-                   (file-name (git-file-name "phobos" version))
-                   (sha256
-                    (base32
-                     "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9")))
+               #$(this-package-native-input "phobos")
                "phobos")
               (chdir "phobos")))
           (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs
@@ -519,7 +511,17 @@ (define dmd-bootstrap
                  "lib")
                 (("\\.\\./src/(phobos|druntime/import)")
                  "include/dmd")))))))
-    (native-inputs (list gdmd which))
+    (native-inputs (list gdmd which
+                         `("phobos"
+                           ,(origin
+                              (method git-fetch)
+                              (uri (git-reference
+                                    (url "https://github.com/dlang/phobos")
+                                    (commit (string-append "v" version))))
+                              (file-name (git-file-name "phobos" version))
+                              (sha256
+                               (base32
+                                "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9"))))))
     (home-page "https://github.com/dlang/dmd")
     (synopsis "Reference D Programming Language compiler")
     (description "@acronym{DMD, Digital Mars D compiler} is the reference
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 3/6] gnu: smithforth: Move system.fs origin from phases to native-inputs.
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 1/6] guix: packages: " Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 2/6] gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs Simon Tournier
@ 2024-09-06 15:54 ` Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd " Simon Tournier
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 15:54 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (smithforth)[arguments]<phases>: Move system.fs
origin from here...
[native-inputs]: ...to here.

Change-Id: I82ff81f72dbe2ecf70fbbd44674596e1a62cadcf
---
 gnu/packages/forth.scm | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/forth.scm b/gnu/packages/forth.scm
index 6e8d8cdc4c..43b497b453 100644
--- a/gnu/packages/forth.scm
+++ b/gnu/packages/forth.scm
@@ -75,7 +75,16 @@ (define-public smithforth
         (sha256
           (base32 "0a39pv7529llsa3f48fmvwvlcp3f9v8qkn5ziw2l6kxf0qvli3lm"))))
     (build-system trivial-build-system)
-    (native-inputs (list xxd))
+    (native-inputs (list xxd
+                         `("system.fs"
+                           ,(origin
+                              (method url-fetch)
+                              (uri (string-append
+                                    "https://dacvs.neocities.org/SF/system"
+                                    version "fs.txt"))
+                              (sha256
+                               (base32
+                                "17v1pp64s6n8q8w3kg48nd7zdcx2208y4svr5fpfms5lkyzg7z1m"))))))
     (arguments
       (list
         #:modules '((guix build utils))
@@ -84,14 +93,7 @@ (define-public smithforth
             (use-modules (guix build utils)
                          (ice-9 textual-ports))
             (let* ((sforth.dmp #$(package-source this-package))
-                   (system.fs  #$(origin
-                                   (method url-fetch)
-                                   (uri (string-append
-                                          "https://dacvs.neocities.org/SF/system"
-                                          version "fs.txt"))
-                                   (sha256
-                                    (base32
-                                     "17v1pp64s6n8q8w3kg48nd7zdcx2208y4svr5fpfms5lkyzg7z1m"))))
+                   (system.fs  #$(this-package-native-input "system.fs"))
                    (xxd        (string-append (assoc-ref %build-inputs "xxd")
                                               "/bin/xxd"))
                    (bin        (string-append (assoc-ref %outputs "out") "/bin")))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
                   ` (2 preceding siblings ...)
  2024-09-06 15:54 ` [bug#73073] [PATCH 3/6] gnu: smithforth: Move system.fs " Simon Tournier
@ 2024-09-06 15:54 ` Simon Tournier
  2024-09-06 17:33   ` Liliana Marie Prikler
  2024-09-06 15:54 ` [bug#73073] [PATCH 5/6] gnu: farstream: Move common " Simon Tournier
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 15:54 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier, Liliana Marie Prikler, Maxim Cournoyer,
	Vivien Kraus

* gnu/packages/dlang.scm (gnome-recipes)[arguments]<phases>: Move libgd
origin from here...
[native-inputs]: ...to here.

Change-Id: I137dc41819a680fdf1f5c0bea9778b2bceae3fad
---
 gnu/packages/gnome.scm | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 7339000436..8ae9fb0656 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -799,15 +799,7 @@ (define-public gnome-recipes
           (add-after 'unpack 'unpack-libgd
             (lambda _
               (copy-recursively
-               #$(origin
-                   (method git-fetch)
-                   (uri (git-reference
-                         (url "https://gitlab.gnome.org/GNOME/libgd")
-                         (commit "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
-                   (file-name (git-file-name "libgd" version))
-                   (sha256
-                    (base32
-                     "16yld0ap7qj1n96h4f2sqkjmibg7xx5xwkqxdfzam2nmyfdlrrrs")))
+               #$(this-package-native-input "libgd")
                "subprojects/libgd"))))))
     (inputs (list glib
                   gnome-autoar
@@ -823,7 +815,17 @@ (define-public gnome-recipes
                          `(,glib "bin")
                          itstool
                          pkg-config
-                         python))
+                         python
+                         `("libgd"
+                           ,(origin
+                              (method git-fetch)
+                              (uri (git-reference
+                                    (url "https://gitlab.gnome.org/GNOME/libgd")
+                                    (commit "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
+                              (file-name (git-file-name "libgd" version))
+                              (sha256
+                               (base32
+                                "16yld0ap7qj1n96h4f2sqkjmibg7xx5xwkqxdfzam2nmyfdlrrrs"))))))
     (home-page "https://wiki.gnome.org/Apps/Recipes")
     (synopsis "Discover recipes for preparing food")
     (description "GNOME Recipes helps you discover what to cook today,
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 5/6] gnu: farstream: Move common origin from phases to native-inputs.
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
                   ` (3 preceding siblings ...)
  2024-09-06 15:54 ` [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd " Simon Tournier
@ 2024-09-06 15:54 ` Simon Tournier
  2024-09-06 15:54 ` [bug#73073] [PATCH 6/6] gnu: gnulib: Move phobos " Simon Tournier
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 15:54 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (farstream)[arguments]<phases>: Move common
origin from here...
[native-inputs]: ...to here.

Change-Id: I0023bca2fc021b82875b1ec7329c7e37116df0b3
---
 gnu/packages/freedesktop.scm | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index cb1d625d24..cf4ccadfd0 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -263,16 +263,7 @@ (define-public farstream
             (lambda _
               (delete-file "autogen.sh")
               (copy-recursively
-               #$(origin
-                   (method git-fetch)
-                   (uri
-                    (git-reference
-                     (url "https://gitlab.freedesktop.org/gstreamer/common.git")
-                     (commit "52adcdb89a9eb527df38c569539d95c1c7aeda6e")))
-                   (file-name (git-file-name "common" "latest.52adcdb"))
-                   (sha256
-                    (base32
-                     "1zlm1q1lgcb76gi82rial5bwy2j9sz1x6x48ijhiz89cml7xxd1r")))
+               #$(this-package-native-input "common")
                "common")))
           (add-after 'unpack 'disable-problematic-tests
             (lambda _
@@ -296,7 +287,18 @@ (define-public farstream
            libxslt
            perl
            pkg-config
-           python-wrapper))
+           python-wrapper
+           `("common"
+             ,(origin
+                (method git-fetch)
+                (uri
+                 (git-reference
+                  (url "https://gitlab.freedesktop.org/gstreamer/common.git")
+                  (commit "52adcdb89a9eb527df38c569539d95c1c7aeda6e")))
+                (file-name (git-file-name "common" "latest.52adcdb"))
+                (sha256
+                 (base32
+                  "1zlm1q1lgcb76gi82rial5bwy2j9sz1x6x48ijhiz89cml7xxd1r"))))))
     (inputs
      (list glib
            gtk+
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 6/6] gnu: gnulib: Move phobos origin from phases to native-inputs.
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
                   ` (4 preceding siblings ...)
  2024-09-06 15:54 ` [bug#73073] [PATCH 5/6] gnu: farstream: Move common " Simon Tournier
@ 2024-09-06 15:54 ` Simon Tournier
  2024-09-06 21:45 ` [bug#73073] [PATCH 0/6] Allow origin with label as inputs Ludovic Courtès
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 15:54 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (gnulib-checkout)[arguments]<phases>: Move PropList
origin from here...
[native-inputs]: ...to here.

Change-Id: I3576a169837039bc6beaae0d68ab459ed642e3c8
---
 gnu/packages/build-tools.scm | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 21df25e4f5..f9e51e6408 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -942,14 +942,7 @@ (define*-public (gnulib-checkout #:key
                                         "Scripts.txt"
                                         "Blocks.txt")
                         (list
-                         #$(origin
-                             (method url-fetch)
-                             (uri (string-append
-                                   "https://www.unicode.org/Public/"
-                                   "3.0-Update1/PropList-3.0.1.txt"))
-                             (sha256
-                              (base32
-                               "0k6wyijyzdl5g3nibcwfm898kfydx1pqaz28v7fdvnzdvd5fz7lh"))))
+                         #$(this-package-native-input "proplist"))
                         (find-ucd-files "BidiMirroring.txt"
                                         "EastAsianWidth.txt"
                                         "LineBreak.txt"
@@ -982,6 +975,15 @@ (define*-public (gnulib-checkout #:key
       bash-minimal python perl clisp
       ;; Unicode data:
       ucd
+      `("proplist"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append
+                 "https://www.unicode.org/Public/"
+                 "3.0-Update1/PropList-3.0.1.txt"))
+           (sha256
+            (base32
+             "0k6wyijyzdl5g3nibcwfm898kfydx1pqaz28v7fdvnzdvd5fz7lh"))))
       ;; Programs for the tests:
       cppi indent git-minimal/pinned autoconf))
     (home-page "https://www.gnu.org/software/gnulib/")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-06 15:54 ` [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd " Simon Tournier
@ 2024-09-06 17:33   ` Liliana Marie Prikler
  2024-09-06 18:11     ` Simon Tournier
  0 siblings, 1 reply; 28+ messages in thread
From: Liliana Marie Prikler @ 2024-09-06 17:33 UTC (permalink / raw)
  To: Simon Tournier, 73073; +Cc: Vivien Kraus, Maxim Cournoyer

Am Freitag, dem 06.09.2024 um 17:54 +0200 schrieb Simon Tournier:
> * gnu/packages/dlang.scm (gnome-recipes)[arguments]<phases>: Move
> libgd
> origin from here...
> [native-inputs]: ...to here.
> 
> Change-Id: I137dc41819a680fdf1f5c0bea9778b2bceae3fad
> ---
>  gnu/packages/gnome.scm | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index 7339000436..8ae9fb0656 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -799,15 +799,7 @@ (define-public gnome-recipes
>            (add-after 'unpack 'unpack-libgd
>              (lambda _
>                (copy-recursively
> -               #$(origin
> -                   (method git-fetch)
> -                   (uri (git-reference
> -                         (url
> "https://gitlab.gnome.org/GNOME/libgd")
> -                         (commit
> "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
> -                   (file-name (git-file-name "libgd" version))
> -                   (sha256
> -                    (base32
> -                    
> "16yld0ap7qj1n96h4f2sqkjmibg7xx5xwkqxdfzam2nmyfdlrrrs")))
> +               #$(this-package-native-input "libgd")
>                 "subprojects/libgd"))))))
>      (inputs (list glib
>                    gnome-autoar
> @@ -823,7 +815,17 @@ (define-public gnome-recipes
>                           `(,glib "bin")
>                           itstool
>                           pkg-config
> -                         python))
> +                         python
> +                         `("libgd"
> +                           ,(origin
> +                              (method git-fetch)
> +                              (uri (git-reference
> +                                    (url
> "https://gitlab.gnome.org/GNOME/libgd")
> +                                    (commit
> "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
> +                              (file-name (git-file-name "libgd"
> version))
> +                              (sha256
> +                               (base32
I can see why you're doing that, but I'm not really convinced it helps
the package.  Particularly, we're now even adding a labeled input,
which makes for a cursed situation where all but one inputs are
unlabeled¹.

IMHO, G-Expressions in phases serve in part to facilitate uses like
this.  They may not be nice, but those are upstream conditions we have
to cope with.  I'd rather do a proper unbundling of libgd.

Another "proper" solution could be as easy as using an unlabeled origin
and search-input-file.  However, this doesn't really work all that well
if you have to unpack the entire origin, hence what I've done here for
gnome-recipes.

Cheers

¹ Let's not even mention the necessity of 1/6 to enable that.  Back in
the day, there was a decision against giving origins labels because it
would add to the further propagation of label use throughout Guix,
while we want to drop them.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-06 17:33   ` Liliana Marie Prikler
@ 2024-09-06 18:11     ` Simon Tournier
  2024-09-06 20:14       ` Liliana Marie Prikler
  0 siblings, 1 reply; 28+ messages in thread
From: Simon Tournier @ 2024-09-06 18:11 UTC (permalink / raw)
  To: Liliana Marie Prikler, 73073; +Cc: Vivien Kraus, Maxim Cournoyer

Hi Liliana,

My aim is not to mix, under ’inputs’ record field, the old style (label)
with the new style (no label) but to have the ’origin’ inside ’inputs’
and not inside ’arguments’.


On Fri, 06 Sep 2024 at 19:33, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:

> I can see why you're doing that, but I'm not really convinced it helps
> the package.

As I wrote in the cover letter:

        This is annoying because these origins are hidden from
        ’package-direct-sources’; see module (guix packages).

So it helps the package. ;-)

Please note that the docstring of ’package-direct-sources’ is currently
lying. ;-)  Well, the situation is a bug, IMHO.

--8<---------------cut here---------------start------------->8---
  "Return all source origins associated with PACKAGE; including origins in
PACKAGE's inputs and patches."
--8<---------------cut here---------------end--------------->8---


> IMHO, G-Expressions in phases serve in part to facilitate uses like
> this.

I agree that G-exps facilitate manipulation of store paths.  But using
’origin’ inside arguments appears to me as an abuse of the feature.  As
I wrote in the cover letter:

        Moreover and tangentially, it appears to me an anti-pattern of the
        functional paradigm: The data from the impure outside should be handled
        by the ’source’ record field, or otherwise by ’inputs’, ’native-inputs’
        or ’propagated-inputs’ record fields; let say only ’inputs’ for
        simplicity.

Therefore, I strongly think ’origin’ should not be inside arguments.

Somehow, my submission is a proposal for dealing with the case.  And
it’s not really if it needs to, or should, be done. :-)


>               Particularly, we're now even adding a labeled input,
> which makes for a cursed situation where all but one inputs are
> unlabeled¹.

Please note it’s a specific inputs: it’s an ’origin’.  This can be
checked by the pattern matching, e.g.,

    (((? string? label) (? origin? o) ;Allow old style as sometimes requires by origin in inputs
     `(,label ,o))

Other said, it would not be a “cursed situation”; only a situation using
a locally defined input.


Cheers,
simon




^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-06 18:11     ` Simon Tournier
@ 2024-09-06 20:14       ` Liliana Marie Prikler
  2024-09-07 11:37         ` Simon Tournier
  0 siblings, 1 reply; 28+ messages in thread
From: Liliana Marie Prikler @ 2024-09-06 20:14 UTC (permalink / raw)
  To: Simon Tournier, 73073; +Cc: Vivien Kraus, Maxim Cournoyer

Am Freitag, dem 06.09.2024 um 20:11 +0200 schrieb Simon Tournier:
> Hi Liliana,
> 
> My aim is not to mix, under ’inputs’ record field, the old style
> (label) with the new style (no label) but to have the ’origin’ inside
> ’inputs’ and not inside ’arguments’.
Sure, but you do introduce a label to make that work is what I'm
saying.

> As I wrote in the cover letter:
> 
>         This is annoying because these origins are hidden from
>         ’package-direct-sources’; see module (guix packages).
> 
> So it helps the package. ;-)
> 
> Please note that the docstring of ’package-direct-sources’ is
> currently lying. ;-)  Well, the situation is a bug, IMHO.
I think we should fix ‘package-direct-sources’ then.  The derivation
obviously knows about this input, otherwise the package wouldn't be
built, so the information is there.  I'd also hazard a guess that Rust
being Rust, no useful information for Rust packages comes with package-
direct-inputs if arguments aren't being handled.

> --8<---------------cut here---------------start------------->8---
>   "Return all source origins associated with PACKAGE; including
> origins in PACKAGE's inputs and patches."
> --8<---------------cut here---------------end--------------->8---
> 
> 
> > IMHO, G-Expressions in phases serve in part to facilitate uses like
> > this.
> 
> I agree that G-exps facilitate manipulation of store paths.  But
> using ’origin’ inside arguments appears to me as an abuse of the
> feature.  As I wrote in the cover letter:
> 
>         Moreover and tangentially, it appears to me an anti-pattern
> of the
>         functional paradigm: The data from the impure outside should
> be handled
>         by the ’source’ record field, or otherwise by ’inputs’,
> ’native-inputs’
>         or ’propagated-inputs’ record fields; let say only ’inputs’
> for
>         simplicity.
> 
> Therefore, I strongly think ’origin’ should not be inside arguments.
We could handle it in source at the cost of similar anti-patterns, or
in inputs at the cost of the anti-pattern you suggest.  The Right
Thing™ would be to unbundle these dependencies correctly.

Also note that your argument would apply to #$this-package-input just
as well: it still is magic that pulls in data from the impure outside
world, and you can trivially trick it into doing silly things.  (Just
add inheritance.)

> Somehow, my submission is a proposal for dealing with the case.  And
> it’s not really if it needs to, or should, be done. :-)
You are working on the implicit assumption that everyone agrees that it
needs to be done, then.  

> >               Particularly, we're now even adding a labeled input,
> > which makes for a cursed situation where all but one inputs are
> > unlabeled¹.
> 
> Please note it’s a specific inputs: it’s an ’origin’.  This can be
> checked by the pattern matching, e.g.,
> 
>     (((? string? label) (? origin? o) ;Allow old style as sometimes
> requires by origin in inputs
>      `(,label ,o))
> 
> Other said, it would not be a “cursed situation”; only a situation
> using a locally defined input.
It *is* a cursed situation for the person reading the inputs field. 
Apart from proper unbundling, some other workarounds would be:
- hacking around search-input-file
- making dummy data packages
- named origins (this one requires similar support code to be written
  and has already been rejected once IIRC)
- computed origins
And yes, I label them as workarounds, since they don't address the root
cause of why origins are introduced in arguments.

Sometimes, practicality beats purity: Consider the ungoogled-chromium
recipe if you hadn't had a good scare today.  The fact that this
pattern shows up as rarely as it does is a testament to how well Guix
functions otherwise – but there might still be a need for it in some
fringe circumstances.  I'd rather we don't change code unless the
result is clearly better™, and I don't see that here.

Cheers




^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 0/6] Allow origin with label as inputs.
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
                   ` (5 preceding siblings ...)
  2024-09-06 15:54 ` [bug#73073] [PATCH 6/6] gnu: gnulib: Move phobos " Simon Tournier
@ 2024-09-06 21:45 ` Ludovic Courtès
  2024-09-07 13:40   ` Simon Tournier
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
  7 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2024-09-06 21:45 UTC (permalink / raw)
  To: Simon Tournier; +Cc: maxim.cournoyer, 73073

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

Hello,

Simon Tournier <zimon.toutoune@gmail.com> skribis:

> The reason is because ’sanitize-inputs’; see module (guix packages).
>
>     ((_ (list args ...))
>      (add-input-labels args ...))
>     ((_ inputs)
>      (maybe-add-input-labels inputs))))

[...]

> The procedure ’maybe-add-input-labels’ reads: if the first element of
> the ’inputs’ record field is using the “old style“ then return all
> as-is, assuming all are “old style”.  Else apply to all the ’inputs’
> elements the procedure ’add-input-label’.

Yes: as an optimization, we just check the first element or even just
the syntax (whether the value starts with (list …)).

This is one reason why I’d rather avoid the change you’re suggesting.
But more importantly: I think we should avoid polymorphic lists for
clarity (the principle is followed in most of the code), and
reintroducing labels would be a step backwards.

To be clear, I understand the current situation is not perfect, but I
would rather look for solutions that do not involve undoing what’s taken
this long to do.

The main issue we want to address here is origins being hidden from
‘package-direct-sources’, right?

What if we could do this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 864 bytes --]

diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..624d3d8c45 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1320,7 +1320,16 @@ (define (package-direct-sources package)
                    ((_ (? origin? orig) _ ...)
                     orig)
                    (_ #f))
-                  (package-direct-inputs package))))
+                  (package-direct-inputs package))
+    (match (assoc #:phases (package-arguments package))
+      ((#:phases (? gexp? phases) . _)
+       (filter-map (lambda (input)
+                     (match (gexp-input-thing input)
+                       ((? origin? o) o)
+                       (_ #f)))
+                   (gexp-inputs phases)))
+      (_
+       '()))))
 
 (define (package-transitive-sources package)
   "Return PACKAGE's direct sources, and their direct sources, recursively."

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]


?  (Currently we can’t because ‘gexp-inputs’ is private.)

Or, alternatively, we’d have origins without labels in inputs, with
this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Type: text/x-patch, Size: 401 bytes --]

diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..8b08f0d379 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -676,6 +676,8 @@ (define (add-input-label input)
               "_")
          ,obj
          ,@(if (string=? output "out") '() (list output)))))
+    ((? origin? origin)
+     (list (or (origin-actual-file-name origin) "_") origin))
     (x
      `("_" ,x))))
 

[-- Attachment #5: Type: text/plain, Size: 225 bytes --]


… meaning we could write (this-package-input "git-manpages.tar.gz") or
similar.  (This particular change would need tweaks in a few packages
such as ‘tzdata’ to avoid a full rebuild.)

WDYT?

Thanks,
Ludo’.

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-06 20:14       ` Liliana Marie Prikler
@ 2024-09-07 11:37         ` Simon Tournier
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-07 11:37 UTC (permalink / raw)
  To: Liliana Marie Prikler, 73073; +Cc: Vivien Kraus, Maxim Cournoyer

Hi Liliana,

I get your points.  In order to avoid duplicate discussion, please
consider the Ludo’s thread.

On Fri, 06 Sep 2024 at 22:14, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:

>                                      I'd also hazard a guess that Rust
> being Rust, no useful information for Rust packages comes with package-
> direct-inputs if arguments aren't being handled.

Yes, I am aware of the Rust package case. :-)

It’s similar as the Haskell
package, as I pointed years ago [1].  I still think that’s something
which needs to be improved.

Cheers,
simon


1: Re: Cabal mismatch in ghc-lucid; long-term archiving Haskell?
zimoun <zimon.toutoune@gmail.com>
Mon, 22 Aug 2022 16:04:21 +0200
id:87ilmk5q8q.fsf@gmail.com
https://lists.gnu.org/archive/html/guix-devel/2022-08
https://yhetil.org/guix/87ilmk5q8q.fsf@gmail.com




^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 0/6] Allow origin with label as inputs.
  2024-09-06 21:45 ` [bug#73073] [PATCH 0/6] Allow origin with label as inputs Ludovic Courtès
@ 2024-09-07 13:40   ` Simon Tournier
  2024-09-07 14:49     ` Liliana Marie Prikler
  2024-09-16 20:13     ` Ludovic Courtès
  0 siblings, 2 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-07 13:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: maxim.cournoyer, 73073

Hi Ludo,

On Fri, 06 Sep 2024 at 23:45, Ludovic Courtès <ludo@gnu.org> wrote:

> This is one reason why I’d rather avoid the change you’re suggesting.
> But more importantly: I think we should avoid polymorphic lists for
> clarity (the principle is followed in most of the code), and
> reintroducing labels would be a step backwards.

This is inaccurate: inputs are already polymorphic lists.  For example,

    (native-inputs (list desktop-file-utils ;for update-desktop-database
                         gettext-minimal
                         `(,glib "bin")
                         itstool
                         pkg-config
                         python))

And “bin” is a label, AFAIU.  That’s said…

> To be clear, I understand the current situation is not perfect, but I
> would rather look for solutions that do not involve undoing what’s taken
> this long to do.

…I agree: my aim is not to revive the “old style”.  Aside, from my
perspective, the main issue with the “old style” is not the labels but
instead it’s the redundancy.

In other words, labels are not the evil since they are still used for
dealing with “outputs”.

Anyway, let avoid the Walder’s law trap [1]. ;-)

So let do not rely on explicit labels.

> The main issue we want to address here is origins being hidden from
> ‘package-direct-sources’, right?

Yes…  And also I think that’s a bad pattern to not have all “inputs“ in
the same place. From my point of view, the current situation defeats my
understanding of declarative programming.


> diff --git a/guix/packages.scm b/guix/packages.scm
> index f373136d22..8b08f0d379 100644
> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -676,6 +676,8 @@ (define (add-input-label input)
>                "_")
>           ,obj
>           ,@(if (string=? output "out") '() (list output)))))
> +    ((? origin? origin)
> +     (list (or (origin-actual-file-name origin) "_") origin))
>      (x
>       `("_" ,x))))
>  
>
> … meaning we could write (this-package-input "git-manpages.tar.gz") or
> similar.  (This particular change would need tweaks in a few packages
> such as ‘tzdata’ to avoid a full rebuild.)

This solution appears to me the best approach.  Somehow, it uses
’file-name’ as internal “label”.  When internal “labels” will completely
removed, e.g., using package name or else, we will adapt.

Well, ’origin-actual-file-name’ returns for example
"libgd-2.0.4-checkout", i.e. the version would be required when calling
’this-package-input’.  Therefore, it would mean something like:

    #$(this-package-native-input (git-file-name "libgd" version))

This appears to me a good solution.

However, how is it possible to avoid a full rebuild because ’tzdata’ or
else?  It means the package definition cannot be modified, right?
Therefore, the only way would to special case ’maybe-add-input-labels’,
e.g.,

--8<---------------cut here---------------start------------->8---
@@ -441,6 +441,9 @@ (define (maybe-add-input-labels inputs)
   "Add labels to INPUTS unless it already has them."
   (cond ((null? inputs)
          inputs)
+        ((and (pair? (car inputs))
+              (origin? (cdar inputs)) )
+         inputs)
         ((and (pair? (car inputs))
               (string? (caar inputs)))
          inputs)
--8<---------------cut here---------------end--------------->8---

Would it be ok performance-wise?  Or what could the another option?

Moreover, as you said some other packages deep in the graph seem in the
picture.

Well, I am going to explore this in order to send a v2.


Cheers,
simon


1: https://wiki.haskell.org/Wadler%27s_Law





^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 0/6] Allow origin with label as inputs.
  2024-09-07 13:40   ` Simon Tournier
@ 2024-09-07 14:49     ` Liliana Marie Prikler
  2024-09-16 20:13     ` Ludovic Courtès
  1 sibling, 0 replies; 28+ messages in thread
From: Liliana Marie Prikler @ 2024-09-07 14:49 UTC (permalink / raw)
  To: Simon Tournier, Ludovic Courtès; +Cc: maxim.cournoyer, 73073

Hi Simon,

since you pointed me here, I will chime in a little :)

Am Samstag, dem 07.09.2024 um 15:40 +0200 schrieb Simon Tournier:
> Hi Ludo,
> 
> On Fri, 06 Sep 2024 at 23:45, Ludovic Courtès <ludo@gnu.org> wrote:
> 
> > This is one reason why I’d rather avoid the change you’re
> > suggesting.
> > But more importantly: I think we should avoid polymorphic lists for
> > clarity (the principle is followed in most of the code), and
> > reintroducing labels would be a step backwards.
> 
> This is inaccurate: inputs are already polymorphic lists.  For
> example,
> 
>     (native-inputs (list desktop-file-utils ;for update-desktop-
> database
>                          gettext-minimal
>                          `(,glib "bin")
>                          itstool
>                          pkg-config
>                          python))
> 
> And “bin” is a label, AFAIU.  That’s said…
Not in the sense that you are addressing inputs with it, no.  "bin" is
an output selector (output "label" if you will) – its purpose it to
choose an output that isn't "out".

> > To be clear, I understand the current situation is not perfect, but
> > I would rather look for solutions that do not involve undoing
> > what’s taken this long to do.
> 
> …I agree: my aim is not to revive the “old style”.  Aside, from my
> perspective, the main issue with the “old style” is not the labels
> but instead it’s the redundancy.
> 
> In other words, labels are not the evil since they are still used for
> dealing with “outputs”.
> 
> Anyway, let avoid the Walder’s law trap [1]. ;-)
> 
> So let do not rely on explicit labels.
But you are adding explicit labels here.  A solution that doesn't would
be much preferred.

> > The main issue we want to address here is origins being hidden from
> > ‘package-direct-sources’, right?
> 
> Yes…  And also I think that’s a bad pattern to not have all “inputs“
> in the same place. From my point of view, the current situation
> defeats my understanding of declarative programming.
I agree with you that inputs outside of inputs should be avoided, but I
disagree with your point on declarative programming.  Packages, even
written in that style, are still declarative.

> > diff --git a/guix/packages.scm b/guix/packages.scm
> > index f373136d22..8b08f0d379 100644
> > --- a/guix/packages.scm
> > +++ b/guix/packages.scm
> > @@ -676,6 +676,8 @@ (define (add-input-label input)
> >                "_")
> >           ,obj
> >           ,@(if (string=? output "out") '() (list output)))))
> > +    ((? origin? origin)
> > +     (list (or (origin-actual-file-name origin) "_") origin))
> >      (x
> >       `("_" ,x))))
> >  
> > 
> > … meaning we could write (this-package-input "git-manpages.tar.gz")
> > or similar.  (This particular change would need tweaks in a few
> > packages such as ‘tzdata’ to avoid a full rebuild.)
> 
> This solution appears to me the best approach.  Somehow, it uses
> ’file-name’ as internal “label”.  When internal “labels” will
> completely removed, e.g., using package name or else, we will adapt.
> 
> Well, ’origin-actual-file-name’ returns for example
> "libgd-2.0.4-checkout", i.e. the version would be required when
> calling ’this-package-input’.  Therefore, it would mean something
> like:
> 
>     #$(this-package-native-input (git-file-name "libgd" version))
> 
> This appears to me a good solution.
It doesn't to me.  What do you do if the libgd version changes?  To
arrive at a proper label, you would have to strip the versioning and
packaging metadata – otherwise you're left with a situation, where you
can't replace the package by tweaking inputs anyway.

> However, how is it possible to avoid a full rebuild because ’tzdata’
> or else?  It means the package definition cannot be modified, right?
> Therefore, the only way would to special case ’maybe-add-input-
> labels’, e.g.,
> 
> --8<---------------cut here---------------start------------->8---
> @@ -441,6 +441,9 @@ (define (maybe-add-input-labels inputs)
>    "Add labels to INPUTS unless it already has them."
>    (cond ((null? inputs)
>           inputs)
> +        ((and (pair? (car inputs))
> +              (origin? (cdar inputs)) )
> +         inputs)
>          ((and (pair? (car inputs))
>                (string? (caar inputs)))
>           inputs)
> --8<---------------cut here---------------end--------------->8---
> 
> Would it be ok performance-wise?  Or what could the another option?
I don't think this does what you think it does.
It returns inputs as-is if the tail of the first input is an origin…
which I don't think would be the case even if we do implement your v1.


Cheers




^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style".
  2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
                   ` (6 preceding siblings ...)
  2024-09-06 21:45 ` [bug#73073] [PATCH 0/6] Allow origin with label as inputs Ludovic Courtès
@ 2024-09-10  1:27 ` Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 1/8] guix: packages: " Simon Tournier
                     ` (7 more replies)
  7 siblings, 8 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

Hi,

Following Ludo's advice [1], here the v2.

Packages use ’package-name’ as internal labels so the first patch of the serie
adds ’origin-actual-file-name’ as internal labels for the origins.  Then, the
’origin’ is found back via ’this-package-input’ as for the packages.

For instance, without the patch, we have somewhere in the phase:

        #$(origin
            (method url-fetch)
            (uri (string-append
                  "mirror://kernel.org/software/scm/git/"
                  "git-manpages-" (package-version this-package) ".tar.xz"))
            (sha256
             (base32
              "1lvvhzypllbyd8j6m0p9qgd3gqg10gch9s7lqif8vr9n80fqn4fw"))))))))))))

then with the patch, this origin is moved to the ’native-inputs’ field and the
snippet above is replaced by:

        #$(this-package-native-input
           (string-append
            "git-manpages-" (package-version this-package) ".tar.xz")))))))))))


Please note the two special cases: tzdata and texlive-hyphen-complete.  They
are considered in order to avoid a world rebuild.  The final adjusment can be
addressed with some “build train” (or “merge train”) as discussed elsewhere.


The other patches of the series provide more examples of the usage.

WDYT?

Cheers,
simon


1: [bug#73073] [PATCH 0/6] Allow origin with label as inputs.
Ludovic Courtès <ludo@gnu.org>
Fri, 06 Sep 2024 23:45:04 +0200
id:87o750wj6n.fsf@gnu.org
https://issues.guix.gnu.org/73073
https://issues.guix.gnu.org/msgid/87o750wj6n.fsf@gnu.org
https://yhetil.org/guix/87o750wj6n.fsf@gnu.org


Simon Tournier (8):
  guix: packages: Allow origin inside inputs with "new style".
  gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs.
  gnu: smithforth: Move system.fs origin from phases to native-inputs.
  gnu: farstream: Move common origin from phases to native-inputs.
  gnu: gnulib: Move phobos origin from phases to native-inputs.
  gnu: git: Move git-manpages origin from phases to native-inputs.
  gnu: cgit: Remove input labels.

 gnu/packages/build-tools.scm     | 18 ++++----
 gnu/packages/dlang.scm           | 21 ++++-----
 gnu/packages/forth.scm           | 20 +++++----
 gnu/packages/freedesktop.scm     | 24 +++++-----
 gnu/packages/gnome.scm           | 19 ++++----
 gnu/packages/version-control.scm | 75 +++++++++++++++++---------------
 guix/packages.scm                | 10 +++++
 7 files changed, 106 insertions(+), 81 deletions(-)


base-commit: 85a603f58b9b6fef86984a3b2cfc27bd13314ba1
-- 
2.45.2





^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 1/8] guix: packages: Allow origin inside inputs with "new style".
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  2024-09-16 20:19     ` Ludovic Courtès
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs Simon Tournier
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073
  Cc: Simon Tournier, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
	Tobias Geerinckx-Rice

* guix/packages.scm (add-input-label): Rely on 'origin-actual-file-name' for
internal inputs labels.
(maybe-add-input-labels): Special case to avoid world rebuild.

Change-Id: I6ba5352b1b1b8ab810da3730b09cb9db61d6429c
---
 guix/packages.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..35dba6adc3 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -444,6 +444,9 @@ (define (maybe-add-input-labels inputs)
         ((and (pair? (car inputs))
               (string? (caar inputs)))
          inputs)
+        ((and (origin? (car inputs))    ;XXXX: Remove next world rebuild
+              (null? (cdr inputs)))     ;special case tzdata
+         (list (list "_" (car inputs))))
         (else (map add-input-label inputs))))
 
 (define (add-input-labels . inputs)
@@ -676,6 +679,13 @@ (define (add-input-label input)
               "_")
          ,obj
          ,@(if (string=? output "out") '() (list output)))))
+    ((? origin? origin)                 ;XXXX: Remove next world rebuild
+     (let ((texlive (package-source
+                     (module-ref (resolve-interface '(gnu packages tex))
+                                 'texlive-latex))))
+       (if (eq? input texlive)
+           (list "_" origin)
+           (list (or (origin-actual-file-name origin) "_") origin))))
     (x
      `("_" ,x))))
 
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 1/8] guix: packages: " Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  2024-09-10  4:30     ` Liliana Marie Prikler
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 3/8] gnu: dmd-bootstrap: Move phobos " Simon Tournier
                     ` (5 subsequent siblings)
  7 siblings, 1 reply; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier, Liliana Marie Prikler, Maxim Cournoyer,
	Vivien Kraus

* gnu/packages/dlang.scm (gnome-recipes)[arguments]<phases>: Move libgd
origin from here...
[native-inputs]: ...to here.

Change-Id: Ic1775a66608e114b5b31058386c8b739c155b7a5
---
 gnu/packages/gnome.scm | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 7339000436..d80d8cf33f 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -799,15 +799,7 @@ (define-public gnome-recipes
           (add-after 'unpack 'unpack-libgd
             (lambda _
               (copy-recursively
-               #$(origin
-                   (method git-fetch)
-                   (uri (git-reference
-                         (url "https://gitlab.gnome.org/GNOME/libgd")
-                         (commit "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
-                   (file-name (git-file-name "libgd" version))
-                   (sha256
-                    (base32
-                     "16yld0ap7qj1n96h4f2sqkjmibg7xx5xwkqxdfzam2nmyfdlrrrs")))
+               #$(this-package-native-input (git-file-name "libgd" version))
                "subprojects/libgd"))))))
     (inputs (list glib
                   gnome-autoar
@@ -821,6 +813,15 @@ (define-public gnome-recipes
     (native-inputs (list desktop-file-utils ;for update-desktop-database
                          gettext-minimal
                          `(,glib "bin")
+                         (origin
+                           (method git-fetch)
+                           (uri (git-reference
+                                 (url "https://gitlab.gnome.org/GNOME/libgd")
+                                 (commit "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
+                           (file-name (git-file-name "libgd" version))
+                           (sha256
+                            (base32
+                             "16yld0ap7qj1n96h4f2sqkjmibg7xx5xwkqxdfzam2nmyfdlrrrs")))
                          itstool
                          pkg-config
                          python))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 3/8] gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs.
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 1/8] guix: packages: " Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 4/8] gnu: smithforth: Move system.fs " Simon Tournier
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (dmd-bootstrap)[arguments]<phases>: Move phobos
origin from here...
[native-inputs]: ...to here.

Change-Id: I10cb5f628dad2fdbb01df58134996bdcd0b73d62
---
 gnu/packages/dlang.scm | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 8bf0ee685e..1fd1c8d58c 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -456,15 +456,7 @@ (define dmd-bootstrap
             (lambda _
               (symlink "." "dmd")  ;to please the build system expected layout
               (copy-recursively
-               #$(origin
-                   (method git-fetch)
-                   (uri (git-reference
-                         (url "https://github.com/dlang/phobos")
-                         (commit (string-append "v" version))))
-                   (file-name (git-file-name "phobos" version))
-                   (sha256
-                    (base32
-                     "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9")))
+               #$(this-package-native-input (git-file-name "phobos" version))
                "phobos")
               (chdir "phobos")))
           (add-after 'copy-phobos-source-and-chdir 'adjust-phobos-install-dirs
@@ -519,7 +511,16 @@ (define dmd-bootstrap
                  "lib")
                 (("\\.\\./src/(phobos|druntime/import)")
                  "include/dmd")))))))
-    (native-inputs (list gdmd which))
+    (native-inputs (list gdmd which
+                         (origin
+                           (method git-fetch)
+                           (uri (git-reference
+                                 (url "https://github.com/dlang/phobos")
+                                 (commit (string-append "v" version))))
+                           (file-name (git-file-name "phobos" version))
+                           (sha256
+                            (base32
+                             "1yw7nb5d78cx9m7sfibv7rfc7wj3w0dw9mfk3d269qpfpnwzs4n9")))))
     (home-page "https://github.com/dlang/dmd")
     (synopsis "Reference D Programming Language compiler")
     (description "@acronym{DMD, Digital Mars D compiler} is the reference
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 4/8] gnu: smithforth: Move system.fs origin from phases to native-inputs.
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
                     ` (2 preceding siblings ...)
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 3/8] gnu: dmd-bootstrap: Move phobos " Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 5/8] gnu: farstream: Move common " Simon Tournier
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (smithforth)[arguments]<phases>: Move system.fs
origin from here...
[native-inputs]: ...to here.

Change-Id: I82ff81f72dbe2ecf70fbbd44674596e1a62cadcf
---
 gnu/packages/forth.scm | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/forth.scm b/gnu/packages/forth.scm
index 6e8d8cdc4c..c523887871 100644
--- a/gnu/packages/forth.scm
+++ b/gnu/packages/forth.scm
@@ -75,7 +75,15 @@ (define-public smithforth
         (sha256
           (base32 "0a39pv7529llsa3f48fmvwvlcp3f9v8qkn5ziw2l6kxf0qvli3lm"))))
     (build-system trivial-build-system)
-    (native-inputs (list xxd))
+    (native-inputs (list xxd
+                         (origin
+                           (method url-fetch)
+                           (uri (string-append
+                                 "https://dacvs.neocities.org/SF/system"
+                                 version "fs.txt"))
+                           (sha256
+                            (base32
+                             "17v1pp64s6n8q8w3kg48nd7zdcx2208y4svr5fpfms5lkyzg7z1m")))))
     (arguments
       (list
         #:modules '((guix build utils))
@@ -84,14 +92,8 @@ (define-public smithforth
             (use-modules (guix build utils)
                          (ice-9 textual-ports))
             (let* ((sforth.dmp #$(package-source this-package))
-                   (system.fs  #$(origin
-                                   (method url-fetch)
-                                   (uri (string-append
-                                          "https://dacvs.neocities.org/SF/system"
-                                          version "fs.txt"))
-                                   (sha256
-                                    (base32
-                                     "17v1pp64s6n8q8w3kg48nd7zdcx2208y4svr5fpfms5lkyzg7z1m"))))
+                   (system.fs  #$(this-package-native-input
+                                  (string-append "system" version "fs.txt")))
                    (xxd        (string-append (assoc-ref %build-inputs "xxd")
                                               "/bin/xxd"))
                    (bin        (string-append (assoc-ref %outputs "out") "/bin")))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 5/8] gnu: farstream: Move common origin from phases to native-inputs.
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
                     ` (3 preceding siblings ...)
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 4/8] gnu: smithforth: Move system.fs " Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 6/8] gnu: gnulib: Move phobos " Simon Tournier
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (farstream)[arguments]<phases>: Move common
origin from here...
[native-inputs]: ...to here.

Change-Id: I0023bca2fc021b82875b1ec7329c7e37116df0b3
---
 gnu/packages/freedesktop.scm | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index cb1d625d24..56bd54a27f 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -263,16 +263,8 @@ (define-public farstream
             (lambda _
               (delete-file "autogen.sh")
               (copy-recursively
-               #$(origin
-                   (method git-fetch)
-                   (uri
-                    (git-reference
-                     (url "https://gitlab.freedesktop.org/gstreamer/common.git")
-                     (commit "52adcdb89a9eb527df38c569539d95c1c7aeda6e")))
-                   (file-name (git-file-name "common" "latest.52adcdb"))
-                   (sha256
-                    (base32
-                     "1zlm1q1lgcb76gi82rial5bwy2j9sz1x6x48ijhiz89cml7xxd1r")))
+               #$(this-package-native-input
+                  (git-file-name "common" "latest.52adcdb"))
                "common")))
           (add-after 'unpack 'disable-problematic-tests
             (lambda _
@@ -296,7 +288,17 @@ (define-public farstream
            libxslt
            perl
            pkg-config
-           python-wrapper))
+           python-wrapper
+           (origin
+             (method git-fetch)
+             (uri
+              (git-reference
+               (url "https://gitlab.freedesktop.org/gstreamer/common.git")
+               (commit "52adcdb89a9eb527df38c569539d95c1c7aeda6e")))
+             (file-name (git-file-name "common" "latest.52adcdb"))
+             (sha256
+              (base32
+               "1zlm1q1lgcb76gi82rial5bwy2j9sz1x6x48ijhiz89cml7xxd1r")))))
     (inputs
      (list glib
            gtk+
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 6/8] gnu: gnulib: Move phobos origin from phases to native-inputs.
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
                     ` (4 preceding siblings ...)
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 5/8] gnu: farstream: Move common " Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 7/8] gnu: git: Move git-manpages " Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 8/8] gnu: cgit: Remove input labels Simon Tournier
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/dlang.scm (gnulib-checkout)[arguments]<phases>: Move PropList
origin from here...
[native-inputs]: ...to here.

Change-Id: I3576a169837039bc6beaae0d68ab459ed642e3c8
---
 gnu/packages/build-tools.scm | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 21df25e4f5..61901c0bbb 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -942,14 +942,7 @@ (define*-public (gnulib-checkout #:key
                                         "Scripts.txt"
                                         "Blocks.txt")
                         (list
-                         #$(origin
-                             (method url-fetch)
-                             (uri (string-append
-                                   "https://www.unicode.org/Public/"
-                                   "3.0-Update1/PropList-3.0.1.txt"))
-                             (sha256
-                              (base32
-                               "0k6wyijyzdl5g3nibcwfm898kfydx1pqaz28v7fdvnzdvd5fz7lh"))))
+                         #$(this-package-native-input "PropList.txt"))
                         (find-ucd-files "BidiMirroring.txt"
                                         "EastAsianWidth.txt"
                                         "LineBreak.txt"
@@ -982,6 +975,15 @@ (define*-public (gnulib-checkout #:key
       bash-minimal python perl clisp
       ;; Unicode data:
       ucd
+      (origin
+        (method url-fetch)
+        (uri (string-append
+              "https://www.unicode.org/Public/"
+              "3.0-Update1/PropList-3.0.1.txt"))
+        (file-name "PropList.txt")
+        (sha256
+         (base32
+          "0k6wyijyzdl5g3nibcwfm898kfydx1pqaz28v7fdvnzdvd5fz7lh")))
       ;; Programs for the tests:
       cppi indent git-minimal/pinned autoconf))
     (home-page "https://www.gnu.org/software/gnulib/")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 7/8] gnu: git: Move git-manpages origin from phases to native-inputs.
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
                     ` (5 preceding siblings ...)
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 6/8] gnu: gnulib: Move phobos " Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 8/8] gnu: cgit: Remove input labels Simon Tournier
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/version-control.scm (git)[arguments]<phases>: Move git-manpages
origin from here...
[native-inputs]: ...to here.

Change-Id: I4affbb032523e634b82c7e33343d0dc0797cb393
---
 gnu/packages/version-control.scm | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 0c4cdedce8..a0fdcb0da9 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -693,15 +693,9 @@ (define-public git
                   (with-directory-excursion man
                     (invoke
                      "tar" "xvf"
-                     #$(origin
-                         (method url-fetch)
-                         (uri (string-append
-                               "mirror://kernel.org/software/scm/git/"
-                               "git-manpages-" (package-version this-package)
-                               ".tar.xz"))
-                         (sha256
-                          (base32
-                           "1lvvhzypllbyd8j6m0p9qgd3gqg10gch9s7lqif8vr9n80fqn4fw"))))))))))))
+                     #$(this-package-native-input
+                        (string-append
+                         "git-manpages-" (package-version this-package) ".tar.xz")))))))))))
     (native-inputs
      (modify-inputs (package-native-inputs git-minimal)
        ;; For subtree documentation.
@@ -712,7 +706,18 @@ (define-public git
                libxslt
                pkg-config
                texinfo
-               xmlto)))
+               xmlto
+               ;; To build the man pages from the git sources, we would need a dependency
+               ;; on a full XML tool chain, and building it actually takes ages.  So we
+               ;; use this lazy approach and use released tarball.
+               (origin
+                 (method url-fetch)
+                 (uri (string-append
+                       "mirror://kernel.org/software/scm/git/git-manpages-"
+                       (package-version this-package) ".tar.xz"))
+                 (sha256
+                  (base32
+                   "1pqrp46kwbxycqld39027ph1cvkq9am156y3sswn6w2khsg30f09"))))))
     (inputs
      (modify-inputs (package-inputs git-minimal)
        (append bash-minimal             ;for wrap-program
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 8/8] gnu: cgit: Remove input labels.
  2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
                     ` (6 preceding siblings ...)
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 7/8] gnu: git: Move git-manpages " Simon Tournier
@ 2024-09-10  1:27   ` Simon Tournier
  7 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  1:27 UTC (permalink / raw)
  To: 73073; +Cc: Simon Tournier

* gnu/packages/version-control.scm (cgit)
[inputs]: Remove labels.
[arguments]<phases>: Adjust.

Change-Id: Iff479fa636f7a4c4fef5137ae22934d4e213223b
---
 gnu/packages/version-control.scm | 50 +++++++++++++++++---------------
 1 file changed, 26 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index a0fdcb0da9..5b28eeaa9e 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1315,7 +1315,7 @@ (define-public cgit
               (lambda* (#:key inputs #:allow-other-keys)
                 ;; Unpack the source of git into the 'git' directory.
                 (invoke "tar" "--strip-components=1" "-C" "git" "-xf"
-                        (assoc-ref inputs "git-source"))))
+                        #$(this-package-input "git-source"))))
             (add-after 'unpack 'patch-absolute-file-names
               (lambda* (#:key inputs outputs #:allow-other-keys)
                 (define (quoted-file-name input path)
@@ -1370,29 +1370,31 @@ (define-public cgit
        ;; For building manpage.
        (list asciidoc))
       (inputs
-       `( ;; Building cgit requires a Git source tree.
-         ("git-source"
-          ,(origin
-             (method url-fetch)
-             ;; cgit is tightly bound to git.  Use GIT_VER from the Makefile,
-             ;; which may not match the current (package-version git).
-             (uri "mirror://kernel.org/software/scm/git/git-2.46.0.tar.xz")
-             (sha256
-              (base32 "15bzq9m6c033qiz5q5gw1nqw4m452vvqax30wbms6z4bl9i384kz"))))
-         ("bash-minimal" ,bash-minimal)
-         ("openssl" ,openssl)
-         ("python" ,python)
-         ("python-docutils" ,python-docutils)
-         ("python-markdown" ,python-markdown)
-         ("python-pygments" ,python-pygments)
-         ("zlib" ,zlib)
-         ;; bzip2, groff, gzip and xz are inputs (not native inputs)
-         ;; since they are actually substituted into cgit source and
-         ;; referenced by the built package output.
-         ("bzip2" ,bzip2)
-         ("groff" ,groff)
-         ("gzip" ,gzip)
-         ("xz" ,xz)))
+       (list
+        ;; Building cgit requires a Git source tree.
+        (origin
+          (method url-fetch)
+          ;; cgit is tightly bound to git.  Use GIT_VER from the Makefile,
+          ;; which may not match the current (package-version git).
+          (uri "mirror://kernel.org/software/scm/git/git-2.46.0.tar.xz")
+          (sha256
+           (base32 "15bzq9m6c033qiz5q5gw1nqw4m452vvqax30wbms6z4bl9i384kz"))
+          (file-name "git-source"))
+        bash-minimal
+        openssl
+        python
+        python-docutils
+        python-markdown
+        python-pygments
+        zlib
+        ;; bzip2, groff, gzip and xz are inputs (not native inputs)
+        ;; since they are actually substituted into cgit source and
+        ;; referenced by the built package output.
+
+        bzip2
+        groff
+        gzip
+        xz))
       (home-page "https://git.zx2c4.com/cgit/")
       (synopsis "Web frontend for git repositories")
       (description
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs Simon Tournier
@ 2024-09-10  4:30     ` Liliana Marie Prikler
  2024-09-10  7:58       ` Simon Tournier
  0 siblings, 1 reply; 28+ messages in thread
From: Liliana Marie Prikler @ 2024-09-10  4:30 UTC (permalink / raw)
  To: Simon Tournier, 73073; +Cc: Vivien Kraus, Maxim Cournoyer

Am Dienstag, dem 10.09.2024 um 03:27 +0200 schrieb Simon Tournier:
> * gnu/packages/dlang.scm (gnome-recipes)[arguments]<phases>: Move
> libgd
> origin from here...
> [native-inputs]: ...to here.
> 
> Change-Id: Ic1775a66608e114b5b31058386c8b739c155b7a5
> ---
>  gnu/packages/gnome.scm | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index 7339000436..d80d8cf33f 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -799,15 +799,7 @@ (define-public gnome-recipes
>            (add-after 'unpack 'unpack-libgd
>              (lambda _
>                (copy-recursively
> -               #$(origin
> -                   (method git-fetch)
> -                   (uri (git-reference
> -                         (url
> "https://gitlab.gnome.org/GNOME/libgd")
> -                         (commit
> "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
> -                   (file-name (git-file-name "libgd" version))
> -                   (sha256
> -                    (base32
> -                    
> "16yld0ap7qj1n96h4f2sqkjmibg7xx5xwkqxdfzam2nmyfdlrrrs")))
> +               #$(this-package-native-input (git-file-name "libgd"
> version))
>                 "subprojects/libgd"))))))
>      (inputs (list glib
>                    gnome-autoar
> @@ -821,6 +813,15 @@ (define-public gnome-recipes
>      (native-inputs (list desktop-file-utils ;for update-desktop-
> database
>                           gettext-minimal
>                           `(,glib "bin")
> +                         (origin
> +                           (method git-fetch)
> +                           (uri (git-reference
> +                                 (url
> "https://gitlab.gnome.org/GNOME/libgd")
> +                                 (commit
> "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
> +                           (file-name (git-file-name "libgd"
> version))
"libgd-checkout" would be both more honest and easier to get right.


Cheers

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
  2024-09-10  4:30     ` Liliana Marie Prikler
@ 2024-09-10  7:58       ` Simon Tournier
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-10  7:58 UTC (permalink / raw)
  To: Liliana Marie Prikler, 73073; +Cc: Vivien Kraus, Maxim Cournoyer

Hi Liliana,

On Tue, 10 Sep 2024 at 06:30, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:

>> +               #$(this-package-native-input (git-file-name "libgd" version))

[...]

>> +                         (origin
>> +                           (method git-fetch)
>> +                           (uri (git-reference
>> +                                 (url "https://gitlab.gnome.org/GNOME/libgd")
>> +                                 (commit "c7c7ff4e05d3fe82854219091cf116cce6b19de0")))
>> +                           (file-name (git-file-name "libgd" version))
>
> "libgd-checkout" would be both more honest and easier to get right.

Thanks for the feedback.

Cheers,
simon




^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH 0/6] Allow origin with label as inputs.
  2024-09-07 13:40   ` Simon Tournier
  2024-09-07 14:49     ` Liliana Marie Prikler
@ 2024-09-16 20:13     ` Ludovic Courtès
  1 sibling, 0 replies; 28+ messages in thread
From: Ludovic Courtès @ 2024-09-16 20:13 UTC (permalink / raw)
  To: Simon Tournier; +Cc: maxim.cournoyer, 73073

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

Hi,

Simon Tournier <zimon.toutoune@gmail.com> skribis:

> This solution appears to me the best approach.  Somehow, it uses
> ’file-name’ as internal “label”.  When internal “labels” will completely
> removed, e.g., using package name or else, we will adapt.
>
> Well, ’origin-actual-file-name’ returns for example
> "libgd-2.0.4-checkout", i.e. the version would be required when calling
> ’this-package-input’.  Therefore, it would mean something like:
>
>     #$(this-package-native-input (git-file-name "libgd" version))
>
> This appears to me a good solution.

Yes, agreed.

> However, how is it possible to avoid a full rebuild because ’tzdata’ or
> else?  It means the package definition cannot be modified, right?

When I looked the other day I came up with this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1157 bytes --]

modified   gnu/packages/base.scm
@@ -1716,14 +1716,15 @@ (define-public tzdata
                      (delete-file-recursively
                       (string-append out "/share/zoneinfo-leaps")))))
                (delete 'configure))))
-    (inputs (list (origin
-                    (method url-fetch)
-                    (uri (string-append
-                          "https://data.iana.org/time-zones/releases/tzcode"
-                          version ".tar.gz"))
-                    (sha256
-                     (base32
-                      "07hn7hn2klw4dfyr673ril2nrk18198hbfv25gljsvc833hzk9g9")))))
+    (inputs `(("_"                                ;<- avoid a rebuild
+               ,(origin
+                  (method url-fetch)
+                  (uri (string-append
+                        "https://data.iana.org/time-zones/releases/tzcode"
+                        version ".tar.gz"))
+                  (sha256
+                   (base32
+                    "07hn7hn2klw4dfyr673ril2nrk18198hbfv25gljsvc833hzk9g9"))))))
     (home-page "https://www.iana.org/time-zones")
     (synopsis "Database of current and historical time zones")

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]


Of course this is ugly, but it’s IMO okay if we only have to do it for a
few packages (and for a limited amount of time).

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 1/8] guix: packages: Allow origin inside inputs with "new style".
  2024-09-10  1:27   ` [bug#73073] [PATCH v2 1/8] guix: packages: " Simon Tournier
@ 2024-09-16 20:19     ` Ludovic Courtès
  2024-09-16 20:42       ` Simon Tournier
  0 siblings, 1 reply; 28+ messages in thread
From: Ludovic Courtès @ 2024-09-16 20:19 UTC (permalink / raw)
  To: Simon Tournier
  Cc: Christopher Baines, Josselin Poiret, Tobias Geerinckx-Rice,
	Mathieu Othacehe, 73073

Simon Tournier <zimon.toutoune@gmail.com> skribis:

> * guix/packages.scm (add-input-label): Rely on 'origin-actual-file-name' for
> internal inputs labels.
> (maybe-add-input-labels): Special case to avoid world rebuild.
>
> Change-Id: I6ba5352b1b1b8ab810da3730b09cb9db61d6429c

[...]

> @@ -444,6 +444,9 @@ (define (maybe-add-input-labels inputs)
>          ((and (pair? (car inputs))
>                (string? (caar inputs)))
>           inputs)
> +        ((and (origin? (car inputs))    ;XXXX: Remove next world rebuild
> +              (null? (cdr inputs)))     ;special case tzdata
> +         (list (list "_" (car inputs))))

I would rather have this hack in ‘tzdata’ itself, along the lines of
what I sent in a previous message.

> @@ -676,6 +679,13 @@ (define (add-input-label input)
>                "_")
>           ,obj
>           ,@(if (string=? output "out") '() (list output)))))
> +    ((? origin? origin)                 ;XXXX: Remove next world rebuild
> +     (let ((texlive (package-source
> +                     (module-ref (resolve-interface '(gnu packages tex))
> +                                 'texlive-latex))))
> +       (if (eq? input texlive)
> +           (list "_" origin)
> +           (list (or (origin-actual-file-name origin) "_") origin))))

I think this should be avoided, but what is it that causes a rebuild in
this case?

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 28+ messages in thread

* [bug#73073] [PATCH v2 1/8] guix: packages: Allow origin inside inputs with "new style".
  2024-09-16 20:19     ` Ludovic Courtès
@ 2024-09-16 20:42       ` Simon Tournier
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Tournier @ 2024-09-16 20:42 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: Christopher Baines, Josselin Poiret, Tobias Geerinckx-Rice, 73073,
	Mathieu Othacehe

Hi Ludo,

On Mon, 16 Sep 2024 at 22:19, Ludovic Courtès <ludo@gnu.org> wrote:
> Simon Tournier <zimon.toutoune@gmail.com> skribis:
>
>> * guix/packages.scm (add-input-label): Rely on 'origin-actual-file-name' for
>> internal inputs labels.
>> (maybe-add-input-labels): Special case to avoid world rebuild.
>>
>> Change-Id: I6ba5352b1b1b8ab810da3730b09cb9db61d6429c
>
> [...]
>
>> @@ -444,6 +444,9 @@ (define (maybe-add-input-labels inputs)
>>          ((and (pair? (car inputs))
>>                (string? (caar inputs)))
>>           inputs)
>> +        ((and (origin? (car inputs))    ;XXXX: Remove next world rebuild
>> +              (null? (cdr inputs)))     ;special case tzdata
>> +         (list (list "_" (car inputs))))
>
> I would rather have this hack in ‘tzdata’ itself, along the lines of
> what I sent in a previous message.

Yes, indeed tzdata can temporarily transformed into the old style.  It
avoids the world rebuild and it’s a modification easier to change than
the one about maybe-add-input-labels.  I agree that’s better.


>> @@ -676,6 +679,13 @@ (define (add-input-label input)
>>                "_")
>>           ,obj
>>           ,@(if (string=? output "out") '() (list output)))))
>> +    ((? origin? origin)                 ;XXXX: Remove next world rebuild
>> +     (let ((texlive (package-source
>> +                     (module-ref (resolve-interface '(gnu packages tex))
>> +                                 'texlive-latex))))
>> +       (if (eq? input texlive)
>> +           (list "_" origin)
>> +           (list (or (origin-actual-file-name origin) "_") origin))))
>
> I think this should be avoided, but what is it that causes a rebuild in
> this case?

It’s about the package texlive-hyphen-complete; it leads to a world
rebuild – as pointed in the cover letter of v2 ;-)

It reads:

    (native-inputs
     (list ruby-2.7
           ruby-hydra-minimal/pinned
           ;; Build phase requires "docstrip.tex" from TEXLIVE-LATEX.
           ;; However, adding this package to native inputs would initiate
           ;; a circular dependency.  To work around this, use TEXLIVE-LATEX
           ;; source, then add "docstrip.tex" to TEXINPUTS before build.
           (package-source texlive-latex)
           texlive-tex))

then:

          (add-before 'build 'include-docstrip.tex
            (lambda* (#:key inputs native-inputs #:allow-other-keys)
              (let ((docstrip.tex
                     (search-input-file (or native-inputs inputs)
                                        "tex/latex/base/docstrip.tex")))


Well, we can apply the same hack as tzdata: temporarily revert to the
old style.

Cheers,
simon




^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2024-09-19  4:38 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 1/6] guix: packages: " Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 2/6] gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 3/6] gnu: smithforth: Move system.fs " Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd " Simon Tournier
2024-09-06 17:33   ` Liliana Marie Prikler
2024-09-06 18:11     ` Simon Tournier
2024-09-06 20:14       ` Liliana Marie Prikler
2024-09-07 11:37         ` Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 5/6] gnu: farstream: Move common " Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 6/6] gnu: gnulib: Move phobos " Simon Tournier
2024-09-06 21:45 ` [bug#73073] [PATCH 0/6] Allow origin with label as inputs Ludovic Courtès
2024-09-07 13:40   ` Simon Tournier
2024-09-07 14:49     ` Liliana Marie Prikler
2024-09-16 20:13     ` Ludovic Courtès
2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 1/8] guix: packages: " Simon Tournier
2024-09-16 20:19     ` Ludovic Courtès
2024-09-16 20:42       ` Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs Simon Tournier
2024-09-10  4:30     ` Liliana Marie Prikler
2024-09-10  7:58       ` Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 3/8] gnu: dmd-bootstrap: Move phobos " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 4/8] gnu: smithforth: Move system.fs " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 5/8] gnu: farstream: Move common " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 6/8] gnu: gnulib: Move phobos " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 7/8] gnu: git: Move git-manpages " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 8/8] gnu: cgit: Remove input labels Simon Tournier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).