I'm writing Raku bindings to a C library, but rather than require the users of the Raku code to install the C library on their own, I'd like to bundle the C code as part of the distribution (it's not such a widely distributed library).
I've read about a distribution's %?RESOURCES
, and that seems like it would be useful. But I'm hazy on the specifics of how to apply it for this.
Can I bundle the C source code in the distribution, and specify some way for it to get compiled as part of the installation (eg. with zef
)? Or would I need to bundle precompiled versions of the library, and get the code to choose the right one depending on the platform?
Or is this simply impossible, and I should just give users instructions on how to install the library separately?
It's possible, and there exists a module LibraryMake to ease the process.
For an example of a module using it, see Digest::SHA1::Native.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With