unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / Atom feed
* [bug#51903] [PATCH] gnu: Add cl-cmn.
@ 2021-11-17  1:52 jgart via Guix-patches via
  2021-11-17  7:49 ` Pierre Neidhardt
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: jgart via Guix-patches via @ 2021-11-17  1:52 UTC (permalink / raw)
  To: 51903; +Cc: Pierre Neidhardt, jgart

Hi Guixers,

This is a WIP.

I could use some help with it.

There are no releases and no version control.

CMN was written in the 90s and is still used today atleast by slippery-chicken (see below).

It currently builds successfully.

https://en.wikipedia.org/wiki/Common_Music_Notation  
https://ccrma.stanford.edu/software/cmn/cmn/cmn.html  

cmn is a dependency of slippery-chicken: 

https://github.com/mdedwards/slippery-chicken
http://michael-edwards.org/sc/

* gnu/packages/music.scm (cl-cmn): New variable.
---
 gnu/packages/music.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 60cff2cc28..ee130d7b54 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -66,6 +66,7 @@ (define-module (gnu packages music)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system asdf)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system cmake)
@@ -6911,6 +6912,26 @@ (define-public shiru-lv2
       (home-page "http://shiru.untergrund.net/software.shtml")
       (license license:wtfpl2))))
 
+(define-public cl-cmn
+  (package
+    (name "cl-cmn")
+    (version "0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://ccrma.stanford.edu/software/cmn/cmn"
+                           ".tar.gz"))
+       (sha256
+        (base32
+         "1f4ivhg1vq2fwklmwjj30bj7ij1yab45rnjjwps3qpsh0lpd6yj3"))))
+    (build-system asdf-build-system/source)
+    (home-page "https://ccrma.stanford.edu/software/cmn/")
+    (synopsis "Western music notation package written in Common Lisp")
+    (description
+"CMN provides a package of functions to hierarchically describe a musical
+score. When evaluated, the musical score is rendered to an image.")
+    (license license:expat)))
+
 (define-public a2jmidid
   (package
     (name "a2jmidid")
-- 
2.33.1





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

* [bug#51903] [PATCH] gnu: Add cl-cmn.
  2021-11-17  1:52 [bug#51903] [PATCH] gnu: Add cl-cmn jgart via Guix-patches via
@ 2021-11-17  7:49 ` Pierre Neidhardt
  2021-11-17  8:50   ` jgart via Guix-patches via
  2021-11-17  8:55 ` [bug#51903] [PATCH v2] " jgart via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: Pierre Neidhardt @ 2021-11-17  7:49 UTC (permalink / raw)
  To: jgart, 51903; +Cc: jgart

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

Hi,

1. I believe you should place the lib in lisp-xyz.scm.

2. License is llgpl.

3. Then use the asdf-build-system/sbcl.
See the other sbcl- packages for reference.

Then define the cl- package with

--8<---------------cut here---------------start------------->8---
(define-public cl-cmn
  (sbcl-package->cl-source-package sbcl-cmn))
--8<---------------cut here---------------end--------------->8---

4. Since there are no version numbers, maybe use the date of the last
HISTORY.cmn entry, that is, 2016.8.17.

Hope that helps!

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

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

* [bug#51903] [PATCH] gnu: Add cl-cmn.
  2021-11-17  7:49 ` Pierre Neidhardt
@ 2021-11-17  8:50   ` jgart via Guix-patches via
  2021-11-17  9:24     ` Pierre Neidhardt
  0 siblings, 1 reply; 18+ messages in thread
From: jgart via Guix-patches via @ 2021-11-17  8:50 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 51903

On Wed, 17 Nov 2021 08:49:48 +0100 Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> Hi,
> 
> 1. I believe you should place the lib in lisp-xyz.scm.
> 
> 2. License is llgpl.
> 
> 3. Then use the asdf-build-system/sbcl.
> See the other sbcl- packages for reference.
> 
> Then define the cl- package with
> 
> --8<---------------cut here---------------start------------->8---
> (define-public cl-cmn
>   (sbcl-package->cl-source-package sbcl-cmn))
> --8<---------------cut here---------------end--------------->8---
> 
> 4. Since there are no version numbers, maybe use the date of the last
> HISTORY.cmn entry, that is, 2016.8.17.
> 
> Hope that helps!

Hi Pierre,

Thanks for the suggestions. Much appreciated!

This is the error I currently get:

;   READ error during COMPILE-FILE:
;
;     Package CMN does not exist.
;
;       Line: 174, Column: 33, File-Position: 6136
;
;       Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /gnu/store/wdsfha38v8mg638y6ilxar1qjkg57fbg-sbcl-cmn-2016.8.17/share/common-lisp/sbcl/cmn/cmn-all.lisp" {10057D4A03}>

; compilation aborted after 0:00:00.004
Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                          {1001858103}>:
  COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "cmn" "cmn-all">

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1001858103}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {100586FF53}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {100586FF53}>)
2: (INVOKE-DEBUGGER #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {100586FF53}>)
3: (ERROR UIOP/LISP-BUILD:COMPILE-FILE-ERROR :CONTEXT-FORMAT "~/asdf-action::format-action/" :CONTEXT-ARGUMENTS ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cmn" "cmn-all">)))
4: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cmn" "cmn-all">)))
5: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cmn" "cmn-all">)
6: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
7: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cmn" "cmn-all">) [fast-method]
8: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1005608293}>) [fast-method]
9: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
10: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1005608293}>) [fast-method]
11: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/SYSTEM:SYSTEM "cmn"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
12: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/SYSTEM:SYSTEM "cmn">)
13: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
14: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/SYSTEM:SYSTEM "cmn">) [fast-method]
15: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:COMPILE-OP "cmn")
16: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
17: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:COMPILE-OP "cmn") [fast-method]
18: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10055FFBCB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
19: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
20: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10055E0D2B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
21: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:COMPILE-OP "cmn") [fast-method]
22: (ASDF/OPERATE:COMPILE-SYSTEM "cmn")
23: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:COMPILE-SYSTEM "cmn") #<NULL-LEXENV>)
24: (EVAL (ASDF/OPERATE:COMPILE-SYSTEM "cmn"))
25: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(require :asdf)") (:EVAL . "(asdf:load-asd (truename \"/gnu/store/wdsfha38v8mg638y6ilxar1qjkg57fbg-sbcl-cmn-2016.8.17/share/common-lisp/sbcl/cmn/cmn.asd\"))") (:EVAL . "(asdf:compile-system \"cmn\")") (:QUIT)))
26: (SB-IMPL::TOPLEVEL-INIT)
27: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
28: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-IMPL::START-LISP))
29: (SB-IMPL::START-LISP)

unhandled condition in --disable-debugger mode, quitting
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
;   caught 1 ERROR condition
command "/gnu/store/42vycgb0gcyhhqsncyc5ybp83xwgp2dk-sbcl-2.1.9/bin/sbcl" "--non-interactive" "--eval" "(require :asdf)" "--eval" "(asdf:load-asd (truename \"/gnu/store/wdsfha38v8mg638y6ilxar1qjkg57fbg-sbcl-cmn-2016.8.17/share/common-lisp/sbcl/cmn/cmn.asd\"))" "--eval" "(asdf:compile-system \"cmn\")" failed with status 1
builder for `/gnu/store/0bz3b26x201mx7x1c6xmhyc98p04rhrs-sbcl-cmn-2016.8.17.drv' failed with exit code 1
build of /gnu/store/0bz3b26x201mx7x1c6xmhyc98p04rhrs-sbcl-cmn-2016.8.17.drv failed
Could not find build log for '/gnu/store/0bz3b26x201mx7x1c6xmhyc98p04rhrs-sbcl-cmn-2016.8.17.drv'.
guix build: error: build of `/gnu/store/0bz3b26x201mx7x1c6xmhyc98p04rhrs-sbcl-cmn-2016.8.17.drv' failed

Here's the package definition updated with the changes you requested:

```
(define-public sbcl-cmn
  (package
    (name "sbcl-cmn")
    (version "2016.8.17")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://ccrma.stanford.edu/software/cmn/cmn"
                           ".tar.gz"))
       (sha256
        (base32
         "1f4ivhg1vq2fwklmwjj30bj7ij1yab45rnjjwps3qpsh0lpd6yj3"))
       (file-name (string-append name "-" version))))
    (build-system asdf-build-system/sbcl)
    (arguments
     `(#:asd-systems '("cmn")
       #:asd-files '("cmn.asd")))
    (home-page "https://ccrma.stanford.edu/software/cmn/")
    (synopsis "Western music notation package written in Common Lisp")
    (description
"CMN provides a package of functions to hierarchically describe a musical
score. When evaluated, the musical score is rendered to an image.")
    (license license:llgpl)))

(define-public cl-cmn
  (sbcl-package->cl-source-package sbcl-cmn))
```

Anything that might be wrong in the above?




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

* [bug#51903] [PATCH v2] gnu: Add cl-cmn.
  2021-11-17  1:52 [bug#51903] [PATCH] gnu: Add cl-cmn jgart via Guix-patches via
  2021-11-17  7:49 ` Pierre Neidhardt
@ 2021-11-17  8:55 ` jgart via Guix-patches via
  2021-11-17 10:39 ` [bug#51903] cmn license etc bil
  2021-11-22 18:35 ` [bug#51903] [PATCH v3] gnu: Add cl-cmn jgart via Guix-patches via
  3 siblings, 0 replies; 18+ messages in thread
From: jgart via Guix-patches via @ 2021-11-17  8:55 UTC (permalink / raw)
  To: 51903; +Cc: Pierre Neidhardt, jgart

Here's an updated patch. This one fails to build.

See previous message for error log.

* gnu/packages/music.scm (cl-cmn): New variable.
---
 gnu/packages/lisp-xyz.scm | 27 +++++++++++++++++++++++++++
 gnu/packages/music.scm    |  1 +
 2 files changed, 28 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 4b17c173c9..3da203cba9 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -19209,6 +19209,33 @@ (define-public sbcl-fxml
 (define-public cl-fxml
   (sbcl-package->cl-source-package sbcl-fxml))
 
+(define-public sbcl-cmn
+  (package
+    (name "sbcl-cmn")
+    (version "2016.8.17")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://ccrma.stanford.edu/software/cmn/cmn"
+                           ".tar.gz"))
+       (sha256
+        (base32
+         "1f4ivhg1vq2fwklmwjj30bj7ij1yab45rnjjwps3qpsh0lpd6yj3"))
+       (file-name (string-append name "-" version))))
+    (build-system asdf-build-system/sbcl)
+    (arguments
+     `(#:asd-systems '("cmn")
+       #:asd-files '("cmn.asd")))
+    (home-page "https://ccrma.stanford.edu/software/cmn/")
+    (synopsis "Western music notation package written in Common Lisp")
+    (description
+"CMN provides a package of functions to hierarchically describe a musical
+score. When evaluated, the musical score is rendered to an image.")
+    (license license:llgpl)))
+
+(define-public cl-cmn
+  (sbcl-package->cl-source-package sbcl-cmn))
+
 (define-public sbcl-vernacular
   ;; No release.
   (let ((commit "79be179e9ada423b3ec41d2a1ea6f6e0266ed21f"))
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 60cff2cc28..3f335fcf30 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -66,6 +66,7 @@ (define-module (gnu packages music)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system asdf)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system cmake)
-- 
2.33.1





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

* [bug#51903] [PATCH] gnu: Add cl-cmn.
  2021-11-17  8:50   ` jgart via Guix-patches via
@ 2021-11-17  9:24     ` Pierre Neidhardt
  0 siblings, 0 replies; 18+ messages in thread
From: Pierre Neidhardt @ 2021-11-17  9:24 UTC (permalink / raw)
  To: jgart; +Cc: 51903

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

The build file "cmn-all.lisp" is broken.
I've managed to patch it, the following builds but I haven't tested if
the result works properly.

--8<---------------cut here---------------start------------->8---
(define-public sbcl-cmn
  (package
    (name "sbcl-cmn")
    (version "2016.8.17")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://ccrma.stanford.edu/software/cmn/cmn"
                           ".tar.gz"))
       (sha256
        (base32
         "1f4ivhg1vq2fwklmwjj30bj7ij1yab45rnjjwps3qpsh0lpd6yj3"))
       (file-name (string-append name "-" version))))
    (build-system asdf-build-system/sbcl)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-build
           (lambda _
             (substitute* "cmn-all.lisp"
               (("\\(setf cmn::\\*cmn-binary-directory\\* \\(namestring \\(truename cmn-bin-directory\\)\\)\\)")
                "")
               (("\\(setf cmn::\\*cmn-source-directory\\* \\(namestring \\(truename cmn-directory\\)\\)\\)")
                "")
               (("\\(cmn-compile-and-load file\\)")
                "(load (asdf:system-relative-pathname :cmn file :type \"lisp\"))")))))))
    (home-page "https://ccrma.stanford.edu/software/cmn/")
    (synopsis "Western music notation package written in Common Lisp")
    (description
     "CMN provides a package of functions to hierarchically describe a musical
	score. When evaluated, the musical score is rendered to an image.")
    (license license:llgpl)))
--8<---------------cut here---------------end--------------->8---

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

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

* [bug#51903] cmn license etc
  2021-11-17  1:52 [bug#51903] [PATCH] gnu: Add cl-cmn jgart via Guix-patches via
  2021-11-17  7:49 ` Pierre Neidhardt
  2021-11-17  8:55 ` [bug#51903] [PATCH v2] " jgart via Guix-patches via
@ 2021-11-17 10:39 ` bil
  2021-11-21 12:51   ` Guillaume Le Vaillant
  2021-11-22 18:35 ` [bug#51903] [PATCH v3] gnu: Add cl-cmn jgart via Guix-patches via
  3 siblings, 1 reply; 18+ messages in thread
From: bil @ 2021-11-17 10:39 UTC (permalink / raw)
  To: 51903

The license entry in cmn.asd is incorrect -- I never
noticed that Rick Taube specified GPL.  The BSD
or MIT licenses are ok.  I wrote all of cmn; Rick was
just helping by adding the asd file, and I paid no
attention to it.  We weren't so concerned with licenses
in those days.  (I'll update the ccrma tarball).

cmn-all.lisp builds cmn fine for me -- is the problem
the directory?  Also to run it you need to be in
the cmn package.

Thanks for your interest in this software!





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

* [bug#51903] cmn license etc
  2021-11-17 10:39 ` [bug#51903] cmn license etc bil
@ 2021-11-21 12:51   ` Guillaume Le Vaillant
  2021-11-21 14:16     ` bil
  0 siblings, 1 reply; 18+ messages in thread
From: Guillaume Le Vaillant @ 2021-11-21 12:51 UTC (permalink / raw)
  To: bil; +Cc: Pierre Neidhardt, jgart, 51903

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

bil@ccrma.Stanford.EDU skribis:

> The license entry in cmn.asd is incorrect -- I never
> noticed that Rick Taube specified GPL.  The BSD
> or MIT licenses are ok.  I wrote all of cmn; Rick was
> just helping by adding the asd file, and I paid no
> attention to it.  We weren't so concerned with licenses
> in those days.  (I'll update the ccrma tarball).
>
> cmn-all.lisp builds cmn fine for me -- is the problem
> the directory?  Also to run it you need to be in
> the cmn package.
>
> Thanks for your interest in this software!

Hi,

I took a look at this package and I noticed that the tarball doesn't
contain an asd file anymore. Instead of removing it, wouldn't it be
possible to just put the correct license in the asdf system definition?

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

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

* [bug#51903] cmn license etc
  2021-11-21 12:51   ` Guillaume Le Vaillant
@ 2021-11-21 14:16     ` bil
  2021-11-21 16:20       ` Guillaume Le Vaillant
  0 siblings, 1 reply; 18+ messages in thread
From: bil @ 2021-11-21 14:16 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: Pierre Neidhardt, jgart, 51903

I did not remove it; for some reason it wasn't in the
directory I used to make the tarball.





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

* [bug#51903] cmn license etc
  2021-11-21 14:16     ` bil
@ 2021-11-21 16:20       ` Guillaume Le Vaillant
  2021-11-21 17:45         ` bil
  0 siblings, 1 reply; 18+ messages in thread
From: Guillaume Le Vaillant @ 2021-11-21 16:20 UTC (permalink / raw)
  To: bil; +Cc: Pierre Neidhardt, jgart, 51903

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

bil@ccrma.Stanford.EDU skribis:

> I did not remove it; for some reason it wasn't in the
> directory I used to make the tarball.

In order for the compilation of cmn to put the files in the standard
locations used in GNU Guix, I changed the asd file to replace

  :components ((:file "cmn-all\" ))

by

  :serial t
  :components ((:file "cmn-init")
               (:file "cmn-utils")
               (:file "cmn-objects")
               (:file "cmn0")
               (:file "cmn-grfx")
               (:file "cmn-glyphs")
               (:file "cmn1")
               (:file "cmn2")
               (:file "cmn3")
               (:file "cmn4")
               (:file "rqq")
               (:file "wedge")
               (:file "accent")
               (:file "pedal")
               (:file "percussion")
               (:file "ring")
               (:file "rests")
               (:file "lyrics")
               (:file "transpose")
               (:file "pmn")
               (:file "quarter"))

and it almost works.
The only issue making the compilation fail is a type error warning by
sbcl, which I think is due to a bug in the program.

In the IDENTIFY-SCORE function of the "cmn2.lisp" file, the TIED-TAG
variable is defined by a "(find :tied-to (store-data object))" form,
which means that TIED-TAG will be either :TIED-TO or NIL.
However a few lines lower, the "(setf (second tied-tag) ...)" form
indicates that TIED-TAG must be a non-empty list.

From the surrounding code, I got the impression that
"(store-data object)" probably contains lists, and that the definition
of TIED-TAG should be something like

  (find :tied-to (store-data object) :key #'car)

With this, the compilation succeeds with sbcl and ecl, and the little
"(cmn treble c4 q)" example from the README file works.

I don't know if you're interested in the modified asd file, we can keep
it as a Guix-only thing anyway. However the TIED-TAG thing looks like an
actual bug.
What do you think?

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

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

* [bug#51903] cmn license etc
  2021-11-21 16:20       ` Guillaume Le Vaillant
@ 2021-11-21 17:45         ` bil
  2021-11-21 17:54           ` Guillaume Le Vaillant
  0 siblings, 1 reply; 18+ messages in thread
From: bil @ 2021-11-21 17:45 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: Pierre Neidhardt, jgart, 51903

Please do not repair code you don't understand.  First,
sbcl issues a warning, not an error.  The warning is
asinine -- find (in the original form) returns a list;
I check whether it is nil before setting a portion of it.
If you change the find statement to add :key #'car, you've
changed it from memq to assq (in Scheme nomenclature) --
these are not the same thing.  Your test of running
(cmn treble c4 q) did not hit the code in question, so
it tested nothing.  All you've done is add a bug to
my code.





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

* [bug#51903] cmn license etc
  2021-11-21 17:45         ` bil
@ 2021-11-21 17:54           ` Guillaume Le Vaillant
  2021-11-21 19:22             ` bil
  0 siblings, 1 reply; 18+ messages in thread
From: Guillaume Le Vaillant @ 2021-11-21 17:54 UTC (permalink / raw)
  To: bil; +Cc: Pierre Neidhardt, jgart, 51903

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

bil@ccrma.Stanford.EDU skribis:

> Please do not repair code you don't understand.  First,
> sbcl issues a warning, not an error.  The warning is
> asinine -- find (in the original form) returns a list;
> I check whether it is nil before setting a portion of it.
> If you change the find statement to add :key #'car, you've
> changed it from memq to assq (in Scheme nomenclature) --
> these are not the same thing.  Your test of running
> (cmn treble c4 q) did not hit the code in question, so
> it tested nothing.  All you've done is add a bug to
> my code.

If you take a look at the Common Lisp spec [1], you'll see that 'find'
returns an element, not a list. The function returning a list is
'member' [2].

[1] http://www.lispworks.com/documentation/HyperSpec/Body/f_find_.htm
[2] http://www.lispworks.com/documentation/HyperSpec/Body/f_mem_m.htm

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

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

* [bug#51903] cmn license etc
  2021-11-21 17:54           ` Guillaume Le Vaillant
@ 2021-11-21 19:22             ` bil
  2021-11-22  0:30               ` jgart via Guix-patches via
  0 siblings, 1 reply; 18+ messages in thread
From: bil @ 2021-11-21 19:22 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: Pierre Neidhardt, jgart, 51903

Oh hell.  I'm forgetting CL.  My apologies. Your fix
was probably correct.





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

* [bug#51903] cmn license etc
  2021-11-21 19:22             ` bil
@ 2021-11-22  0:30               ` jgart via Guix-patches via
  2021-11-22 10:10                 ` Guillaume Le Vaillant
  2021-11-22 14:13                 ` bil
  0 siblings, 2 replies; 18+ messages in thread
From: jgart via Guix-patches via @ 2021-11-22  0:30 UTC (permalink / raw)
  To: bil; +Cc: Guillaume Le Vaillant, Pierre Neidhardt, 51903

On Sun, 21 Nov 2021 11:22:21 -0800 bil@ccrma.Stanford.EDU wrote:
> Oh hell.  I'm forgetting CL.  My apologies. Your fix
> was probably correct.
> 

Hi everyone,

It's great that this was able to be resolved.

I'm looking forward to having a cmn package for guix.

Guillaume would you be so kind to send your patch to Bill?

Bill, would that be helpful?

I can then update the guix package to use the newer version of cmn once it is released and avoid 
having to patch the asd file.

all the best,

jgart




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

* [bug#51903] cmn license etc
  2021-11-22  0:30               ` jgart via Guix-patches via
@ 2021-11-22 10:10                 ` Guillaume Le Vaillant
  2021-11-22 14:13                 ` bil
  1 sibling, 0 replies; 18+ messages in thread
From: Guillaume Le Vaillant @ 2021-11-22 10:10 UTC (permalink / raw)
  To: jgart; +Cc: bil, Pierre Neidhardt, 51903


[-- Attachment #1.1: Type: text/plain, Size: 618 bytes --]

jgart <jgart@dismail.de> skribis:

> Hi everyone,
>
> It's great that this was able to be resolved.
>
> I'm looking forward to having a cmn package for guix.
>
> Guillaume would you be so kind to send your patch to Bill?
>
> Bill, would that be helpful?
>
> I can then update the guix package to use the newer version of cmn once it is released and avoid 
> having to patch the asd file.
>
> all the best,
>
> jgart

The patches I used are in attachment. Concerning the first one, it fixes
the type issue, but I don't know how to test wether running this code
produces a correct result or not.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-cmn-fix-type-issue.patch --]
[-- Type: text/x-patch, Size: 664 bytes --]

diff -Naur cmn/cmn2.lisp cmn-new/cmn2.lisp
--- cmn/cmn2.lisp	2019-01-01 15:40:00.000000000 +0100
+++ cmn-new/cmn2.lisp	2021-11-22 11:00:26.894007683 +0100
@@ -4156,7 +4156,7 @@
 			      (push (list object note-name) tied-to-notes)
 			      (format s "~%      (setf ~A ~A)" note-name (identify object)))
 			  (let ((tied-note-name (second (find (stem-tie object) tied-to-notes :test #'eq :key #'first)))
-				(tied-tag (find :tied-to (store-data object))))
+				(tied-tag (find :tied-to (store-data object) :key #'car)))
 			    (if (not tied-tag)
 				(push (list :tied-to tied-note-name) (store-data object))
 			      (setf (second tied-tag) tied-note-name))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-cmn-asdf-system.patch --]
[-- Type: text/x-patch, Size: 1050 bytes --]

diff -Naur cmn/cmn.asd cmn-new/cmn.asd
--- cmn/cmn.asd	2021-11-21 15:06:47.000000000 +0100
+++ cmn-new/cmn.asd	2021-11-22 11:04:03.193342791 +0100
@@ -19,5 +19,25 @@
   :description "Common Music Notation"
   :author "William Schottstaedt <bil (at) ccmra (dot) stanford (dot) edu>"
   :licence "MIT"
-  :components ((:file "cmn-all" )))
-
+  :serial t
+  :components ((:file "cmn-init")
+               (:file "cmn-utils")
+               (:file "cmn-objects")
+               (:file "cmn0")
+               (:file "cmn-grfx")
+               (:file "cmn-glyphs")
+               (:file "cmn1")
+               (:file "cmn2")
+               (:file "cmn3")
+               (:file "cmn4")
+               (:file "rqq")
+               (:file "wedge")
+               (:file "accent")
+               (:file "pedal")
+               (:file "percussion")
+               (:file "ring")
+               (:file "rests")
+               (:file "lyrics")
+               (:file "transpose")
+               (:file "pmn")
+               (:file "quarter")))

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

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

* [bug#51903] cmn license etc
  2021-11-22  0:30               ` jgart via Guix-patches via
  2021-11-22 10:10                 ` Guillaume Le Vaillant
@ 2021-11-22 14:13                 ` bil
  1 sibling, 0 replies; 18+ messages in thread
From: bil @ 2021-11-22 14:13 UTC (permalink / raw)
  To: jgart; +Cc: Guillaume Le Vaillant, Pierre Neidhardt, 51903

I have made those changes to my version of cmn, and updated
the tarball.





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

* [bug#51903] [PATCH v3] gnu: Add cl-cmn.
  2021-11-17  1:52 [bug#51903] [PATCH] gnu: Add cl-cmn jgart via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-11-17 10:39 ` [bug#51903] cmn license etc bil
@ 2021-11-22 18:35 ` jgart via Guix-patches via
  2021-11-22 19:45   ` bug#51903: " Guillaume Le Vaillant
  3 siblings, 1 reply; 18+ messages in thread
From: jgart via Guix-patches via @ 2021-11-22 18:35 UTC (permalink / raw)
  To: 51903; +Cc: Guillaume Le Vaillant, Pierre Neidhardt, jgart

Hi all,

I packaged the new tarball that Bill released. It builds successfully now.

Below is the new patch, v3:

Thank you to everyone for the help with this.

Guillaume and/or Pierre,

Here's a minimal example from the manual if you'd like to do a quick test in a repl:

```
(cmn (size 24) staff treble c4 w double-bar)
```

or a larger cmn example:

```
(cmn (size 24)
  (system brace 
    (staff treble (meter 6 8) 
      (c4 e. tenuto) (d4 s) (ef4 e sf) 
      (c4 e) (d4 s) (en4 s) (fs4 e (fingering 3))) 
    (staff treble (meter 3 4) 
      (c5 e. marcato) (d5 s bartok-pizzicato) (ef5 e) 
      (c5 e staccato tenuto) (d5 s down-bow) (en5 s) (fs5 e)))
  (system bracket
    (staff bar bass (meter 6 16) 
      (c4 e. wedge) (d4 s staccato) (ef4 e left-hand-pizzicato) 
      (c4 e tenuto accent rfz) (d4 s mordent) (en4 s pp) (fs4 e fermata))))
```

all best,

jgart

* gnu/packages/lisp-xyz.scm (cl-cmn, sbcl-cmn): New variable.
---
 gnu/packages/lisp-xyz.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index f891164fc8..3b11e169e6 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -19695,6 +19695,33 @@ (define-public sbcl-vernacular
 (define-public cl-vernacular
   (sbcl-package->cl-source-package sbcl-vernacular))
 
+(define-public sbcl-cmn
+  (package
+    (name "sbcl-cmn")
+    (version "2021.11.22")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://ccrma.stanford.edu/software/cmn/cmn"
+                           ".tar.gz"))
+       (sha256
+        (base32
+         "04j1l57cdyfi2zzxqwmvmf1hl899ffgs3bl4r42ba47zsw45kq14"))
+       (file-name (string-append name "-" version))))
+    (build-system asdf-build-system/sbcl)
+    (arguments
+     `(#:asd-systems '("cmn")
+       #:asd-files '("cmn.asd")))
+    (home-page "https://ccrma.stanford.edu/software/cmn/")
+    (synopsis "Western music notation package written in Common Lisp")
+    (description
+"CMN provides a package of functions to hierarchically describe a musical
+score. When evaluated, the musical score is rendered to an image.")
+    (license license:llgpl)))
+
+(define-public cl-cmn
+  (sbcl-package->cl-source-package sbcl-cmn))
+
 (define-public sbcl-cl-https-everywhere
   ;; No release.
   ;; Don't forget to update the https-everywhere input.
-- 
2.34.0





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

* bug#51903: [PATCH v3] gnu: Add cl-cmn.
  2021-11-22 18:35 ` [bug#51903] [PATCH v3] gnu: Add cl-cmn jgart via Guix-patches via
@ 2021-11-22 19:45   ` Guillaume Le Vaillant
  2021-11-22 20:11     ` [bug#51903] " jgart via Guix-patches via
  0 siblings, 1 reply; 18+ messages in thread
From: Guillaume Le Vaillant @ 2021-11-22 19:45 UTC (permalink / raw)
  To: jgart; +Cc: 51903-done, Pierre Neidhardt

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

Patch pushed as 6ac283bad7ace27ecd66dd8718b94db4628b48e5 with a few
modifications (copyright line, license field, ecl package).
Thanks.

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

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

* [bug#51903] [PATCH v3] gnu: Add cl-cmn.
  2021-11-22 19:45   ` bug#51903: " Guillaume Le Vaillant
@ 2021-11-22 20:11     ` jgart via Guix-patches via
  0 siblings, 0 replies; 18+ messages in thread
From: jgart via Guix-patches via @ 2021-11-22 20:11 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 51903-done, Pierre Neidhardt

On Mon, 22 Nov 2021 19:45:39 +0000 Guillaume Le Vaillant <glv@posteo.net> wrote:
> Patch pushed as 6ac283bad7ace27ecd66dd8718b94db4628b48e5 with a few
> modifications (copyright line, license field, ecl package).
> Thanks.

Thank you! Much appreciated.

all best,

jgart




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

end of thread, other threads:[~2021-11-22 20:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17  1:52 [bug#51903] [PATCH] gnu: Add cl-cmn jgart via Guix-patches via
2021-11-17  7:49 ` Pierre Neidhardt
2021-11-17  8:50   ` jgart via Guix-patches via
2021-11-17  9:24     ` Pierre Neidhardt
2021-11-17  8:55 ` [bug#51903] [PATCH v2] " jgart via Guix-patches via
2021-11-17 10:39 ` [bug#51903] cmn license etc bil
2021-11-21 12:51   ` Guillaume Le Vaillant
2021-11-21 14:16     ` bil
2021-11-21 16:20       ` Guillaume Le Vaillant
2021-11-21 17:45         ` bil
2021-11-21 17:54           ` Guillaume Le Vaillant
2021-11-21 19:22             ` bil
2021-11-22  0:30               ` jgart via Guix-patches via
2021-11-22 10:10                 ` Guillaume Le Vaillant
2021-11-22 14:13                 ` bil
2021-11-22 18:35 ` [bug#51903] [PATCH v3] gnu: Add cl-cmn jgart via Guix-patches via
2021-11-22 19:45   ` bug#51903: " Guillaume Le Vaillant
2021-11-22 20:11     ` [bug#51903] " jgart via Guix-patches via

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).