Subject: [bug#72925] [PATCH v7] gnu: add jpm package

From: Omar Bassam <[email-masked]>
Date: Wed, 2 Oct 2024 18:44:13 +0300

* gnu/packages/lisp.scm (jpm): New Variable

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..f9ae0fe55a 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <[email-masked]>
 ;;; Copyright © 2024 bigbug <[email-masked]>
 ;;; Copyright © 2024 Ashish SHUKLA <[email-masked]>
+;;; Copyright © 2024 Omar Bassam <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,49 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/janet-lang/jpm.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-prefix-path
+                     (lambda _
+                       (substitute* "configs/linux_config.janet"
+                         (("/usr/local")
+                          #$output))
+                       (setenv "PREFIX"
+                               #$output)))
+                   (replace 'install
+                     (lambda _
+                       (for-each (lambda (dir)
+                                   (mkdir-p (string-append #$output "/" dir)))
+                                 '("lib/janet/jpm" "share/man/man1"))
+                       (invoke "janet" "bootstrap.janet"
+                               "configs/linux_config.janet")
+                       (wrap-program (string-append #$output "/bin/jpm")
+                         `("JANET_HEADERPATH" ":" =
+                           (,(string-append #$janet "/include/janet")))
+                         `("JANET_LIBPATH" ":" =
+                           (,(string-append #$janet "/lib")))))))))
+    (inputs (list janet))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool.  It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: 3d0668fe6667dabe71ee2840e75877f18399c1d9
-- 
2.45.2