unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Théo Tyburn" <theo.tyburn@posteo.net>
To: guix-devel@gnu.org
Subject: Help Packaging Incudine (Common Lisp)
Date: Tue, 26 Sep 2023 20:31:10 +0000	[thread overview]
Message-ID: <871qekptft.fsf@posteo.net> (raw)

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


             reply	other threads:[~2023-09-26 22:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 20:31 Théo Tyburn [this message]
2023-09-28 12:23 ` Help Packaging Incudine (Common Lisp) 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qekptft.fsf@posteo.net \
    --to=theo.tyburn@posteo.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).