Subject: [PATCH 2/2] import: cpan: Add 'define-public' to package definition.

From: Wilko Meyer <[email-masked]>
Date: Wed, 20 Dec 2023 00:45:24 +0100

* guix/import/cpan.scm (string->license): Add 'define-public' to package definition.

Change-Id: I9a0bcb53b40ab8f68579e99c0b8a86bbe9905db2
---
 guix/import/cpan.scm | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 7dd89c02dc7..d5ac8e0cb90 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -288,26 +288,27 @@ (define (cpan-module->sexp release)
   (let ((tarball (with-store store
                    (download-to-store store source-url)))
         (inputs (cpan-module-inputs release)))
-    `(package
-       (name ,(cpan-name->downstream-name name))
-       (version ,version)
-       (source (origin
-                 (method url-fetch)
-                 (uri (string-append ,@(factorize-uri source-url version)))
-                 (sha256
-                  (base32
-                   ,(bytevector->nix-base32-string (file-sha256 tarball))))))
-       (build-system perl-build-system)
-       ,@(maybe-inputs 'native-inputs
-                       (filter (upstream-input-type-predicate 'native)
-                               inputs))
-       ,@(maybe-inputs 'propagated-inputs
-                       (filter (upstream-input-type-predicate 'propagated)
-                               inputs))
-       (home-page ,(cpan-home name))
-       (synopsis ,(cpan-release-abstract release))
-       (description fill-in-yourself!)
-       (license ,(string->license (cpan-release-license release))))))
+    `(define-public ,(string->symbol (cpan-name->downstream-name name))
+       (package
+        (name ,(cpan-name->downstream-name name))
+        (version ,version)
+        (source (origin
+                    (method url-fetch)
+                    (uri (string-append ,@(factorize-uri source-url version)))
+                    (sha256
+                    (base32
+                    ,(bytevector->nix-base32-string (file-sha256 tarball))))))
+        (build-system perl-build-system)
+        ,@(maybe-inputs 'native-inputs
+                        (filter (upstream-input-type-predicate 'native)
+                                inputs))
+        ,@(maybe-inputs 'propagated-inputs
+                        (filter (upstream-input-type-predicate 'propagated)
+                                inputs))
+        (home-page ,(cpan-home name))
+        (synopsis ,(cpan-release-abstract release))
+        (description fill-in-yourself!)
+        (license ,(string->license (cpan-release-license release)))))))
 
 (define (cpan->guix-package module-name)
   "Fetch the metadata for PACKAGE-NAME from metacpan.org, and return the
-- 
2.41.0