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

zstd: add static option #72069

Closed
wants to merge 2 commits into from
Closed

zstd: add static option #72069

wants to merge 2 commits into from

Conversation

tobim
Copy link
Contributor

@tobim tobim commented Oct 27, 2019

CMake is used for static builds because the Makefile does not
offer a way to disable the shared library.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 @orivej

CMake is used for static builds because the Makefile does not
offer a way to disable the shared library.
@c0bw3b
Copy link
Contributor

c0bw3b commented Oct 31, 2019

Isn't it possible to build both shared & static in one common multi-outputs derivation (with CMake) ; and then install static lib in "static" output ?

@tobim
Copy link
Contributor Author

tobim commented Oct 31, 2019

The regular Makefile based build already builds libzstd as shared object and static library in the same tree. A separate static output would be very unusual, almost no other package does that.

The purpose of this PR is mostly to get zstd to build in the pkgsStatic set, where position independent code is disabled and shared libraries don't link.

@@ -59,4 +60,15 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
maintainers = with maintainers; [ orivej ];
};
}
} // stdenv.lib.optionalAttrs static {
nativeBuildInputs = [ cmake ];
Copy link
Member

Choose a reason for hiding this comment

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

It would be good if we can use cmake on non-static as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the second commit.

@tobim
Copy link
Contributor Author

tobim commented Jan 3, 2020

superseded by #75798.

@tobim tobim closed this Jan 3, 2020
@tobim tobim deleted the pkgsStatic/zstd branch January 3, 2020 22:27
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

3 participants