GNU bug report logs - #75394
[PATCH v14 0/2] Add jpm.

Previous Next

Package: guix-patches;

Reported by: "Suhail Singh" <suhailsingh247 <at> gmail.com>

Date: Mon, 6 Jan 2025 01:28:02 UTC

Severity: normal

Tags: patch

Done: jgart <jgart <at> dismail.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75394 in the body.
You can then email your comments to 75394 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to glv <at> posteo.net, cox.katherine.e+guix <at> gmail.com, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Mon, 06 Jan 2025 01:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Suhail Singh" <suhailsingh247 <at> gmail.com>:
New bug report received and forwarded. Copy sent to glv <at> posteo.net, cox.katherine.e+guix <at> gmail.com, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org. (Mon, 06 Jan 2025 01:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Suhail Singh" <suhailsingh247 <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH v14 0/2] Add jpm.
Date: Sun, 5 Jan 2025 20:22:04 -0500
Hello Guix,

This is same as v14 in #72925.  Starting a new issue in the hope of
working around mumi issue [1].

Copying below cover-letter content from v14 in #72925 for convenience:

> v14 is the same as v13, but has been rebased onto master.
>
> Given a profile containing only jpm, bash, coreutils-minimal and
> nss-certs and loading it using something like the below:
>
> #+begin_src sh
>   guix shell --pure -CPWN \
>     -E '.*GTK.*|.*XDG.*|.*DISPLAY.*|TERM|INSIDE_EMACS' \
>     -p /path/to/profile
> #+end_src
>
>
> I have tested using the below commands:
>
> #+begin_src sh
>   cd /tmp
>   mkdir -p review-72925 && cd review-72925
>   jpm install -l sh
>   jpm install -l spork
> #+end_src
>
>
> For "sh", the below successfully works in janet repl which is loaded via
> "jpm -l repl":
>
> #+begin_src janet
>   (import sh)
>   (sh/$ touch foo.txt)
> #+end_src
>
>
> For spork, I the following example has been tested as working in a janet
> repl invoked via "jpm -l repl":
>
> #+begin_src janet
>   (import spork/tasker)
>
>   (def t (tasker/new-tasker))
>
>   (ev/spawn
>     (tasker/run-executors t))
>
>   (tasker/queue-task t ["echo" "hello," "world"])
>   (tasker/queue-task t ["echo" "hello," "world"])
>   (tasker/queue-task t ["echo" "hello," "world"])
>   (tasker/queue-task t ["sleep" "5"])
> #+end_src


[1]: <https://yhetil.org/guix-patches/11be729cce0b193ddb3882df02260bbf7389e9d0 <at> dismail.de/>

Omar Bassam (1):
  gnu: Add jpm package.

Suhail (1):
  gnu: Improve user-experience for jpm.

 gnu/packages/lisp.scm | 91 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)


base-commit: ddbb59f9bc5eb6dfaf1fc24881bb62f11960d664




Information forwarded to glv <at> posteo.net, cox.katherine.e+guix <at> gmail.com, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Mon, 06 Jan 2025 01:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 75394 <at> debbugs.gnu.org (full text, mbox):

From: "Suhail Singh" <suhailsingh247 <at> gmail.com>
To: 75394 <at> debbugs.gnu.org
Subject: [PATCH v14 1/2] gnu: Add jpm package.
Date: Mon, 7 Oct 2024 23:31:57 -0400
* gnu/packages/lisp.scm (jpm): New variable.

Change-Id: I9f5ab89a38622689b5d3545abe5d87906dc61f3b
Signed-off-by: Suhail <suhail <at> bayesians.ca>
---
 gnu/packages/lisp.scm | 73 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 9cc630eec2..f99ad68828 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug <at> proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is <at> lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88 <at> gmail.com>
 ;;; Copyright © 2024 David Pflug <david <at> pflug.io>
 ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;;
