diff options
Diffstat (limited to 'guix/import')
-rw-r--r-- | guix/import/cpan.scm | 3 | ||||
-rw-r--r-- | guix/import/cran.scm | 8 | ||||
-rw-r--r-- | guix/import/elpa.scm | 43 | ||||
-rw-r--r-- | guix/import/gem.scm | 5 | ||||
-rw-r--r-- | guix/import/gnu.scm | 31 | ||||
-rw-r--r-- | guix/import/texlive.scm | 28 | ||||
-rw-r--r-- | guix/import/utils.scm | 4 |
7 files changed, 75 insertions, 47 deletions
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 514417f781..87abe9c2f1 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co> ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -109,6 +109,7 @@ (home-page cpan-release-home-page "resources" (match-lambda (#f #f) + ((? unspecified?) #f) ((lst ...) (assoc-ref lst "homepage")))) (dependencies cpan-release-dependencies "dependency" (lambda (vector) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index fd44d80915..e8caf080fd 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> @@ -341,7 +341,11 @@ empty list when the FIELD cannot be found." ;; The field for system dependencies is often abused to specify non-package ;; dependencies (such as c++11). This list is used to ignore them. (define invalid-packages - (list "c++11")) + (list "c++11" + "c++14" + "linux" + "getopt::long" + "xquartz")) (define cran-guix-name (cut guix-name "r-" <>)) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 8922e57840..c0dc5acf51 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -1,8 +1,9 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> -;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com> ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> +;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,6 +30,8 @@ #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) #:use-module (guix http-client) @@ -392,7 +395,12 @@ type '<elpa-package>'." (define* (elpa->guix-package name #:key (repo 'gnu) version) "Fetch the package NAME from REPO and produce a Guix package S-expression." (match (fetch-elpa-package name repo) - (#f #f) + (#false + (raise (condition + (&message + (message (format #false + "couldn't find meta-data for ELPA package `~a'." + name)))))) (package ;; ELPA is known to contain only GPLv3+ code. Other repos may contain ;; code under other license but there's no license metadata. @@ -411,19 +419,24 @@ type '<elpa-package>'." (string-drop (package-name package) 6) (package-name package))) - (let* ((repo 'gnu) - (info (elpa-package-info name repo)) - (version (match info - ((name raw-version . _) - (elpa-version->string raw-version)))) - (url (match info - ((_ raw-version reqs synopsis kind . rest) - (package-source-url kind name version repo))))) - (upstream-source - (package (package-name package)) - (version version) - (urls (list url)) - (signature-urls (list (string-append url ".sig")))))) + (define repo 'gnu) + + (match (elpa-package-info name repo) + (#f + ;; No info, perhaps because PACKAGE is not truly an ELPA package. + #f) + (info + (let* ((version (match info + ((name raw-version . _) + (elpa-version->string raw-version)))) + (url (match info + ((_ raw-version reqs synopsis kind . rest) + (package-source-url kind name version repo))))) + (upstream-source + (package (package-name package)) + (version version) + (urls (list url)) + (signature-urls (list (string-append url ".sig")))))))) (define package-from-gnu.org? (url-predicate (lambda (url) diff --git a/guix/import/gem.scm b/guix/import/gem.scm index 1f6f94532e..418d716be6 100644 --- a/guix/import/gem.scm +++ b/guix/import/gem.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2015 David Thompson <davet@gnu.org> ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com> ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com> -;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; ;;; This file is part of GNU Guix. @@ -49,6 +49,7 @@ ;; This is sometimes #nil (the JSON 'null' value). Arrange ;; to always return a list. (cond ((not licenses) '()) + ((unspecified? licenses) '()) ((vector? licenses) (vector->list licenses)) (else '())))) (info gem-info) @@ -69,7 +70,7 @@ json->gem-dependency-list)) (define (json->gem-dependency-list vector) - (if vector + (if (and vector (not (unspecified? vector))) (map json->gem-dependency (vector->list vector)) '())) diff --git a/guix/import/gnu.scm b/guix/import/gnu.scm index 29324d7554..51d5b77d34 100644 --- a/guix/import/gnu.scm +++ b/guix/import/gnu.scm @@ -1,5 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com> +;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,8 +19,10 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (guix import gnu) + #:use-module ((guix diagnostics) #:select (formatted-message)) #:use-module (guix gnu-maintenance) #:use-module (guix import utils) + #:use-module (guix i18n) #:use-module (guix utils) #:use-module (guix store) #:use-module (gcrypt hash) @@ -108,20 +112,17 @@ download policy (see 'download-tarball' for details.)" "Return the package declaration for NAME as an s-expression. Use KEY-DOWNLOAD as the OpenPGP key download policy (see 'download-tarball' for details.)" - (match (latest-release name) - ((? upstream-source? release) - (let ((version (upstream-source-version release))) - (match (find-package name) - (#f - (raise (condition - (&message - (message "couldn't find meta-data for GNU package"))))) - (info - (gnu-package->sexp info release #:key-download key-download))))) - (_ - (raise (condition - (&message - (message - "failed to determine latest release of GNU package"))))))) + (let ((package (find-package name))) + (unless package + (raise (formatted-message (G_ "no GNU package found for ~a") name))) + + (match (latest-release name) + ((? upstream-source? release) + (let ((version (upstream-source-version release))) + (gnu-package->sexp package release #:key-download key-download))) + (_ + (raise (formatted-message + (G_ "failed to determine latest release of GNU ~a") + name)))))) ;;; gnu.scm ends here diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm index a84683ef6f..18d8b95ee0 100644 --- a/guix/import/texlive.scm +++ b/guix/import/texlive.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,8 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (web uri) + #:use-module (guix diagnostics) + #:use-module (guix i18n) #:use-module (guix http-client) #:use-module (gcrypt hash) #:use-module (guix memoization) @@ -149,19 +152,24 @@ expression describing it." (home-page (string-append "http://www.ctan.org/pkg/" id)) (ref (texlive-ref component id)) (checkout (download-svn-to-store store ref))) + (unless checkout + (warning (G_ "Could not determine source location. \ +Please manually specify the source field.~%"))) `(package (name ,(guix-name component id)) (version ,version) - (source (origin - (method svn-fetch) - (uri (texlive-ref ,component ,id)) - (sha256 - (base32 - ,(bytevector->nix-base32-string - (let-values (((port get-hash) (open-sha256-port))) - (write-file checkout port) - (force-output port) - (get-hash))))))) + (source ,(if checkout + `(origin + (method svn-fetch) + (uri (texlive-ref ,component ,id)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (let-values (((port get-hash) (open-sha256-port))) + (write-file checkout port) + (force-output port) + (get-hash)))))) + #f)) (build-system texlive-build-system) (arguments ,`(,'quote (#:tex-directory ,(string-join (list component id) "/")))) (home-page ,home-page) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index cdbcf6bfa5..2f5ccf7cea 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -453,10 +453,10 @@ obtain the Guix package name corresponding to the upstream name." (let* ((package dependencies (repo->guix-package name #:version version #:repo repo)) - (normalizied-deps (map (match-lambda + (normalized-deps (map (match-lambda ((name version) (list name version)) (name (list name #f))) dependencies))) - (make-node name version package normalizied-deps))) + (make-node name version package normalized-deps))) (map node-package (topological-sort (list (lookup-node package-name version)) |