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.
cargo is not a general packaging tool. It does not have the ability to build and install a full distribution of your source code.
All it can do is build Rust and put that into its configured directiory. The rest is left up to the user.
For your usecase you would probably build distribution-specific packages (think *.deb or *.rpm, ...)
because that will easily become a whole 'nother order of complexity, and noone is willing to take that on.
You're not the first one asking for it (e.g. see this 9 year old issue), you probably won't be the last.
There's other dedicated tools that can do proper packaging, e.g. cargo-deb or cargo-dist.