GNU bug report logs - #42338
[PATCH] Add composer build system (PHP)

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Sun, 12 Jul 2020 22:22:02 UTC

Severity: normal

Tags: patch

Done: Steve George <steve <at> futurile.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 42338 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [bug#42338] [PATCH v3 6/7] guix: import: composer: More robust string->license.
Date: Tue, 26 Sep 2023 12:31:43 +0200
* guix/import/composer.scm (string->license): Use spdx-string->license. Fall
back to unknown-license!.
---
 guix/import/composer.scm | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/guix/import/composer.scm b/guix/import/composer.scm
index 3acbbecf82..2ce7206ef9 100644
--- a/guix/import/composer.scm
+++ b/guix/import/composer.scm
@@ -194,10 +194,8 @@ (define (make-php-sexp composer-package)
                (synopsis "")
                (description ,(composer-package-description composer-package))
                (home-page ,(composer-package-homepage composer-package))
-               (license ,(match (composer-package-license composer-package)
-                           (() #f)
-                           ((license) license)
-                           (_ license)))))))))
+               (license ,(or (composer-package-license composer-package)
+                             'unknown-license!))))))))
 
 (define composer->guix-package
   (memoize
@@ -234,14 +232,15 @@ (define (guix-package->composer-name package)
 
 (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" "BSD-3-Clause") '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)))
+  (or (spdx-string->license str)
+      (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)
+        (_ 'unknown-license!))))
 
 (define (php-package? package)
   "Return true if PACKAGE is a PHP package from Packagist."
-- 
2.41.0





This bug report was last modified 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.