Message ID | 20211117015205.19233-1-jgart@dismail.de |
---|---|
State | Accepted |
Headers | show |
Series | [bug#51903] gnu: Add cl-cmn. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
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!
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?
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---
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!
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?
I did not remove it; for some reason it wasn't in the directory I used to make the tarball.
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?
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.
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
Oh hell. I'm forgetting CL. My apologies. Your fix was probably correct.
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
I have made those changes to my version of cmn, and updated the tarball.
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")