[PATCH] gnu: Add cl-cmn.

DoneSubmitted by jgart.
Details
4 participants
  • bil
  • Guillaume Le Vaillant
  • jgart
  • Pierre Neidhardt
Owner
unassigned
Severity
normal
J
(address . guix-patches@gnu.org)
20211117015205.19233-1-jgart@dismail.de
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.


cmn is a dependency of slippery-chicken:


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

Toggle diff (41 lines)
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
P
P
Pierre Neidhardt wrote on 17 Nov 2021 08:49
(name . jgart)(address . jgart@dismail.de)
871r3fte5f.fsf@ambrevar.xyz
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

Toggle snippet (4 lines)
(define-public cl-cmn
(sbcl-package->cl-source-package sbcl-cmn))

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!
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmGUtBwSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/40IH/RWer1KlEH8VYl0lmZj2jRPTrHk2k395
Ega9wFgVlyqeFDh/g52EdVt/PP0cWq044Uo9rSM5QIZvQr+7mkYjKdTzEpC1UlPq
VLedp1GGc7VYNNfWgmGugaRq87ptYBZfWIZeA9E4+9UunLgkWwY31b5ExWJi0xzt
WAMZa36LFNFZnTVYyEOogrAVuKyfKh2aQu6uXNp9yTjlaaRIfWSHyv4pVJ/l+8Ah
BwIP2u/aQDeau4OTMWbR8/S64be/wPUpYeOwAxgUTmH0bSgHZVpFXsXVOfs+v0oK
BZZiDqtbk9b/2XIUtAd4yZYAT0DPDhHqj5KMy/4z4BnuZdEYz7vu1ho=
=y5o8
-----END PGP SIGNATURE-----

J
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 51903@debbugs.gnu.org)
20211117035030.GB31148@gac.attlocal.net
On Wed, 17 Nov 2021 08:49:48 +0100 Pierre Neidhardt <mail@ambrevar.xyz> wrote:
Toggle quote (21 lines)
> 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)
".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")))
(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?
J
[PATCH v2] gnu: Add cl-cmn.
(address . 51903@debbugs.gnu.org)
20211117085546.1183-1-jgart@dismail.de
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(+)

Toggle diff (52 lines)
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
P
P
Pierre Neidhardt wrote on 17 Nov 2021 10:24
Re: [PATCH] gnu: Add cl-cmn.
(name . jgart)(address . jgart@dismail.de)(address . 51903@debbugs.gnu.org)
87a6i3rv7t.fsf@ambrevar.xyz
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.

Toggle snippet (33 lines)
(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)))
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAmGUyjYSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/CCYH/iy00bWZLQlIPasqG9QHqkn4Hpd7eho1
+oFN2cAmrycYAvMxlU08tX00Q/7rrbvmL8ril3IDdINeQTxpM1iQKYhB9Jx7cDqv
jauaMDbdYfeYrHcWU3lAjwJuS84fsy/etzI4Vojly1J6YAE01QJgBiJFb7NoU5gH
yim5Nafa9DIMDUm/AM/DCwVsc/WnyC5PzM0xEKr+5SMWA/H4DWlr7yZQ6MiOt56O
qklREnLuAyu5hQkiiuI9vIibBU6BS9EnPw9Tu623fTdRkGyTKWuCl9VGmJqOFD/1
6INL4xi/2I7JDtUEs0ZHn1IVBNUk0SdPw46JBaBnEmeOv6t22i991mc=
=oXFP
-----END PGP SIGNATURE-----

B
cmn license etc
(address . 51903@debbugs.gnu.org)
8789fcc8f912767edad3ca7ce2c0aff0@ccrma.stanford.edu
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!
G
G
Guillaume Le Vaillant wrote on 21 Nov 2021 13:51
(address . bil@ccrma.stanford.edu)
875yslbr6f.fsf@kitej
bil@ccrma.Stanford.EDU skribis:

Toggle quote (13 lines)
> 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?
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZpCqA8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j/z0AD8DmmjSTrjQfiPiwSiRIVCEcwkX+Ng9TfzTB4L
DN7lNx4A/3FuR+pWy/Ww2Rjr/8n1O/OJ3lUgl+PxnI18M6QP00iU
=0+SO
-----END PGP SIGNATURE-----

