garnet/cabal.project
George Thomas 0a1911862f Expose explicit C interface
We drop the tools specifically designed for Haskell and Rust together, in favour of general tools for using each with C.

Namely, we use Mozilla's `cbindgen` for generating header files from the Rust source, and Well-Typed's new `hs-bindgen` tool for generating Haskell from those header files.

The Rust code here is essentially the result of expanding the old macro, then inlining and renaming internals.

The most important thing here is that we're now relying solely on robust well-maintained tools.
2026-02-19 16:29:41 +00:00

32 lines
991 B
Plaintext

packages: haskell
-- TODO a total hack
package garnet
extra-lib-dirs:
/home/gthomas/code/garnet/rust/target/release
/home/gthomas/code/garnet/rust/target/debug
extra-include-dirs:
/home/gthomas/code/garnet/rust
-- https://well-typed.com/blog/2026/02/hs-bindgen-alpha
-- Haskell.nix doesn't seem to like `tag: release-0.1-alpha`, which the blog post suggests
-- so we specify the equivalent commit SHAs manually instead
source-repository-package
type: git
location: https://github.com/well-typed/hs-bindgen
tag: e2a9260678d9fa76dab602a5a07927acada3be4f
subdir: c-expr-dsl c-expr-runtime hs-bindgen hs-bindgen-runtime
--sha256: 0nrs3iq0l5ha5kxyhqnlmvgi7734pmzyp3zf7p8s1gb21ylh4sy0
source-repository-package
type: git
location: https://github.com/well-typed/libclang
tag: b5ff712c91c039cde6720ffe2096a121d9f4d802
--sha256: 1lwjdxd2ahhkvyxrpli7z9z7ss4l94m2jaif8kg1i2yygbhksrb3
allow-newer:
*:base,
*:containers,
*:template-haskell,
*:text,
*:time,