diff mbox

[bug#73073,0/6] Allow origin with label as inputs.

Message ID 878qvrbbmj.fsf@gnu.org
State New
Headers show

Commit Message

Ludovic Courtès Sept. 16, 2024, 8:13 p.m. UTC
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:
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’.
diff mbox

Patch

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")