@@ -64,6 +65,7 @@ (define-module (gnu packages lisp)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
   #:use-module (guix build-system trivial)
+  #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
   #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
@@ -919,6 +921,77 @@ (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")
+             (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-paths
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "configs/linux_config.janet"
+                         (("/usr/local")
+                          #$output)
+                         (("\"cc\"")
+                          (string-append "\""
+                                         (search-input-file inputs "/bin/gcc")
+                                         "\""))
+                         (("\"c\\+\\+\"")
+                          (string-append "\""
+                                         (search-input-file inputs "/bin/g++")
+                                         "\""))
+                         (("\"git\"")
+                          (string-append "\""
+                                         (search-input-file inputs "/bin/git")
+                                         "\""))
+                         (("\"curl\"")
+                          (string-append "\""
+                                         (search-input-file inputs "/bin/curl")
+                                         "\"")))
+                       (substitute* "jpm/shutil.janet"
+                         (("cp")
+                          (string-append (search-input-file inputs "/bin/cp"))))
+                       (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 bash-minimal
+                  coreutils-minimal
+                  curl
+                  gcc
+                  git-minimal/pinned))
+    (propagated-inputs (list janet))
+    (native-search-paths
+     (list $SSL_CERT_DIR $SSL_CERT_FILE))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description
+     "@code{jpm} is the Janet Project Manager tool.  It is a build
+tool and its main uses are installing dependencies, compiling C/C++ to native
+libraries, and other management tasks for Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")




Information forwarded to glv <at> posteo.net, cox.katherine.e+guix <at> gmail.com, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Mon, 06 Jan 2025 01:31:02 GMT) Full text and rfc822 format available.

Message #11 received at 75394 <at> debbugs.gnu.org (full text, mbox):

From: "Suhail Singh" <suhailsingh247 <at> gmail.com>
To: 75394 <at> debbugs.gnu.org
Subject: [PATCH v14 2/2] gnu: Improve user-experience for jpm.
Date: Mon, 7 Oct 2024 23:22:13 -0400
* gnu/packages/lisp.scm (jpm): Ensure jpm respects JANET_HEADERPATH and
JANET_LIBPATH if set by user.  Ensure gcc/g++ is able to find header files and
compilation-related utilities.

Change-Id: Ic7218dbd10e6fabddded50894b82492de8cabc88
---
 gnu/packages/lisp.scm | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index f99ad68828..eb3063d3d9 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -30,6 +30,7 @@
 ;;; Copyright © 2024 bigbug <bigbookofbug <at> proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is <at> lostca.se>
 ;;; Copyright © 2024 Omar Bassam <omar.bassam88 <at> gmail.com>
+;;; Copyright © 2024 Suhail Singh <suhail <at> bayesians.ca>
 ;;; Copyright © 2024 David Pflug <david <at> pflug.io>
 ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;;
@@ -965,22 +966,39 @@ (define-public jpm
                        (setenv "PREFIX"
                                #$output)))
                    (replace 'install
-                     (lambda _
+                     (lambda* (#:key inputs #:allow-other-keys)
                        (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")))))))))
+                       (let ((gcc-toolchain (assoc-ref inputs "gcc-toolchain"))
+                             (core-min (assoc-ref inputs "coreutils-minimal")))
+                         (wrap-program (string-append #$output "/bin/jpm")
+                           `("JANET_HEADERPATH" ":" prefix
+                             (,(string-append #$janet "/include/janet")))
+                           `("JANET_LIBPATH" ":" prefix
+                             (,(string-append #$janet "/lib")))
+                           `("C_INCLUDE_PATH" ":" prefix
+                             (,(string-append gcc-toolchain "/include")))
+                           `("CPLUS_INCLUDE_PATH" ":" prefix
+                             (,(string-append gcc-toolchain "/include/c++")
+                              ,(string-append gcc-toolchain "/include")))
+                           `("LIBRARY_PATH" ":" prefix
+                             (,(string-append gcc-toolchain "/lib")
+                              ,(string-append gcc-toolchain "/lib64")))
+                           `("PATH" ":" prefix
+                             (,(string-append gcc-toolchain "/bin")
+                              ,(string-append core-min "/bin"))))))))))
     (inputs (list bash-minimal
                   coreutils-minimal
                   curl
                   gcc
-                  git-minimal/pinned))
+                  git-minimal/pinned
+                  ;; Lazily resolve the gcc-toolchain to avoid a circular
+                  ;; dependency.
+                  (module-ref (resolve-interface '(gnu packages commencement))
+                              'gcc-toolchain)))
     (propagated-inputs (list janet))
     (native-search-paths
      (list $SSL_CERT_DIR $SSL_CERT_FILE))




Reply sent to jgart <jgart <at> dismail.de>:
You have taken responsibility. (Mon, 06 Jan 2025 02:15:03 GMT) Full text and rfc822 format available.

Notification sent to "Suhail Singh" <suhailsingh247 <at> gmail.com>:
bug acknowledged by developer. (Mon, 06 Jan 2025 02:15:03 GMT) Full text and rfc822 format available.

Message #16 received at 75394-done <at> debbugs.gnu.org (full text, mbox):

From: jgart <jgart <at> dismail.de>
To: 75394-done <at> debbugs.gnu.org
Cc: Suhail Singh <suhailsingh247 <at> gmail.com>
Subject: Re: [PATCH v14 0/2] Add jpm.
Date: Sun, 05 Jan 2025 20:14:02 -0600
Thanks! applied.

Should we add janet specific documentation in a follow up ticket somewhere?

-- 
all the best,
jgart




Information forwarded to guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Tue, 07 Jan 2025 01:57:02 GMT) Full text and rfc822 format available.

Message #19 received at 75394-done <at> debbugs.gnu.org (full text, mbox):

From: Suhail Singh <suhailsingh247 <at> gmail.com>
To: jgart <jgart <at> dismail.de>
Cc: 75394-done <at> debbugs.gnu.org, Suhail Singh <suhailsingh247 <at> gmail.com>
Subject: Re: [PATCH v14 0/2] Add jpm.
Date: Mon, 06 Jan 2025 20:56:28 -0500
jgart <jgart <at> dismail.de> writes:

> Should we add janet specific documentation

As in the "docs" target in the janet Makefile?

-- 
Suhail




Information forwarded to guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Tue, 07 Jan 2025 02:53:01 GMT) Full text and rfc822 format available.

Message #22 received at 75394-done <at> debbugs.gnu.org (full text, mbox):

From: "jgart" <jgart <at> dismail.de>
To: "Suhail Singh" <suhailsingh247 <at> gmail.com>
Cc: 75394-done <at> debbugs.gnu.org, Suhail Singh <suhailsingh247 <at> gmail.com>
Subject: Re: [PATCH v14 0/2] Add jpm.
Date: Tue, 07 Jan 2025 02:51:45 +0000
[Message part 1 (text/plain, inline)]
> 
> As in the "docs" target in the janet Makefile?
> 
I mean in the info manual for GNU Guix.

Do you intend to contribute a janet-build-system after this? In that case, then you can document any special instructions for using Guix with janet.

all best,

jgart
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Tue, 07 Jan 2025 03:10:02 GMT) Full text and rfc822 format available.

Message #25 received at 75394-done <at> debbugs.gnu.org (full text, mbox):

From: Suhail Singh <suhailsingh247 <at> gmail.com>
To: "jgart" <jgart <at> dismail.de>
Cc: Omar Bassam <omar.bassam88 <at> gmail.com>,
 Suhail Singh <suhailsingh247 <at> gmail.com>, 75394-done <at> debbugs.gnu.org
Subject: Re: [PATCH v14 0/2] Add jpm.
Date: Mon, 06 Jan 2025 22:09:30 -0500
"jgart" <jgart <at> dismail.de> writes:

> Do you intend to contribute a janet-build-system after this?

Not being a janet user, likely not any time soon.  I wasn't even
intending to contribute jpm, I was simply helping review Omar's
submission.  Omar had, at one point however, mentioned a
janet-build-system [1].

> In that case, then you can document any special instructions for using
> Guix with janet.

I do agree that that would be helpful.

[1]: <https://issues.guix.gnu.org/72925#12>

-- 
Suhail




Information forwarded to guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Tue, 07 Jan 2025 07:16:02 GMT) Full text and rfc822 format available.

Message #28 received at 75394-done <at> debbugs.gnu.org (full text, mbox):

From: Omar Bassam <omar.bassam88 <at> gmail.com>
To: Suhail Singh <suhailsingh247 <at> gmail.com>
Cc: jgart <jgart <at> dismail.de>, 75394-done <at> debbugs.gnu.org
Subject: Re: [PATCH v14 0/2] Add jpm.
Date: Tue, 07 Jan 2025 09:15:41 +0200
Suhail Singh <suhailsingh247 <at> gmail.com> writes:

> "jgart" <jgart <at> dismail.de> writes:
>
>> Do you intend to contribute a janet-build-system after this?
>
> Not being a janet user, likely not any time soon.  I wasn't even
> intending to contribute jpm, I was simply helping review Omar's
> submission.  Omar had, at one point however, mentioned a
> janet-build-system [1].
>

Yes, Thanks Suhail, your reviews helped me alot. This was my first
contribution to guix and I learned alot from it.

I would like to contribute more to guix and would like to take building
a janet-build-system as a start. I would appreciate any guidance or
recommendations on where to start to learn about building a custom build
system.

>> In that case, then you can document any special instructions for using
>> Guix with janet.
>
> I do agree that that would be helpful.
>

I am not sure where should such document be added?

> [1]: <https://issues.guix.gnu.org/72925#12>

Many Thanks to all,
Omar Bassam




Information forwarded to guix-patches <at> gnu.org:
bug#75394; Package guix-patches. (Wed, 08 Jan 2025 15:31:02 GMT) Full text and rfc822 format available.

Message #31 received at 75394-done <at> debbugs.gnu.org (full text, mbox):

From: Suhail Singh <suhailsingh247 <at> gmail.com>
To: Omar Bassam <omar.bassam88 <at> gmail.com>
Cc: jgart <jgart <at> dismail.de>, Suhail Singh <suhailsingh247 <at> gmail.com>,
 75394-done <at> debbugs.gnu.org
Subject: Re: [bug#75394] [PATCH v14 0/2] Add jpm.
Date: Wed, 08 Jan 2025 10:30:42 -0500
Omar Bassam <omar.bassam88 <at> gmail.com> writes:

> Yes, Thanks Suhail, your reviews helped me alot.

You're welcome :)

> I would like to contribute more to guix and would like to take building
> a janet-build-system as a start. I would appreciate any guidance or
> recommendations on where to start to learn about building a custom build
> system.

I don't have any specific guidance other than to look at existing build
system definitions.  Perhaps jgart has some thoughts?

>>> In that case, then you can document any special instructions for using
>>> Guix with janet.
>>
>> I do agree that that would be helpful.
>>
>
> I am not sure where should such document be added?

I am no authority, but perhaps the Cookbook?  Jgart, thoughts?

-- 
Suhail




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Feb 2025 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 135 days ago.

Previous Next


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