diff mbox series

[bug#52045] gnu: Add cl-clm.

Message ID 87lf1fnh72.fsf@kitej
State Accepted
Headers show
Series [bug#52045] gnu: Add cl-clm. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Guillaume Le Vaillant Nov. 23, 2021, 1 p.m. UTC
jgart <jgart@dismail.de> skribis:

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

Comments

jgart April 9, 2022, 10:18 p.m. UTC | #1
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.


> 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.みんな/
jgart April 9, 2022, 10:31 p.m. UTC | #2
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
jgart April 9, 2022, 10:33 p.m. UTC | #3
On Sat, 09 Apr 2022 18:31:38 -0400 jgart <jgart@dismail.de> wrote:
> 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:

https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/lisp.scm#L2371

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
Guillaume Le Vaillant April 12, 2022, 12:15 p.m. UTC | #4
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?
jgart April 12, 2022, 4:28 p.m. UTC | #5
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.

all best,

jgart
Maxim Cournoyer July 7, 2022, 6:23 p.m. UTC | #6
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
jgart July 8, 2022, 12:16 a.m. UTC | #7
On Thu, 07 Jul 2022 14:23:37 -0400 Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> 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
Maxim Cournoyer July 9, 2022, 1:38 a.m. UTC | #8
Hello,

[...]

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

[...]

> 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
diff mbox series

Patch

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(+)

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