summaryrefslogtreecommitdiff
path: root/guix/import/elpa.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2018-03-20 00:49:05 -0400
committerMark H Weaver <mhw@netris.org>2018-03-20 00:49:05 -0400
commit647888845c0d7b9ea1b51a3e3492d4d2382f4468 (patch)
treebe34c5ec88db452c63253dc4a15f9f4cf199b1e6 /guix/import/elpa.scm
parentfe15613cdf8623574ce64c05416dd3fab41eef86 (diff)
parentc657716ede8932da356635802534aa13205a6ecd (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/import/elpa.scm')
-rw-r--r--guix/import/elpa.scm25
1 files changed, 15 insertions, 10 deletions
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 45a419217c..43e9eb60c9 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
-;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -67,15 +67,15 @@ NAMES (strings)."
(string-append package-name-prefix (string-downcase name)))))
(define* (elpa-url #:optional (repo 'gnu))
- "Retrun the URL of REPO."
+ "Retrieve the URL of REPO."
(let ((elpa-archives
- '((gnu . "http://elpa.gnu.org/packages")
- (melpa-stable . "http://stable.melpa.org/packages")
- (melpa . "http://melpa.org/packages"))))
+ '((gnu . "https://elpa.gnu.org/packages")
+ (melpa-stable . "https://stable.melpa.org/packages")
+ (melpa . "https://melpa.org/packages"))))
(assq-ref elpa-archives repo)))
(define* (elpa-fetch-archive #:optional (repo 'gnu))
- "Retrive the archive with the list of packages available from REPO."
+ "Retrieve the archive with the list of packages available from REPO."
(let ((url (and=> (elpa-url repo)
(cut string-append <> "/archive-contents"))))
(if url
@@ -190,7 +190,7 @@ include VERSION."
url)))
(_ #f))))
-(define* (elpa-package->sexp pkg)
+(define* (elpa-package->sexp pkg #:optional license)
"Return the `package' S-expression for the Emacs package PKG, a record of
type '<elpa-package>'."
@@ -234,12 +234,17 @@ type '<elpa-package>'."
(home-page ,(elpa-package-home-page pkg))
(synopsis ,(elpa-package-synopsis pkg))
(description ,(elpa-package-description pkg))
- (license license:gpl3+))))
+ (license ,license))))
(define* (elpa->guix-package name #:optional (repo 'gnu))
"Fetch the package NAME from REPO and produce a Guix package S-expression."
- (let ((pkg (fetch-elpa-package name repo)))
- (and=> pkg elpa-package->sexp)))
+ (match (fetch-elpa-package name repo)
+ (#f #f)
+ (package
+ ;; ELPA is known to contain only GPLv3+ code. Other repos may contain
+ ;; code under other license but there's no license metadata.
+ (let ((license (and (eq? 'gnu repo) 'license:gpl3+)))
+ (elpa-package->sexp package license)))))
;;;