From 39f4ef59ffc37259de40f67c476a1a720aa8d007 Mon Sep 17 00:00:00 2001 From: Xinglu Chen Date: Tue, 2 Nov 2021 17:48:09 +0100 Subject: build-system: haskell: Add ‘hackage-uri’ procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build-system/haskell (hackage-uri): New procedure. * guix/import/hackage.scm (hackage-module->sexp, latest-release): Use it. * tests/hackage.scm (match-ghc-foo, match-ghc-foo-6, match-ghc-foo-revision, match-ghc-foo-import): Adjust accordingly. Signed-off-by: Ludovic Courtès --- guix/import/hackage.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'guix/import') diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 03881f1a3d..0d5616ca62 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -40,6 +40,7 @@ (define-module (guix import hackage) #:use-module (guix memoization) #:use-module (guix upstream) #:use-module (guix packages) + #:autoload (guix build-system haskell) (hackage-uri) #:use-module ((guix utils) #:select (call-with-temporary-output-file)) #:export (%hackage-url hackage->guix-package @@ -303,7 +304,7 @@ (define (maybe-arguments) (version ,version) (source (origin (method url-fetch) - (uri (string-append ,@(factorize-uri source-url version))) + (uri (hackage-uri ,name version)) (sha256 (base32 ,(if tarball @@ -367,7 +368,7 @@ (define (latest-release package) (hackage-cabal-url hackage-name)) #f) ((_ *** ("version" (version))) - (let ((url (hackage-source-url hackage-name version))) + (let ((url (hackage-uri hackage-name version))) (upstream-source (package (package-name package)) (version version) -- cgit v1.2.3 From f63fb61d0caff7cb592cadfe36802940517c1ea8 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 1 Dec 2021 01:31:46 +0100 Subject: import: PyPI: Validate GPG signatures when applicable. * guix/import/pypi.scm (): Fix funny typo. (latest-release): When the distribution has a cryptographic signature, pass it along to UPSTREAM-SOURCE. --- guix/import/pypi.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'guix/import') diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 418a3556ec..bbbabe4c09 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2020 Arun Isaac ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -113,7 +114,7 @@ (define-json-mapping make-distribution distribution? (url distribution-url) ;string (digests distribution-digests) ;list of string pairs (file-name distribution-file-name "filename") ;string - (has-signature? distribution-has-signature? "hash_sig") ;Boolean + (has-signature? distribution-has-signature? "has_sig") ;Boolean (package-type distribution-package-type "packagetype") ;"bdist_wheel" | ... (python-version distribution-package-python-version "python_version")) @@ -540,10 +541,14 @@ (define (latest-release package) (guard (c ((missing-source-error? c) #f)) (let* ((info (pypi-project-info pypi-package)) (version (project-info-version info)) - (url (distribution-url - (source-release pypi-package)))) + (dist (source-release pypi-package)) + (url (distribution-url dist))) (upstream-source (urls (list url)) + (signature-urls + (if (distribution-has-signature? dist) + (list (string-append url ".asc")) + #f)) (input-changes (changed-inputs package (pypi->guix-package pypi-name))) -- cgit v1.2.3