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
Fix nix flake for macOS #2595
base: master
Are you sure you want to change the base?
Fix nix flake for macOS #2595
Conversation
🦗 |
Hi, Sorry for the delayed response. @RodolpheFouquet : would you mind having a look at the nix flake part if you have some time? Regarding point 5, it is intended behavior to have the static lib built alongside the dynamic one when doing a standard build. I am reticent to change this for a niche use case (it seems to be ok on nix flake for linux and for non-flake builds). Maybe you can add a workaround to remove/ignore it for this particular case? |
First @niklaskorz, thank you very much for your contribution. Hi, I will have a look later this week. I do not have access to the Mac right now.
Agreed, the default should remain building both libraries as many internal GPAC script (and gpac test infrastructure) relies on this behaviour. I think DISABLE_STATIC shoud be the option, and be set by the flake to only. We could still use a nix build argument to reenable static if needed. |
Can you clarify what these variables in Lines 92 to 94 in 666daf2
If static builds should be enabled by default but with the option to disable them, shouldn't one of these variables (or all of them?) be set to |
@niklaskorz I guess |
these variables control the following switches described in the configure help:
so they all control a different thing than whether or not the static libgpac is built at all, that's why they are all set to I guess adding a |
What's the status here? |
Hi, I am sorry for the delay, I have reviewed the PR and it works, however:
I have tested the PR on NixOS unstable and on MacOS sonoma with Apple silicon. |
gpac/applications/gpac/carbon_hook.c
Line 27 in d5dd620
libgpac_static.a
ifSTATIC_MODULES
is set. Nix prefers dynamic libraries (and actually passes a--disable-static
to configure by default) and the static library adds unnecessary bloat. Furthermore, the presence of the static library seems to break the final binary (both gpac and MP4Box) in the Nix flake output for reasons I don't know yet (crashes immediately with[1] 4966 killed result/bin/gpac
), but with the static library disabled, everything is fine.enableParallelBuilding = true
is defined).