summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2017-11-01 10:29:59 +0200
committerEfraim Flashner <efraim@flashner.co.il>2017-11-01 10:29:59 +0200
commit19b7bba1b5f115168b1669325cd51bc66b9dc4b4 (patch)
tree7b4e77080fe6fbc3a54b8612adc3c5c27ab81d05 /guix/import
parentf37931d6632627a24e4eccafa1603ffadb649ff6 (diff)
parent5010d0e36452882eb95666467bb983efa8cca081 (diff)
downloadguix-patches-19b7bba1b5f115168b1669325cd51bc66b9dc4b4.tar
guix-patches-19b7bba1b5f115168b1669325cd51bc66b9dc4b4.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/cpan.scm7
-rw-r--r--guix/import/elpa.scm7
-rw-r--r--guix/import/github.scm11
3 files changed, 19 insertions, 6 deletions
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 6261e3e924..2ef02c43a4 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
+;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -115,7 +116,7 @@ or #f on failure. MODULE should be e.g. \"Test::Script\""
(json-fetch (string-append "https://fastapi.metacpan.org/v1/release/" name)))
(define (cpan-home name)
- (string-append "http://search.cpan.org/dist/" name))
+ (string-append "http://search.cpan.org/dist/" name "/"))
(define (cpan-source-url meta)
"Return the download URL for a module's source tarball."
@@ -242,9 +243,9 @@ META."
;; have not yet had a need for cross-compiled perl
;; modules, however, so we leave it out.
(convert-inputs '("configure" "build" "test")))
- ,@(maybe-inputs 'inputs
+ ,@(maybe-inputs 'propagated-inputs
(convert-inputs '("runtime")))
- (home-page ,(string-append "http://search.cpan.org/dist/" name))
+ (home-page ,(cpan-home name))
(synopsis ,(assoc-ref meta "abstract"))
(description fill-in-yourself!)
(license ,(string->license (assoc-ref meta "license"))))))
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 858eea88e2..45a419217c 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -80,8 +80,11 @@ NAMES (strings)."
(cut string-append <> "/archive-contents"))))
(if url
;; Use a relatively small TTL for the archive itself.
- (parameterize ((%http-cache-ttl (* 6 3600)))
- (call-with-downloaded-file url read))
+ (let* ((port (http-fetch/cached (string->uri url)
+ #:ttl (* 6 3600)))
+ (data (read port)))
+ (close-port port)
+ data)
(leave (G_ "~A: currently not supported~%") repo))))
(define* (call-with-downloaded-file url proc #:optional (error-thunk #f))
diff --git a/guix/import/github.scm b/guix/import/github.scm
index b249b39067..4b7d53c704 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
+;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -19,6 +20,7 @@
(define-module (guix import github)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
#:use-module (json)
#:use-module (guix utils)
@@ -182,7 +184,14 @@ https://github.com/settings/tokens"))
(define (latest-release pkg)
"Return an <upstream-source> for the latest release of PKG."
- (let* ((source-uri (origin-uri (package-source pkg)))
+ (define (origin-github-uri origin)
+ (match (origin-uri origin)
+ ((? string? url)
+ url) ;surely a github.com URL
+ ((urls ...)
+ (find (cut string-contains <> "github.com") urls))))
+
+ (let* ((source-uri (origin-github-uri (package-source pkg)))
(name (package-name pkg))
(newest-version (latest-released-version source-uri name)))
(if newest-version