-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle bindings for dynamically linked libraries #11
Comments
Absolutely. Could you suggest some manifest.json properties, and maybe write up some examples? |
So here's a basic example of what I think could work on every platform (with some tweaks). The way I see it, we can either provide the static libs ourselves - which means we would need to compile each and every one of them for every platform, or we can provide the means for the user to statically compile them on their own. I think it is quite ok to provide the static libs ourselves since it would improve the user experience of the package manager. It would be so easy to grab a dependency and use it! {
"provides": [
{
"name": "raylib",
"version": "1.2.3",
"source": {
"url": "github.com/raylib/raylib/releases/release-1.2.3.tar.gz",
"checksum": "sha256:abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234"
},
"bundled": {
"static": true
},
"requires": {
"c3c": "0.6.1"
}
}
],
"targets": {
"macos-x64": {
...
},
"macos-aarch64": {
...
},
"linux-x64": {
...
},
"windows-x64": {
...
}
}
} Alas, it could prove quite challenging to provide static libs for every platform imaginable ... but it is not impossible. I think that in this repo, we can leave only the bindings themselves. We can store the recipes and the compiled static libs somewhere else. In another repo, we can use Nix to provide a reproducible and easily upgradeable environment to write the recipes for compiling the static libs. The resulting static libs we can store in an archive/cdn/s3/etc. Unfortunately, Nix only solves Linux (x64, aarch64) and MacOs(x64, aarch64); does not work for Windows. I haven't used Windows in years, but I presume we can use a separate build system for it. So, to conclude, what I propose is:
And of course, I'm open to collaborate together on this in order to bring the world the great gift that is C3. |
Hmm.. this can be done in several ways. I'm considering ways to declare both static and dynamic libraries in the same manifest.json, but it seems like one of those things that work nicely in theory but isn't great in practice – because you need to know all the switches. So what if we did something that didn't need anything: For a library that has both static and dynamic variants, release something like All of this in an easy parseable format, so say you use the dynamic raylib, and you use curl. Both of them list dynamic library dependencies:
You could then also possibly have some instructions to each .c3l:
What do you think? |
Working on a little something with raylib and c3 and the current bindings are great.
Bundling static libs and bindings together is pretty good in the matter of stable bindings, but not so great with dynamic libraries.
I think that, in order to improve both dynamic libraries and static libs we should probably consider improving the manifest file to be more descriptive. Thinking about it, here are my ideas:
The suggestions above would improve packaging of the bindings in distros since it would be clear what the dependencies are.
The text was updated successfully, but these errors were encountered: