mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
build-system: chicken: Add version information to eggs if missing.
Chicken eggs do not always contain version information, yet dependant packages often rely on this information being present. Thus, add a version field if it is missing. * guix/build/chicken-build-system.scm (stamp-egg-version): New variable. (%standard-phases): Add ‘stamp-egg-version’. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
parent
3589537dac
commit
4dbe1c96e4
1 changed files with 12 additions and 0 deletions
|
@ -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* (stamp-egg-version #:key egg-name name #:allow-other-keys)
|
||||
"Check if EGG-NAME.egg contains version information and add some if not."
|
||||
(let* ((filename (string-append egg-name "/" egg-name ".egg"))
|
||||
(egg-info (call-with-input-file filename read))
|
||||
(ver? (find (lambda (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
|
||||
(lambda (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 'stamp-egg-version stamp-egg-version)
|
||||
(replace 'build build)
|
||||
(delete 'check)
|
||||
(replace 'install install)
|
||||
|
|
Loading…
Reference in a new issue