guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: import: crate: Provide a default home-page value.


From: David Craven
Subject: 02/03: import: crate: Provide a default home-page value.
Date: Sun, 1 Jan 2017 17:22:00 +0000 (UTC)

dvc pushed a commit to branch master
in repository guix.

commit f53a5514e0e9535d2e7c668803e64b4aac17da2b
Author: David Craven <address@hidden>
Date:   Sun Jan 1 16:14:45 2017 +0100

    import: crate: Provide a default home-page value.
    
    * guix/import/crate.scm (make-crate-sexp): Provide a default home-page
      value.
    * tests/crate.scm (test-crate): Add repository field.
    
    Problem reported by ng0 <address@hidden>.
---
 guix/import/crate.scm |   12 +++++++++---
 tests/crate.scm       |    1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 3a19fc7..33cc610 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -55,7 +55,8 @@
              (crate (assoc-ref crate-json "crate"))
              (name (assoc-ref crate "name"))
              (version (assoc-ref crate "max_version"))
-             (home-page (assoc-ref crate "homepage"))
+             (homepage (assoc-ref crate "homepage"))
+             (repository (assoc-ref crate "repository"))
              (synopsis (assoc-ref crate "description"))
              (description (assoc-ref crate "description"))
              (license (string->license (assoc-ref crate "license")))
@@ -67,7 +68,10 @@
               (filter (lambda (dep)
                         (not ((crate-kind-predicate "normal") dep))) deps))
              (inputs (crates->inputs input-crates))
-             (native-inputs (crates->inputs native-input-crates)))
+             (native-inputs (crates->inputs native-input-crates))
+             (home-page (match homepage
+                          (() repository)
+                          (_ homepage))))
     (callback #:name name #:version version
               #:inputs inputs #:native-inputs native-inputs
               #:home-page home-page #:synopsis synopsis
@@ -95,7 +99,9 @@ VERSION, INPUTS, NATIVE-INPUTS, HOME-PAGE, SYNOPSIS, 
DESCRIPTION, and LICENSE."
                    (build-system cargo-build-system)
                    ,@(maybe-native-inputs native-inputs)
                    ,@(maybe-inputs inputs)
-                   (home-page ,home-page)
+                   (home-page ,(match home-page
+                                 (() "")
+                                 (_ home-page)))
                    (synopsis ,synopsis)
                    (description ,(beautify-description description))
                    (license ,(match license
diff --git a/tests/crate.scm b/tests/crate.scm
index 18d5f72..6f6fc2b 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -35,6 +35,7 @@
     \"license\": \"MIT/Apache-2.0\",
     \"description\": \"summary\",
     \"homepage\": \"http://example.com\";,
+    \"repository\": \"http://example.com\";,
   }
 }")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]