summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/cabal.scm2
-rw-r--r--guix/import/cpan.scm2
-rw-r--r--guix/import/opam.scm25
-rw-r--r--guix/import/stackage.scm4
-rw-r--r--guix/import/utils.scm14
5 files changed, 31 insertions, 16 deletions
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 7dfe771e41..da00019297 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -718,7 +718,7 @@ If #f use the function 'port-filename' to obtain it."
(dependencies cabal-custom-setup-dependencies)) ; list of <cabal-dependency>
(define (cabal-flags->alist flag-list)
- "Retrun an alist associating the flag name to its default value from a
+ "Return an alist associating the flag name to its default value from a
list of <cabal-flag> objects."
(map (lambda (flag) (cons (cabal-flag-name flag) (cabal-flag-default flag)))
flag-list))
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index fd940415a2..514417f781 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -49,7 +49,7 @@
cpan-release-license
cpan-release-author
cpan-release-version
- cpan-release-modle
+ cpan-release-module
cpan-release-distribution
cpan-release-download-url
cpan-release-abstract
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 9cda3da006..6d9eb0a092 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -49,16 +49,19 @@
condition))
;; Define a PEG parser for the opam format
-(define-peg-pattern comment none (and "#" (* STRCHR) "\n"))
+(define-peg-pattern comment none (and "#" (* COMMCHR) "\n"))
(define-peg-pattern SP none (or " " "\n" comment))
(define-peg-pattern SP2 body (or " " "\n"))
(define-peg-pattern QUOTE none "\"")
(define-peg-pattern QUOTE2 body "\"")
(define-peg-pattern COLON none ":")
;; A string character is any character that is not a quote, or a quote preceded by a backslash.
+(define-peg-pattern COMMCHR none
+ (or " " "!" "\\" "\"" (range #\# #\頋)))
(define-peg-pattern STRCHR body
(or " " "!" "\n" (and (ignore "\\") "\"")
- (and (ignore "\\") "\\") (range #\# #\頋)))
+ (ignore "\\\n") (and (ignore "\\") "\\")
+ (range #\# #\頋)))
(define-peg-pattern operator all (or "=" "!" "<" ">"))
(define-peg-pattern records body (* (and (or record weird-record) (* SP))))
@@ -69,8 +72,12 @@
(define-peg-pattern choice-pat all (and (ignore "(") (* SP) choice (* SP) (ignore ")")))
(define-peg-pattern choice body
(or (and (or conditional-value ground-value) (* SP) (ignore "|") (* SP) choice)
+ group-pat
conditional-value
ground-value))
+(define-peg-pattern group-pat all
+ (and (or conditional-value ground-value) (* SP) (ignore "&") (* SP)
+ (or group-pat conditional-value ground-value)))
(define-peg-pattern ground-value body (and (or multiline-string string-pat choice-pat list-pat var) (* SP)))
(define-peg-pattern conditional-value all (and ground-value (* SP) condition))
(define-peg-pattern string-pat all (and QUOTE (* STRCHR) QUOTE))
@@ -189,6 +196,7 @@ path to the repository."
(('string-pat str) str)
;; Arbitrary select the first dependency
(('choice-pat choice ...) (dependency->input (car choice)))
+ (('group-pat val ...) (map dependency->input val))
(('conditional-value val condition)
(if (native? condition) "" (dependency->input val)))))
@@ -196,7 +204,8 @@ path to the repository."
(match dependency
(('string-pat str) "")
;; Arbitrary select the first dependency
- (('choice-pat choice ...) (dependency->input (car choice)))
+ (('choice-pat choice ...) (dependency->native-input (car choice)))
+ (('group-pat val ...) (map dependency->native-input val))
(('conditional-value val condition)
(if (native? condition) (dependency->input val) ""))))
@@ -204,7 +213,8 @@ path to the repository."
(match dependency
(('string-pat str) str)
;; Arbitrary select the first dependency
- (('choice-pat choice ...) (dependency->input (car choice)))
+ (('choice-pat choice ...) (dependency->name (car choice)))
+ (('group-pat val ...) (map dependency->name val))
(('conditional-value val condition)
(dependency->name val))))
@@ -256,9 +266,10 @@ REPOSITORY is #f, from the official OPAM repository. Return a 'package' sexp
or #f on failure."
(and-let* ((opam-file (opam-fetch name repository))
(version (assoc-ref opam-file "version"))
- (opam-content (assoc-ref opam-file "metadata"))
+ (opam-content (pk (assoc-ref opam-file "metadata")))
(url-dict (metadata-ref opam-content "url"))
- (source-url (metadata-ref url-dict "src"))
+ (source-url (or (metadata-ref url-dict "src")
+ (metadata-ref url-dict "archive")))
(requirements (metadata-ref opam-content "depends"))
(dependencies (dependency-list->names requirements))
(native-dependencies (depends->native-inputs requirements))
@@ -308,7 +319,7 @@ or #f on failure."
(filter
(lambda (name)
(not (member name '("dune" "jbuilder"))))
- dependencies))))))))
+ dependencies))))))))
(define (opam-recursive-import package-name)
(recursive-import package-name #f
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index e04073d193..ee12108815 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -42,12 +42,12 @@
(define %stackage-url "http://www.stackage.org")
(define (lts-info-ghc-version lts-info)
- "Retruns the version of the GHC compiler contained in LTS-INFO."
+ "Returns the version of the GHC compiler contained in LTS-INFO."
(and=> (assoc-ref lts-info "snapshot")
(cut assoc-ref <> "ghc")))
(define (lts-info-packages lts-info)
- "Retruns the alist of packages contained in LTS-INFO."
+ "Returns the alist of packages contained in LTS-INFO."
(or (assoc-ref lts-info "packages") '()))
(define (leave-with-message fmt . args)
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 0cfa1f8321..145515c489 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
+;;; Copyright © 2020 Helio Machado <0x2b3bfa0+guix@googlemail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -124,9 +125,12 @@ of the string VERSION is replaced by the symbol 'version."
;; https://spdx.org/licenses/
;; The psfl, gfl1.0, nmap, repoze
;; licenses doesn't have SPDX identifiers
+ ;;
+ ;; Please update guix/licenses.scm when modifying
+ ;; this list to avoid mismatches.
(match str
- ("AGPL-1.0" 'license:agpl-1.0)
- ("AGPL-3.0" 'license:agpl-3.0)
+ ("AGPL-1.0" 'license:agpl1)
+ ("AGPL-3.0" 'license:agpl3)
("Apache-1.1" 'license:asl1.1)
("Apache-2.0" 'license:asl2.0)
("BSL-1.0" 'license:boost1.0)
@@ -166,8 +170,8 @@ of the string VERSION is replaced by the symbol 'version."
("LGPL-2.0+" 'license:lgpl2.0+)
("LGPL-2.1" 'license:lgpl2.1)
("LGPL-2.1+" 'license:lgpl2.1+)
- ("LGPL-3.0" 'license:lgpl3.0)
- ("LGPL-3.0+" 'license:lgpl3.0+)
+ ("LGPL-3.0" 'license:lgpl3)
+ ("LGPL-3.0+" 'license:lgpl3+)
("MPL-1.0" 'license:mpl1.0)
("MPL-1.1" 'license:mpl1.1)
("MPL-2.0" 'license:mpl2.0)
@@ -175,7 +179,7 @@ of the string VERSION is replaced by the symbol 'version."
("NCSA" 'license:ncsa)
("OpenSSL" 'license:openssl)
("OLDAP-2.8" 'license:openldap2.8)
- ("CUA-OPL-1.0" 'license:opl1.0)
+ ("CUA-OPL-1.0" 'license:cua-opl1.0)
("QPL-1.0" 'license:qpl)
("Ruby" 'license:ruby)
("SGI-B-2.0" 'license:sgifreeb2.0)