unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#55920] [PATCH] build-system: chicken: Added insert-missing-version phase
@ 2022-06-12  0:45 Michal Atlas
  2022-06-15 11:26 ` Liliana Marie Prikler
  2022-06-19 20:36 ` [bug#55920] [PATCH] build-system: chicken: Added stamp-egg-version phase Michal Atlas
  0 siblings, 2 replies; 7+ messages in thread
From: Michal Atlas @ 2022-06-12  0:45 UTC (permalink / raw)
  To: 55920; +Cc: Michal Atlas

Many .egg files don't contain version information,
this causes `chicken-install` to label them {unknown},
which makes it fail compilations whenever a
dependency is tagged with a minimum-version.

I am unaware of a way to force this check to not-happen
and the version information should be included anyway,
so this patch should fix the problem.
---
 guix/build/chicken-build-system.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm
index 5db9906acf..341ab64a0f 100644
--- a/guix/build/chicken-build-system.scm
+++ b/guix/build/chicken-build-system.scm
@@ -112,6 +112,17 @@ (define* (check #:key egg-name tests? #:allow-other-keys)
   (when tests?
     (invoke "chicken-install" "-cached" "-test" "-no-install" egg-name)))
 
+(define* (insert-missing-version #:key egg-name name #:allow-other-keys)
+  "Inserts version information into the .egg file if it isn't contained already"
+  (let* ([filename (string-append egg-name "/" egg-name ".egg")]
+         [egg-info (call-with-input-file filename read)]
+         [ver? (find (λ (i) (eqv? (car i) 'version)) egg-info)]
+         [ver (substring name (1+ (string-rindex name #\-)))])
+    (when (not ver?)
+      (make-file-writable filename)
+      (call-with-output-file filename
+	(λ (f) (write (cons `(version ,ver) egg-info) f))))))
+
 ;; It doesn't look like Chicken generates any unnecessary references.
 ;; So we don't have to remove them either. Nice.
 
@@ -122,6 +133,7 @@ (define %standard-phases
     (delete 'configure)
     (delete 'patch-generated-file-shebangs)
     (add-before 'unpack 'setup-chicken-environment setup-chicken-environment)
+    (add-before 'build 'insert-missing-version insert-missing-version)
     (replace 'build build)
     (delete 'check)
     (replace 'install install)

base-commit: 1643402950b2d2384ec74fb69e059cc6a4c4ebed
-- 
2.36.1





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

end of thread, other threads:[~2022-06-21 19:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-12  0:45 [bug#55920] [PATCH] build-system: chicken: Added insert-missing-version phase Michal Atlas
2022-06-15 11:26 ` Liliana Marie Prikler
2022-06-15 11:29   ` Maxime Devos
2022-06-15 11:32     ` Liliana Marie Prikler
2022-06-15 11:40   ` Tobias Geerinckx-Rice via Guix-patches via
2022-06-19 20:36 ` [bug#55920] [PATCH] build-system: chicken: Added stamp-egg-version phase Michal Atlas
2022-06-21 19:44   ` bug#55920: " Liliana Marie Prikler

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