@@ -3,6 +3,7 @@
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -229,23 +230,14 @@ (define* (egg->guix-package name version #:key (file #f) (source #f)
(else char)))
(maybe-symbol->string name)))
- (define* (egg-parse-dependency name #:key (system? #f))
- (define extract-name
- (match-lambda
- ((name version) name)
- (name name)))
-
- (define (prettify-name name)
+ (define* (egg-parse-dependency dependency #:key (system? #f))
+ (let ((name (match dependency
+ ((name version) name)
+ (name name))))
(if system?
(prettify-system-dependency name)
- (maybe-symbol->string name)))
-
- (let ((name (prettify-name (extract-name name))))
- ;; Dependencies are sometimes specified as symbols and sometimes
- ;; as strings
- (string->symbol (string-append
- (if system? "" package-name-prefix)
- name))))
+ (string-append package-name-prefix
+ (maybe-symbol->string name)))))
(define egg-propagated-inputs
(let ((dependencies (assoc-ref egg-content 'dependencies)))
@@ -277,15 +269,6 @@ (define* (egg->guix-package name version #:key (file #f) (source #f)
test+build-dependencies))
(() '()))))
- ;; Copied from (guix import hackage).
- (define (maybe-inputs input-type inputs)
- (match inputs
- (()
- '())
- ((inputs ...)
- (list (list input-type
- `(list ,@inputs))))))
-
(values
`(package
(name ,(egg-name->guix-name name))
@@ -303,16 +286,16 @@ (define* (egg->guix-package name version #:key (file #f) (source #f)
"failed to download tar archive"))))))
(build-system chicken-build-system)
(arguments ,(list 'quasiquote (list #:egg-name name)))
- ,@(maybe-inputs 'native-inputs egg-native-inputs)
- ,@(maybe-inputs 'inputs egg-inputs)
- ,@(maybe-inputs 'propagated-inputs egg-propagated-inputs)
+ ,@(maybe-native-inputs egg-native-inputs)
+ ,@(maybe-inputs egg-inputs)
+ ,@(maybe-propagated-inputs egg-propagated-inputs)
(home-page ,egg-home-page)
(synopsis ,egg-synopsis)
(description #f)
(license ,egg-licenses))
(filter (lambda (name)
(not (member name '("srfi-4"))))
- (map (compose guix-name->egg-name symbol->string)
+ (map guix-name->egg-name
(append egg-propagated-inputs
egg-native-inputs)))))))