[bug#77930] gnu: Add guile-slugify

Message ID 2ea04e5c42a51841cb41aefe4ce5de424d22479e.1745087957.git.ayushjha@protonmail.com
State New
Headers
Series [bug#77930] gnu: Add guile-slugify |

Commit Message

Ayush Jha April 19, 2025, 6:39 p.m. UTC
  Adds slugify library for guile versions 3.0 and 2.2

Change-Id: I549000465584a7fe721aea17db5eb340ba8490b6
Signed-off-by: Ayush Jha <ayushjha@protonmail.com>
---
 gnu/packages/guile-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)


base-commit: e417d6fe8182c0b42b113490fec6a0297fd68fed
  

Comments

Ludovic Courtès April 24, 2025, 8:45 a.m. UTC | #1
Hello,

Ayush Jha <ayushjha@protonmail.com> writes:

> Adds slugify library for guile versions 3.0 and 2.2
>
> Change-Id: I549000465584a7fe721aea17db5eb340ba8490b6
> Signed-off-by: Ayush Jha <ayushjha@protonmail.com>

Nice.  Bonus point if you write a commit log that follows our
conventions—you can use ‘./etc/committer.scm’ to do that, but otherwise
we can do it on your behalf.

> +(define-public guile-slugify
> +  (let ((commit "3fbf2684d02b1689ce61df2d6ad983d1b1bf452d")
> +        (revision "1"))

I suppose there’s no release tag?

> +                (snippet #~(for-each delete-file
> +                            '("guix.scm" "test.scm" "LICENSE" "README.md")))))

Why delete these files?  I would keep them unless there’s a good reason
to do this.

> +      (build-system guile-build-system)
> +      (native-inputs (list guile-3.0))
> +      (home-page "http://github.com/ayys/slugify.scm")
> +      (synopsis "A slugify library for Guile inspired by Django's slugify function")

Maybe “Produce URL-safe identifiers from arbitrary string”?  See
<https://guix.gnu.org/manual/devel/en/html_node/Synopses-and-Descriptions.html>.

> +      (description
> +     "A simple Guile Scheme implementation of `slugify`, inspired by Django’s slugify.
> +Converts human-readable text into clean, lowercase, URL-safe identifiers.")

Likewise, could you make it a full sentence?

> +(define-public guile2.2-slugify
> +  (package
> +    (inherit guile-slugify)
> +    (name "guile2.2-slugify")

Unless there’s a need for Guile 2.2 support, I would omit it.

Thanks,
Ludo’.
  

Patch

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 537e84d3f8..1de04b46d0 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -5545,6 +5545,40 @@  (define-public guile-webutils
 as signed sessions, multipart message support, etc.")
       (license license:gpl3+))))
 
+(define-public guile-slugify
+  (let ((commit "3fbf2684d02b1689ce61df2d6ad983d1b1bf452d")
+        (revision "1"))
+    (package
+      (name "guile-slugify")
+      (version (git-version "0.1" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/ayys/guile-slugify.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1xg6dhcnd6m5z9d7yzsa2vzdhzgifyk92gkfb6md8rbc8dilp2rh"))
+                (snippet #~(for-each delete-file
+                            '("guix.scm" "test.scm" "LICENSE" "README.md")))))
+      (build-system guile-build-system)
+      (native-inputs (list guile-3.0))
+      (home-page "http://github.com/ayys/slugify.scm")
+      (synopsis "A slugify library for Guile inspired by Django's slugify function")
+      (description
+     "A simple Guile Scheme implementation of `slugify`, inspired by Django’s slugify.
+Converts human-readable text into clean, lowercase, URL-safe identifiers.")
+      (license license:gpl3+))))
+
+(define-public guile2.2-slugify
+  (package
+    (inherit guile-slugify)
+    (name "guile2.2-slugify")
+    (native-inputs
+     (modify-inputs (package-native-inputs guile-slugify)
+       (replace "guile" guile-2.2)))))
+
 (define-public guile2.2-webutils
   (package
     (inherit guile-webutils)