From 9bb1838c3f982dfb84ba24eb2f727cb39ee5805c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 18 Mar 2018 22:26:34 +0100 Subject: import: elpa: Return 'license:gpl3+ for ELPA only. Fixes . Reported by Konrad Hinsen . * guix/import/elpa.scm (elpa-package->sexp): Add LICENSE parameter and honor it. (elpa->guix-package): Pass 'license:gpl3+ only when REPO is 'gnu. --- guix/import/elpa.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'guix/import') diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 5d3d04ee7c..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 -;;; Copyright © 2015, 2016, 2017 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -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 ''." @@ -234,12 +234,17 @@ type ''." (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))))) ;;; -- cgit v1.2.3