import: crate: Use repository when home-page is unavailable

* guix/import/crate.scm (make-crate-sexp): Always use home-page, which is
properly set up by the caller.
(crate->guix-package): Make sure to use the repository when home-page is null.
This commit is contained in:
Nicolas Goaziou 2021-02-12 22:44:35 +01:00
parent 861e567cb1
commit ab512c2104
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -2,6 +2,7 @@
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@ -192,9 +193,7 @@ (define (format-inputs inputs)
(maybe-cargo-inputs cargo-inputs)
(maybe-cargo-development-inputs
cargo-development-inputs)))
(home-page ,(match home-page
('null "")
(_ home-page)))
(home-page ,home-page)
(synopsis ,synopsis)
(description ,(beautify-description description))
(license ,(match license
@ -304,8 +303,14 @@ (define (sort-map-dependencies deps)
#:version (crate-version-number version*)
#:cargo-inputs cargo-inputs
#:cargo-development-inputs cargo-development-inputs
#:home-page (or (crate-home-page crate)
(crate-repository crate))
#:home-page
(let ((home-page (crate-home-page crate)))
(if (string? home-page)
home-page
(let ((repository (crate-repository crate)))
(if (string? repository)
repository
""))))
#:synopsis (crate-description crate)
#:description (crate-description crate)
#:license (and=> (crate-version-license version*)