summaryrefslogtreecommitdiff
path: root/guix/import/pypi.scm
diff options
context:
space:
mode:
authorDavid Craven <david@craven.ch>2016-09-22 11:30:17 +0200
committerDavid Craven <david@craven.ch>2016-09-28 12:47:29 +0200
commit263ac57fc22680395453bed34eaae8e63ea85bbb (patch)
treea53efd9e83f59ee8d17b438cd6a50f0c20343a17 /guix/import/pypi.scm
parentfbe9c1012820ab72f022a6ec958c35b431ae7a74 (diff)
import: Move string->license to importers.
* guix/import/gem.scm (string->license): Move from (guix import utils). * guix/import/pypi.scm (string->license): Move from (guix import utils).
Diffstat (limited to 'guix/import/pypi.scm')
-rw-r--r--guix/import/pypi.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 343445aa22..8aeffb2326 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -41,7 +41,7 @@
#:use-module (guix import json)
#:use-module (guix packages)
#:use-module (guix upstream)
- #:use-module (guix licenses)
+ #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system python)
#:use-module (gnu packages python)
#:export (guix-package->pypi-name
@@ -294,6 +294,17 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(make-pypi-sexp name version release wheel home-page synopsis
description license))))))
+(define (string->license str)
+ "Convert the string STR into a license object."
+ (match str
+ ("GNU LGPL" license:lgpl2.0)
+ ("GPL" license:gpl3)
+ ((or "BSD" "BSD License") license:bsd-3)
+ ((or "MIT" "MIT license" "Expat license") license:expat)
+ ("Public domain" license:public-domain)
+ ((or "Apache License, Version 2.0" "Apache 2.0") license:asl2.0)
+ (_ #f)))
+
(define (pypi-package? package)
"Return true if PACKAGE is a Python package from PyPI."