Skip to content
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

oniguruma: set CMake flags for static builds #75950

Closed
wants to merge 2 commits into from
Closed

oniguruma: set CMake flags for static builds #75950

wants to merge 2 commits into from

Conversation

gustavderdrache
Copy link
Contributor

Motivation for this change

This change makes it possible to build oniguruma statically, based on what I found in the CMakeLists.txt. Ultimately this unblocks my building PHP 7.4 statically (since multibyte support requires oniguruma now).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@@ -243,4 +243,6 @@ in {
) super.ocaml-ng;

python27 = super.python27.override { static = true; };

oniguruma = super.oniguruma.overrideAttrs (_: { cmakeFlags = ["-DBUILD_SHARED_LIBS=OFF"]; });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is more standard for these sort of per-package overrides to be documented in the package definition itself. That said, I'm not certain why these other ones are in here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I thought this was the convention. What's a good model for me to refer to?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically you add an explicit static (or staticOnly) parameter to the package expression. Take a look at brotli, you should be able to copy the flags handling verbatim.

Copy link
Contributor

@tobim tobim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building pkgsStatic.jq works thanks to this.

Copy link
Contributor

@tobim tobim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize this would introduce a lot of rebuilds for the non-static variant too. This PR should target staging now.

@gustavderdrache gustavderdrache changed the base branch from master to staging December 23, 2019 14:37
@gustavderdrache
Copy link
Contributor Author

I've switched to targeting staging, so this should be ready for a re-review.

Copy link
Contributor

@tobim tobim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine from my pov. Maybe someone with commit bits can do a final check?
cc @matthewbauer @nh2

@knedlsepp
Copy link
Member

Related: #76659

@knedlsepp
Copy link
Member

Since #76659 was merged (to staging), I don't think this is needed anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants