all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help Packaging Incudine (Common Lisp)
@ 2023-09-26 20:31 Théo Tyburn
  2023-09-28 12:23 ` Théo Tyburn
  2023-09-28 14:20 ` Théo Tyburn
  0 siblings, 2 replies; 9+ messages in thread
From: Théo Tyburn @ 2023-09-26 20:31 UTC (permalink / raw)
  To: guix-devel

Hi there,

I'm trying to package Incudine, a Music/DSP programming environment for
Common Lisp. I'm stuck with the binding of libsndfile. First
libsndfile.so could not be found, but I fixed the paths like it is
commonly done in other CL packages. Next problem is that somehow the
bindings are not working. The error I get:

> file: /gnu/store/s2657snmavhsnqyr0hf6f8a2v1lvrln2-sbcl-incudine-0.0.0-1.21c99e4/share/common-lisp/sbcl/incudine/contrib/cl-sndfile/cffi-sndfile.lisp
> in: DEFUN MAKE-SNDINFO
>     (CFFI:FOREIGN-TYPE-SIZE '(:STRUCT SNDFILE:INFO))
> 
> caught WARNING:
>   Error during compiler-macroexpansion of
>   (CFFI:FOREIGN-TYPE-SIZE '(:STRUCT INFO)). Use *BREAK-ON-SIGNALS* to intercept.
>   
>    Unknown CFFI type (:STRUCT INFO)

Now in the source file `cffi-sndfile.lisp`, there is:

> (declaim (inline make-sndinfo))
> (defun make-sndinfo (&optional pointer)
>   (%make-sndinfo
>     :pointer (or pointer
>                  (cffi:foreign-alloc :int8
>                    :count (cffi:foreign-type-size '(:struct info))
>                    :initial-element 0))))
> 
> [...]
> 
> (cffi:defcstruct info
>   (frames sf-count)
>   (sample-rate :int)
>   (channels :int)
>   (format :int)
>   (sections :int)
>   (seekable :int))

If I look at the source `sndfile.h` (which is present in source/.cl-union)
there is:

> struct SF_INFO
> {	sf_count_t	frames ;		/* Used to be called samples.  Changed to avoid confusion. */
> 	int			samplerate ;
> 	int			channels ;
> 	int			format ;
> 	int			sections ;
> 	int			seekable ;
> } ;

So things look like they should match. Is there something I'm missing
here? I have 0 experience with CFFI bindings, so there might be
something obvious I'm missing.

Cheers

Théo


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

end of thread, other threads:[~2023-10-24 20:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26 20:31 Help Packaging Incudine (Common Lisp) Théo Tyburn
2023-09-28 12:23 ` Théo Tyburn
2023-09-29  4:29   ` Liliana Marie Prikler
2023-09-30 13:31     ` Théo Tyburn
2023-10-22 12:07       ` Guillaume Le Vaillant
2023-10-22 14:15         ` Théo Tyburn
2023-10-23  8:44           ` Guillaume Le Vaillant
2023-10-24 20:25             ` Théo Tyburn
2023-09-28 14:20 ` Théo Tyburn

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.