Installation of a C-FFI library

⚓ Rust    📅 2025-11-03    👤 surdeus    👁️ 6      

surdeus

hi there,

I've created a little Rust crate that exposes a subset of the Typst package to C (so I can call that from Go and daktilo).

So far so good: I can copy the .a and .h files somewhere and make Go compile against those.
But I wanted to provide a better user experience: is there a way to instruct Cargo to install these files somewhere ?

I tried to create a "fake" task:

that compiles the C-FFI library, copies the needed files somewhere and generate a pkg-config metadata file.

That works but one still needs to clone the repository and call cargo install-cffi.

It'd be great to have just one command to invoke to install .{so,dll,a,h} files somewhere.

did I miss something ?

cheers,
-s

5 posts - 2 participants

Read full topic

🏷️ Rust_feed