[PATCH] gnu: Add cl-clm.

  • Done
  • quality assurance status badge
Details
3 participants
  • Guillaume Le Vaillant
  • jgart
  • Maxim Cournoyer
Owner
unassigned
Submitted by
jgart
Severity
normal
J
(address . guix-patches@gnu.org)
20211122204527.27050-1-jgart@dismail.de
Hi,

This is another WIP patch for the Common Lisp Music package (CLM) for GNU Guix.
It has a similar package definition to CMN which was successfully packaged and merged
today into Guix thanks to the help of Bill, Guillaume, and Pierre:


My goal in packaging clm and cmn is to subsequently be able to package
slippery-chicken for GNU Guix:


slippery-chicken hints at alsa headers required by clm on this line of its' install script:


But, I think that the most immediate issue might be with the asd file in the clm repo:


Here is the asd file printed for convenience (delimited by backticks):

```
;;; ASDF system definition file for CLM
;;; For information on ASDF see: http://www.cliki.net/asdf
;;;
;;; To load CLM from a non-standard install location:
;;;
;;; (require :asdf)
;;; (push "/path/to/clm-3/" asdf:*central-registry*)
;;; (asdf:operate 'asdf:load-source-op :clm)
;;;
;;; To download/install/load CLM from its archive:
;;;
;;; (require :asdf)
;;; (progn (push "/path/to/asdf-install/" asdf:*central-registry*)
;;; (asdf:operate 'asdf:load-op 'asdf-install))
;;; (asdf-install:install 'clm)
;;; (asdf:operate 'asdf:load-source-op 'clm)

;; from Rick Taube in 2006:
; (asdf:defsystem "clm"
; :description "Common Lisp Music"
; :version "3"
; :author "William Schottstaedt <bil (at) ccrma (dot) stanford (dot) edu>"
; :licence "BSD or whatever"
; :components ((:file "all" )))

(in-package :asdf-user)

;; from Tito Latini 14-Dec-16:
(asdf:defsystem "clm"
:description "Common Lisp Music"
:version "5"
:author "William Schottstaedt <bil (at) ccrma (dot) stanford (dot) edu>"
:licence "BSD or whatever"
:perform (compile-op (o c)
(load (system-relative-pathname "clm" "all.lisp"))))
```

Guillaume, do you see this asd file as needing a similar fix to your previous patching?

If so, I can try my hands at patching it myself while using your previous
patch to Bill as a template I can follow.

I would send a patch to Bill afterwards for review and inclusion in the tarball.

My knowledge of asd file configuration is rather limited. Any advice here is much appreciated.

all best,

jgart

