diff options
| author | Tomas Volf <~@wolfsden.cz> | 2026-08-28 22:41:03 +0200 |
|---|---|---|
| committer | Jelle Licht <jlicht@fsfe.org> | 2026-08-29 21:19:35 +0200 |
| commit | accdba77be815bbe00868145dd66d68056eecf7a (patch) | |
| tree | f26661f89a52f0136281cd59e53c0005dda25506 | |
| parent | c15e19cdbdfdfddacdae865741809af4fa86a665 (diff) | |
Guix changed how the linux-libre's origin is constructed. Now there is one
more layer that needed to be unwrapped to get to the hash.
I modified the code to recursively find all string URIs together with their
hashes and look up the hash by the known URI (already stored in `url',
acquired by `linux-url').
Additionally, if no hash is found, we end with an explicit error, major
improvement over the original:
guix/ui.scm:1033:18: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f
* nongnu/packages/linux.scm (corrupt-linux) [find-source-hash]: Delete
procedure.
[origin->input-things, extract-sources]: New procedures.
[sources, hash]: Use them to find the hash for the `url'.
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
| -rw-r--r-- | nongnu/packages/linux.scm | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index 0fd2153..5c0c890 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | ;;; Copyright © 2023 Adam Kandur <rndd@tuta.io> | 24 | ;;; Copyright © 2023 Adam Kandur <rndd@tuta.io> |
| 25 | ;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space> | 25 | ;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space> |
| 26 | ;;; Copyright © 2023, 2024, 2025 Ada Stevenson <adanskana@gmail.com> | 26 | ;;; Copyright © 2023, 2024, 2025 Ada Stevenson <adanskana@gmail.com> |
| 27 | ;;; Copyright © 2023 Tomas Volf <~@wolfsden.cz> | 27 | ;;; Copyright © 2023, 2026 Tomas Volf <~@wolfsden.cz> |
| 28 | ;;; Copyright © 2023 PRESFIL <presfil@protonmail.com> | 28 | ;;; Copyright © 2023 PRESFIL <presfil@protonmail.com> |
| 29 | ;;; Copyright © 2024-2026 Maxim Cournoyer <maxim@guixotic.com> | 29 | ;;; Copyright © 2024-2026 Maxim Cournoyer <maxim@guixotic.com> |
| 30 | ;;; Copyright © 2025 David Wilson <david@systemcrafters.net> | 30 | ;;; Copyright © 2025 David Wilson <david@systemcrafters.net> |
| @@ -126,21 +126,27 @@ some freedo package or an output of package-version procedure." | |||
| 126 | (define extract-gexp-inputs | 126 | (define extract-gexp-inputs |
| 127 | (compose gexp-inputs force origin-uri)) | 127 | (compose gexp-inputs force origin-uri)) |
| 128 | 128 | ||
| 129 | (define (find-source-hash sources url) | 129 | (define (origin->input-things origin) |
| 130 | (let ((versioned-origin | 130 | (map gexp-input-thing (extract-gexp-inputs origin))) |
| 131 | (find (lambda (source) | 131 | |
| 132 | (let ((uri (origin-uri source))) | 132 | (define (extract-sources inputs) |
| 133 | (and (string? uri) (string=? uri url)))) sources))) | 133 | (fold (λ (input sources) |
| 134 | (if versioned-origin | 134 | (if (origin? input) |
| 135 | (origin-hash versioned-origin) | 135 | (if (string? (origin-uri input)) |
| 136 | #f))) | 136 | (acons (origin-uri input) (origin-hash input) sources) |
| 137 | (append sources | ||
| 138 | (extract-sources (origin->input-things input)))) | ||
| 139 | sources)) | ||
| 140 | '() | ||
| 141 | inputs)) | ||
| 137 | 142 | ||
| 138 | (let* ((version (package-version freedo)) | 143 | (let* ((version (package-version freedo)) |
| 139 | (url (linux-url version)) | 144 | (url (linux-url version)) |
| 140 | (pristine-source (package-source freedo)) | 145 | (pristine-source (package-source freedo)) |
| 141 | (inputs (map gexp-input-thing (extract-gexp-inputs pristine-source))) | 146 | (inputs (map gexp-input-thing (extract-gexp-inputs pristine-source))) |
| 142 | (sources (filter origin? inputs)) | 147 | (sources (extract-sources inputs)) |
| 143 | (hash (find-source-hash sources url)) | 148 | (hash (or (assoc-ref sources url) |
| 149 | (error "fail to find hash for" freedo))) | ||
| 144 | (patches | 150 | (patches |
| 145 | (delete (@@ (gnu packages linux) %boot-logo-patch) | 151 | (delete (@@ (gnu packages linux) %boot-logo-patch) |
| 146 | (origin-patches pristine-source)))) | 152 | (origin-patches pristine-source)))) |
