Le 15/07/2017 à 01:17, Matt Wette a écrit :
Hi All,
I am working on a ffi-helper: a program that will read in a C dot-h file and
generate a Guile dot-scm file which
defines a module to provide hooks into the associated C library. My goal is to
have something to release ~Oct 2017.
I am looking for suggestions for libraries (w/ includes of course) to use as
test cases to flush-out and debug my code. I have worked on cairo and now
working on gdbm. I tried git2 but those headers are too broken.
If you have suggestions for test cases, please post. They should be commonly
used.
(I use MacPorts and would want them to be installable in that context.)
Status:
I have now been able to compile-ffi the following on my Mac. I’m sure bugs
remain.
(define-ffi-module (cairo cairo)
#:pkg-config "cairo"
#:include '(“cairo.h" "cairo-pdf.h" "cairo-svg.h")
;; the following are bent pipe to scm-module
#:export (make-cairo-unit-matrix)
)
(define (make-cairo-unit-matrix)
(make-cairo_matrix_t #(1.0 0.0 0.0 1.0 0.0 0.0)))
I convert the above “cairo.ffi” file to “cairo.scm” using the following command
mwette$ guild compile-ffi cairo/cairo.ffi
Can you provide guidance regarding how to run compile-ffi, here what
I've done so far:
$ git clone https://git.savannah.nongnu.org/git/nyacc.git
$ cd nyacc
$ git checkout c99dev
$ cd examples/nyacc/lang/c99
$ source env.sh
Then:
$ guild compile-ffi cairo/cairo.ffi
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling /home/amirouche/.guix-profile/bin/guild
;;; compiled
/home/amirouche/.cache/guile/ccache/2.2-LE-8-3.A/gnu/store/1pzfigry5bnh3n146w0ib77vkd2g6jdc-guile-2.2.2/bin/guild.go
guild: unknown script "compile-ffi"
Try `guild help' for more information.
I have guile-bytestructures
Thanks!