* gnu/packages/lisp-xyz.scm (cl-clm, sbcl-clm, ecl-clm): New variables.
---
gnu/packages/lisp-xyz.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index bb697c4c60..918fb38c9f 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -19721,6 +19721,31 @@ (define-public cl-cmn
(define-public ecl-cmn
(sbcl-package->ecl-package sbcl-cmn))
+(define-public sbcl-clm
+ (package
+ (name "sbcl-clm")
+ (version "5")
+ (source
+ (origin
+ (method url-fetch)
+ (uri "https://ccrma.stanford.edu/software/clm/clm-5.tar.gz")
+ (file-name (string-append "clm-" version ".tar.gz"))
+ (sha256
+ (base32 "1ckgl7rsnxppnf47jqayrbyhm3hv6c4f7n2994ylva6wiy5w7wp8"))))
+ (build-system asdf-build-system/sbcl)
+ (home-page "https://ccrma.stanford.edu/software/clm/")
+ (synopsis "Music synthesis and signal processing package")
+ (description
+"Common Lisp Music is a music synthesis and signal processing package
+in the Music V family.")
+ (license license:expat)))
+
+(define-public cl-clm
+ (sbcl-package->cl-source-package sbcl-clm))
+
+(define-public ecl-clm
+ (sbcl-package->ecl-package sbcl-clm))
+
(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 23 Nov 2021 14:00
(name . jgart)(address . jgart@dismail.de)
87lf1fnh72.fsf@kitej
jgart <jgart@dismail.de> skribis:

Toggle quote (38 lines)
> Hi,
>
> This is another WIP patch for the Common Lisp Music package (CLM) for GNU Guix.
> It has a similar package definition to CMN which was successfully packaged and merged
> today into Guix thanks to the help of Bill, Guillaume, and Pierre:
>
> https://en.wikipedia.org/wiki/Common_Lisp_Music
>
> My goal in packaging clm and cmn is to subsequently be able to package
> slippery-chicken for GNU Guix:
>
> https://github.com/mdedwards/slippery-chicken
>
> slippery-chicken hints at alsa headers required by clm on this line of its' install script:
>
> https://github.com/mdedwards/slippery-chicken/blob/master/sc-install#L29
>
> But, I think that the most immediate issue might be with the asd file in the clm repo:
>
> https://ccrma.stanford.edu/software/clm/clm-5.tar.gz
>
> Here is the asd file printed for convenience (delimited by backticks):
>
> [...]
>
> Guillaume, do you see this asd file as needing a similar fix to your previous patching?
>
> If so, I can try my hands at patching it myself while using your previous
> patch to Bill as a template I can follow.
>
> I would send a patch to Bill afterwards for review and inclusion in the tarball.
>
> My knowledge of asd file configuration is rather limited. Any advice here is much appreciated.
>
> all best,
>
> jgart

Hi,

Making an asdf system definition for clm similar to the one for cmn
won't be enough, because in addition to compiling lisp files, the
"all.lisp" file is also calling the "configure" script and calling gcc
to compile C code and make a shared library.

The attached modified version of your patch seems to compile clm without
error (although some files end up in a different directory compared to
"regular" lisp libraries), but I have not tested if it works as expected.
From 8a9880fcc51f33e0ad2f8fa1887b71c55a78ffb9 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Mon, 22 Nov 2021 15:45:28 -0500
Subject: [PATCH] gnu: Add cl-clm.

* gnu/packages/lisp-xyz.scm (cl-clm, sbcl-clm): New variables.

Co-authored-by: Guillaume Le Vaillant <glv@posteo.net>
---
gnu/packages/lisp-xyz.scm | 43 +++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index bb697c4c60..799d8f7bbc 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -69,6 +69,7 @@ (define-module (gnu packages lisp-xyz)
#:use-module (gnu packages file)
#:use-module (gnu packages fonts)
#:use-module (gnu packages fontutils)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
@@ -19721,6 +19722,48 @@ (define-public cl-cmn
(define-public ecl-cmn
(sbcl-package->ecl-package sbcl-cmn))
+(define-public sbcl-clm
+ (package
+ (name "sbcl-clm")
+ (version "5")
+ (source
+ (origin
+ (method url-fetch)
+ (uri "https://ccrma.stanford.edu/software/clm/clm-5.tar.gz")
+ (sha256
+ (base32 "1ckgl7rsnxppnf47jqayrbyhm3hv6c4f7n2994ylva6wiy5w7wp8"))))
+ (build-system asdf-build-system/sbcl)
+ (native-inputs
+ `(("gcc" ,gcc)))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-build
+ (lambda _
+ (substitute* "configure"
+ (("/bin/sh")
+ (which "bash")))
+ (substitute* '("all.lisp"
+ "index.cl"
+ "initmus.lisp")
+ (("/bin/csh")
+ (which "bash")))
+ (substitute* "all.lisp"
+ (("#\\+sbcl \\(shadowing-import 'clm:double\\)" all)
+ (string-append all
+ " #+sbcl (shadowing-import 'clm:env)"))))))))
+ (home-page "https://ccrma.stanford.edu/software/clm/")
+ (synopsis "Music synthesis and signal processing package")
+ (description
+"Common Lisp Music is a music synthesis and signal processing package
+in the Music V family.")
+ (license license:expat)))
+
+(define-public cl-clm
+ (sbcl-package->cl-source-package sbcl-clm))
+
(define-public sbcl-cl-https-everywhere
;; No release.
;; Don't forget to update the https-everywhere input.
--
2.33.1
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZzqMQ8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j9uLgD5AQmQ5e7iFsAn6Af6kA84VmVxPjgyNI3KsVOF
bcsGizMA/0VSxKTLAnoGR8JQgeNn6C5v2mCPL5hqUQ7KwNNffjyr
=coSz
-----END PGP SIGNATURE-----

J
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20220409181818.GB10748@gac.attlocal.net
On Tue, 23 Nov 2021 13:00:45 +0000 Guillaume Le Vaillant <glv@posteo.net> wrote:

Hi Guillaume,

I finally got around to testing this.


Toggle quote (4 lines)
> The attached modified version of your patch seems to compile clm without
> error (although some files end up in a different directory compared to
> "regular" lisp libraries), but I have not tested if it works as expected.

This is the error I get from my session:

```
λ guix shell -L . sbcl sbcl-clm rlwrap
hint: Consider passing the `--check' option once to make sure your shell does not clobber environment variables.

^C
λ guix shell -L . sbcl sbcl-clm rlwrap --pure
hint: Consider passing the `--check' option once to make sure your shell does not clobber environment variables.

substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following derivation will be built:
/gnu/store/kr09rg3zhhjnzfw65mddy79lk64nf83s-profile.drv

0.1 MB will be downloaded
rlwrap-0.45.2 93KiB 396KiB/s 00:00 [##################] 100.0%
building CA certificate bundle...
listing Emacs sub-directories...
building fonts directory...
building directory of Info manuals...
building profile with 3 packages...
guix-shell rlwrap sbcl
This is SBCL 2.2.2, an implementation of ANSI Common Lisp.
More information about SBCL is available at http://www.sbcl.org/.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
CL-USER(1): (require :clm)
; using existing configuration file mus-config.h

;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/clm-package.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/initmus.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/sndlib2clm.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/defaults.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/ffi.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/mus.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/run.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/sound.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/defins.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/env.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/export.fasl
;loading /gnu/store/689x05vvcxd0q4crygl698vykfdv9s83-sbcl-clm-5/share/common-lisp/sbcl/clm/clm1.faslALSA lib dlmisc.c:339:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/gnu/store/nfxcjvv9c2q6in9x52kkkayqv38k00ai-alsa-lib-1.2.4/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory)
ALSA lib dlmisc.c:339:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/gnu/store/nfxcjvv9c2q6in9x52kkkayqv38k00ai-alsa-lib-1.2.4/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory)

NIL
```

It looks like an issue with a shared library. WDYT?

all best,

jgart

https://whereis.???/
gemini://whereis.???/
J
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20220409183138.GB11664@gac.attlocal.net
On Sat, 09 Apr 2022 18:18:18 -0400 jgart <jgart@dismail.de> wrote:

Just wanted to share that I was also able to enter the clm package:

```
CL-USER(2): (in-package :clm)

#<PACKAGE "CLM">
CLM(3):
```

all best,

jgart
J
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20220409183342.GD11664@gac.attlocal.net
On Sat, 09 Apr 2022 18:31:38 -0400 jgart <jgart@dismail.de> wrote:
Toggle quote (2 lines)
> On Sat, 09 Apr 2022 18:18:18 -0400 jgart <jgart@dismail.de> wrote:

And that sbcl-clm and cl-clm are now in Guix 'R Us:


ecl-clm failed to build for me :(

I can try building ecl-clm again and sharing a failure log if you think that will prove useful.

all best,

jgart
G
G
Guillaume Le Vaillant wrote on 12 Apr 2022 14:15
(name . jgart)(address . jgart@dismail.de)(address . 52045@debbugs.gnu.org)
877d7uwkyo.fsf@kitej
jgart <jgart@dismail.de> skribis:

Toggle quote (6 lines)
> On Sat, 09 Apr 2022 18:31:38 -0400 jgart <jgart@dismail.de> wrote:
>
> And that sbcl-clm and cl-clm are now in Guix 'R Us:
>
> https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/lisp.scm#L2371

After entering the :clm package and trying some simple examples using the
"v.ins" instrument, it failed because of some missing ".so" shared library.
Does it work for you?
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYlVu3w8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j8KzgD/R0A4bg+boWArEQ3g/qEJKhmd4wnmz+vPNNfq
SI6ZsQEA/0Gxgx5pb/DBoqi8TtycpaZhQB88xtCYkipglwKd1mKJ
=F78o
-----END PGP SIGNATURE-----

J
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 52045@debbugs.gnu.org)
20220412122851.GB4449@gac.attlocal.net
On Tue, 12 Apr 2022 12:15:27 +0000 Guillaume Le Vaillant <glv@posteo.net> wrote:
Toggle quote (12 lines)
> jgart <jgart@dismail.de> skribis:
>
> > On Sat, 09 Apr 2022 18:31:38 -0400 jgart <jgart@dismail.de> wrote:
> >
> > And that sbcl-clm and cl-clm are now in Guix 'R Us:
> >
> > https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/lisp.scm#L2371
>
> After entering the :clm package and trying some simple examples using the
> "v.ins" instrument, it failed because of some missing ".so" shared library.
> Does it work for you?

It fails because of the missing ".so" shared library for me also.

Here are some notes from the author of clm:

Try this:

```
(compile-file "v.ins")
(load "v")
```

``
Toggle quote (3 lines)
> I had also experienced this error when first running `(require :clm)`
> in a sbcl repl:

It looks like you're running pulse audio and need something from alsa?
Maybe it's related to the code that builds sndplay in initmus.lisp.
``

The above is from Bill regarding the shared library code.

all best,

jgart
M
M
Maxim Cournoyer wrote on 7 Jul 2022 20:23
Re: bug#52045: [PATCH] gnu: Add cl-clm.
(name . jgart)(address . jgart@dismail.de)
87a69kzsra.fsf_-_@gmail.com
Hello,

jgart <jgart@dismail.de> writes:

Toggle quote (34 lines)
> On Tue, 12 Apr 2022 12:15:27 +0000 Guillaume Le Vaillant <glv@posteo.net> wrote:
>> jgart <jgart@dismail.de> skribis:
>>
>> > On Sat, 09 Apr 2022 18:31:38 -0400 jgart <jgart@dismail.de> wrote:
>> >
>> > And that sbcl-clm and cl-clm are now in Guix 'R Us:
>> >
>> > https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/lisp.scm#L2371
>>
>> After entering the :clm package and trying some simple examples using the
>> "v.ins" instrument, it failed because of some missing ".so" shared library.
>> Does it work for you?
>
> It fails because of the missing ".so" shared library for me also.
>
> Here are some notes from the author of clm:
>
> Try this:
>
> ```
> (compile-file "v.ins")
> (load "v")
> ```
>
> ``
>> I had also experienced this error when first running `(require :clm)`
>> in a sbcl repl:
>
> It looks like you're running pulse audio and need something from alsa?
> Maybe it's related to the code that builds sndplay in initmus.lisp.
> ``
>
> The above is from Bill regarding the shared library code.

What is the status of this? Has the effort been abandoned? I'm of the
opinion that WIP do not belongs to guix-patches, lest reviewers be
drowned in a sea of unclosable tickets :-). You are welcome to post it
to guix-devel though, where it will be archived for interested parties
to pick it up.

Thanks,

Maxim
M
M
Maxim Cournoyer wrote on 7 Jul 2022 20:23
control message for bug #52045
(address . control@debbugs.gnu.org)
878rp4zsr6.fsf@gmail.com
tags 52045 + moreinfo
quit
J
J
jgart wrote on 8 Jul 2022 02:16
Re: bug#52045: [PATCH] gnu: Add cl-clm.
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
20220707191618.GP1675@gac
On Thu, 07 Jul 2022 14:23:37 -0400 Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
Toggle quote (48 lines)
> Hello,
>
> jgart <jgart@dismail.de> writes:
>
> > On Tue, 12 Apr 2022 12:15:27 +0000 Guillaume Le Vaillant <glv@posteo.net> wrote:
> >> jgart <jgart@dismail.de> skribis:
> >>
> >> > On Sat, 09 Apr 2022 18:31:38 -0400 jgart <jgart@dismail.de> wrote:
> >> >
> >> > And that sbcl-clm and cl-clm are now in Guix 'R Us:
> >> >
> >> > https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/lisp.scm#L2371
> >>
> >> After entering the :clm package and trying some simple examples using the
> >> "v.ins" instrument, it failed because of some missing ".so" shared library.
> >> Does it work for you?
> >
> > It fails because of the missing ".so" shared library for me also.
> >
> > Here are some notes from the author of clm:
> >
> > Try this:
> >
> > ```
> > (compile-file "v.ins")
> > (load "v")
> > ```
> >
> > ``
> >> I had also experienced this error when first running `(require :clm)`
> >> in a sbcl repl:
> >
> > It looks like you're running pulse audio and need something from alsa?
> > Maybe it's related to the code that builds sndplay in initmus.lisp.
> > ``
> >
> > The above is from Bill regarding the shared library code.
>
> What is the status of this? Has the effort been abandoned? I'm of the
> opinion that WIP do not belongs to guix-patches, lest reviewers be
> drowned in a sea of unclosable tickets :-). You are welcome to post it
> to guix-devel though, where it will be archived for interested parties
> to pick it up.
>
> Thanks,
>
> Maxim

Maxim,

Feel free to close this for now. I'll prioritize it again when I find the time.

all best,

jgart
M
M
Maxim Cournoyer wrote on 9 Jul 2022 03:38
(name . jgart)(address . jgart@dismail.de)
87bktzm5fn.fsf@gmail.com
Hello,

[...]

Toggle quote (6 lines)
>> What is the status of this? Has the effort been abandoned? I'm of the
>> opinion that WIP do not belongs to guix-patches, lest reviewers be
>> drowned in a sea of unclosable tickets :-). You are welcome to post it
>> to guix-devel though, where it will be archived for interested parties
>> to pick it up.

[...]

Toggle quote (8 lines)
> Maxim,
>
> Feel free to close this for now. I'll prioritize it again when I find the time.
>
> all best,
>
> jgart

Thanks for the heads-up! Closing.

Maxim
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 52045
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch