unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable.
@ 2022-11-05 14:49 jgart via Guix-patches via
  2022-11-05 19:02 ` Guillaume Le Vaillant
  2022-12-14  5:06 ` [bug#59052] Add sbcl-triads:bin patch Charles via Guix-patches via
  0 siblings, 2 replies; 8+ messages in thread
From: jgart via Guix-patches via @ 2022-11-05 14:49 UTC (permalink / raw)
  To: 59052; +Cc: Guillaume Le Vaillant, Charles, jgart

* gnu/packages/lisp-xyz.scm (sbcl-triads): Install binary executable.
[arguments]: Install the triads binary executable in a phase.

Co-authored-by: Charles <charles.b.jackson@protonmail.com>

Hi Guillaume,

I forgot to add in this phase.

thanks in advance,

jgart
---
 gnu/packages/lisp-xyz.scm | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 98860f131c..34ad0af1fb 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -24527,20 +24527,36 @@ (define-public sbcl-triads
          (file-name (git-file-name "cl-triads" version))
          (sha256
           (base32 "146mwshynhdw82m2nxrcjvf1nk0z3fn6ywcd2vqxkly5qricc53w"))))
-      (build-system asdf-build-system/sbcl)
-      (arguments
-       '(#:asd-systems '("charje.triads")))
-      (inputs
-       (list sbcl-cl-str
-             sbcl-serapeum
-             sbcl-trivia))
-      (home-page "https://github.com/charJe/triads")
-      (synopsis "Music composition tool to convert roman numerals into triads")
-      (description "Triads is a simple command line tool that reads roman
+    (build-system asdf-build-system/sbcl)
+    (arguments
+      `(#:asd-systems '("charje.triads")
+        #:phases
+        (modify-phases %standard-phases
+          (replace 'build
+            (lambda* (#:key outputs #:allow-other-keys)
+              (setenv "HOME" (getcwd))
+              (system*
+               "sbcl" "--no-userinit"
+               "--eval" "(require :asdf)"
+               "--eval" (string-append
+                         "(require :charje.triads \""
+                         (getcwd) "/charje.triads.asd\")")
+               "--eval" "(asdf:make :charje.triads)")
+              (install-file (string-append (getcwd) "/triads")
+                            (string-append (assoc-ref outputs "out") "/bin"))))
+          (delete 'check)
+          (delete 'create-asdf-configuration))))
+    (inputs
+      (list sbcl-cl-str
+            sbcl-serapeum
+            sbcl-trivia))
+    (home-page "https://github.com/charJe/triads")
+    (synopsis "Music composition tool to convert roman numerals into triads")
+    (description "Triads is a simple command line tool that reads roman
 numeral notation from standard input (or a file) and an musical key and outputs
 the roman numeral in addition to the notes of the triad associated with that
 roman numeral given in the key.")
-      (license license:gpl3))))
+    (license license:gpl3))))
 
 (define-public cl-triads
   (sbcl-package->cl-source-package sbcl-triads))
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable.
  2022-11-05 14:49 [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable jgart via Guix-patches via
@ 2022-11-05 19:02 ` Guillaume Le Vaillant
  2022-11-05 19:15   ` Charles via Guix-patches via
  2022-12-14  5:06 ` [bug#59052] Add sbcl-triads:bin patch Charles via Guix-patches via
  1 sibling, 1 reply; 8+ messages in thread
From: Guillaume Le Vaillant @ 2022-11-05 19:02 UTC (permalink / raw)
  To: jgart; +Cc: Charles, 59052

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

Hi,

If triads is supposed to be used as a standalone program and not as
a library, it may be better to remove "cl-triads" and "ecl-triads", and
to rename "sbcl-triads" to "triads" and move it to "music.scm".

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable.
  2022-11-05 19:02 ` Guillaume Le Vaillant
@ 2022-11-05 19:15   ` Charles via Guix-patches via
  2022-11-05 19:17     ` ( via Guix-patches via
  0 siblings, 1 reply; 8+ messages in thread
From: Charles via Guix-patches via @ 2022-11-05 19:15 UTC (permalink / raw)
  To: glv, jgart; +Cc: 59052

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

It is meant to be a stand alone program, but it could also be used as a library if someone wants the same functionality as part of a larger program.

My personal thought is that there should be the 3 *cl-triads in lisp-xyz.scm and then a triads in music.scm that is installs a binary. I'm not sure what guix standard is about this.

-------- Original Message --------
On Nov 5, 2022, 2:02 PM, Guillaume Le Vaillant wrote:

> Hi, If triads is supposed to be used as a standalone program and not as a library, it may be better to remove "cl-triads" and "ecl-triads", and to rename "sbcl-triads" to "triads" and move it to "music.scm".

[-- Attachment #2: Type: text/html, Size: 765 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable.
  2022-11-05 19:15   ` Charles via Guix-patches via
@ 2022-11-05 19:17     ` ( via Guix-patches via
  2022-11-05 19:21       ` Charles via Guix-patches via
  0 siblings, 1 reply; 8+ messages in thread
From: ( via Guix-patches via @ 2022-11-05 19:17 UTC (permalink / raw)
  To: Charles, glv, jgart; +Cc: 59052

On Sat Nov 5, 2022 at 7:15 PM GMT, Charles via Guix-patches via wrote:
> My personal thought is that there should be the 3 *cl-triads in lisp-xyz.scm and then a triads in music.scm that is installs a binary. I'm not sure what guix standard is about this.

How about an output; ``cl-triads:bin''?

    -- (




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable.
  2022-11-05 19:17     ` ( via Guix-patches via
@ 2022-11-05 19:21       ` Charles via Guix-patches via
  2022-11-06 17:24         ` jgart via Guix-patches via
  0 siblings, 1 reply; 8+ messages in thread
From: Charles via Guix-patches via @ 2022-11-05 19:21 UTC (permalink / raw)
  To: paren, glv, jgart; +Cc: 59052

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

That could work too. sbcl-triads:bin makes more sense though because the tested binary is built with sbcl.
-------- Original Message --------
On Nov 5, 2022, 2:17 PM, ( wrote:

> On Sat Nov 5, 2022 at 7:15 PM GMT, Charles via Guix-patches via wrote: > My personal thought is that there should be the 3 *cl-triads in lisp-xyz.scm and then a triads in music.scm that is installs a binary. I'm not sure what guix standard is about this. How about an output; ``cl-triads:bin''? -- (

[-- Attachment #2: Type: text/html, Size: 561 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable.
  2022-11-05 19:21       ` Charles via Guix-patches via
@ 2022-11-06 17:24         ` jgart via Guix-patches via
  0 siblings, 0 replies; 8+ messages in thread
From: jgart via Guix-patches via @ 2022-11-06 17:24 UTC (permalink / raw)
  To: Charles; +Cc: glv, paren, 59052

On Sat, 05 Nov 2022 19:21:43 +0000 Charles <charles.b.jackson@protonmail.com> wrote:
> > On Sat Nov 5, 2022 at 7:15 PM GMT, Charles via Guix-patches via wrote: > My personal thought is that there should be the 3 *cl-triads in lisp-xyz.scm and then a triads in music.scm that is installs a binary. I'm not sure what guix standard is about this. How about an output; ``cl-triads:bin''? -- (

> I'm not sure what guix standard is about this.

Hi, how would we like to proceed?

I'm fine with either approach. Charles, would you like to send an update
patch for your approach? I might need about a weekish to get back to this.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#59052] Add sbcl-triads:bin patch
  2022-11-05 14:49 [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable jgart via Guix-patches via
  2022-11-05 19:02 ` Guillaume Le Vaillant
@ 2022-12-14  5:06 ` Charles via Guix-patches via
  2022-12-19 13:25   ` bug#59052: " Guillaume Le Vaillant
  1 sibling, 1 reply; 8+ messages in thread
From: Charles via Guix-patches via @ 2022-12-14  5:06 UTC (permalink / raw)
  To: 59052@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

It seems like a :bin suffix is the usuall way. This also opens up the possibility of ecl-triads:bin, and even ccl-triads:bin, clasp-triads:bin, abcl-triads:bin.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-sbcl-triads-Add-bin-output.patch --]
[-- Type: text/x-patch; name=0001-gnu-sbcl-triads-Add-bin-output.patch, Size: 2440 bytes --]

From 3ac729c376dd25d4f7295d237d0f25e3abd63a5f Mon Sep 17 00:00:00 2001
From: Charles <charles.b.jackson@protonmail.com>
Date: Tue, 13 Dec 2022 22:56:23 -0600
Subject: [PATCH] gnu: sbcl-triads: Add bin output.

* gnu/packages/lisp-xyz.scm (sbcl-triads): Add phase to build and install
binary executable (build-binary).

* gnu/packages/lisp-xyz.scm (ecl-triads): Remove the build-binary phase
because this program has not been tested on ECL upstream.
---
 gnu/packages/lisp-xyz.scm | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 364be8c7a5..fd1b9b82f4 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -26264,8 +26264,25 @@ (define-public sbcl-triads
          (sha256
           (base32 "146mwshynhdw82m2nxrcjvf1nk0z3fn6ywcd2vqxkly5qricc53w"))))
       (build-system asdf-build-system/sbcl)
+      (outputs '("out" "bin"))
       (arguments
-       '(#:asd-systems '("charje.triads")))
+       '(#:asd-systems '("charje.triads")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'create-asdf-configuration 'build-binary
+             (lambda* (#:key outputs #:allow-other-keys)
+               (setenv "HOME" (getcwd))
+               (system*
+                "sbcl" "--eval" "(require :asdf)" "--eval"
+                (format
+                 #f "~S"
+                 `(progn
+                   (require "charje.triads"
+                            ,(string-append (getcwd) "/charje.triads.asd"))
+                   (asdf:make "charje.triads"))))
+               (install-file
+                (string-append (getcwd) "/triads")
+                (string-append (assoc-ref outputs "bin") "/bin")))))))
       (inputs
        (list sbcl-cl-str
              sbcl-serapeum
@@ -26282,7 +26299,15 @@ (define-public cl-triads
   (sbcl-package->cl-source-package sbcl-triads))
 
 (define-public ecl-triads
-  (sbcl-package->ecl-package sbcl-triads))
+  (let ((ecl-package (sbcl-package->ecl-package sbcl-triads)))
+    (package
+      (inherit ecl-package)
+      (outputs '("out"))
+      (arguments
+       (substitute-keyword-arguments (package-arguments ecl-package)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (delete 'build-binary))))))))
 
 (define-public sbcl-closure-template
   ;; There are no releases since 2015.
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#59052: Add sbcl-triads:bin patch
  2022-12-14  5:06 ` [bug#59052] Add sbcl-triads:bin patch Charles via Guix-patches via
@ 2022-12-19 13:25   ` Guillaume Le Vaillant
  0 siblings, 0 replies; 8+ messages in thread
From: Guillaume Le Vaillant @ 2022-12-19 13:25 UTC (permalink / raw)
  To: Charles; +Cc: 59052-done

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]

Patch pushed as 89a8534b425817640c3e168399543b7f6e10b5a7.
Thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-19 13:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-05 14:49 [bug#59052] [PATCH] gnu: sbcl-triads: Install binary executable jgart via Guix-patches via
2022-11-05 19:02 ` Guillaume Le Vaillant
2022-11-05 19:15   ` Charles via Guix-patches via
2022-11-05 19:17     ` ( via Guix-patches via
2022-11-05 19:21       ` Charles via Guix-patches via
2022-11-06 17:24         ` jgart via Guix-patches via
2022-12-14  5:06 ` [bug#59052] Add sbcl-triads:bin patch Charles via Guix-patches via
2022-12-19 13:25   ` bug#59052: " Guillaume Le Vaillant

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).