B
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
a0001a8d66b44bddc083ac835eb6f127@ccrma.stanford.edu
I did not remove it; for some reason it wasn't in the
directory I used to make the tarball.
G
G
Guillaume Le Vaillant wrote on 21 Nov 2021 17:20
(address . bil@ccrma.Stanford.EDU)
871r39bg9j.fsf@kitej
bil@ccrma.Stanford.EDU skribis:

Toggle quote (3 lines)
> 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?
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZp56A8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j+NMQEAhbvH8hG8trq8h19dORETkLBm+jw2CJzvOv0p
Oq4aCkcA/RPcQh2u5Xu2ZvegSXUToasenRlZMekNd0BnPZATuKi0
=tdba
-----END PGP SIGNATURE-----

B
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
1894d511fa3d23b2d7df2637074452d8@ccrma.stanford.edu
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.
G
G
Guillaume Le Vaillant wrote on 21 Nov 2021 18:54
(address . bil@ccrma.Stanford.EDU)
87wnl19yjk.fsf@kitej
bil@ccrma.Stanford.EDU skribis:

Toggle quote (11 lines)
> 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].

-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZqJ3w8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j9ocgD9HCdKN0H60tE4GW0Dz5lDje/Gj66y1Vp0HKGS
9HvO0DcA/iJQ0LzBmHuZz2OaK5NyF8tYfu/dgZFSx3tRSpPbp+jN
=dAi7
-----END PGP SIGNATURE-----

B
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
6d040ba1b363019b7d0e6b36b2a9af38@ccrma.stanford.edu
Oh hell. I'm forgetting CL. My apologies. Your fix
was probably correct.
J
(address . bil@ccrma.Stanford.EDU)
20211121193045.GB7334@gac.attlocal.net
On Sun, 21 Nov 2021 11:22:21 -0800 bil@ccrma.Stanford.EDU wrote:
Toggle quote (4 lines)
> 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
G
G
Guillaume Le Vaillant wrote on 22 Nov 2021 11:10
(name . jgart)(address . jgart@dismail.de)
877dd0mqth.fsf@kitej
jgart <jgart@dismail.de> skribis:

Toggle quote (17 lines)
> 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.
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))
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")))
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZtvug8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j8fFQD/c5l4yT8XgeUf55/99o49ay0uMjQVq9q+EkQJ
ey+3NR8BAJYvhNF7zl5/SEst12jIW5cVb8NY5RcEB2NiuAkMFaLq
=n2HU
-----END PGP SIGNATURE-----

B
(name . jgart)(address . jgart@dismail.de)
f6d845e111a907d5cade208beb76c443@ccrma.stanford.edu
I have made those changes to my version of cmn, and updated
the tarball.
J
[PATCH v3] gnu: Add cl-cmn.
(address . 51903@debbugs.gnu.org)
20211122183549.17196-1-jgart@dismail.de
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(+)

Toggle diff (40 lines)
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
G
G
Guillaume Le Vaillant wrote on 22 Nov 2021 20:45
(name . jgart)(address . jgart@dismail.de)
87tug4km5f.fsf@kitej
Patch pushed as 6ac283bad7ace27ecd66dd8718b94db4628b48e5 with a few
modifications (copyright line, license field, ecl package).
Thanks.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZvz3A8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j8F/QD/crl7tqUwihgwcIbfOKyoO0Wxn62Hj7pMjh86
/2mgcdkA/33RpaiIYGKJnDKP3AI/zF5F8SbcP7FhBfQ+DYRiak9F
=G6WC
-----END PGP SIGNATURE-----

Closed
J
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20211122151149.GB24976@gac.attlocal.net
On Mon, 22 Nov 2021 19:45:39 +0000 Guillaume Le Vaillant <glv@posteo.net> wrote:
Toggle quote (4 lines)
> Patch pushed as 6ac283bad7ace27ecd66dd8718b94db4628b48e5 with a few
> modifications (copyright line, license field, ecl package).
> Thanks.

Thank you! Much appreciated.

all best,

jgart
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 51903@debbugs.gnu.org