tree-sitter: make shared/static libraries configurable
This commit is contained in:
parent
562eaafd36
commit
aea7f1b540
@ -3,6 +3,8 @@
|
|||||||
, writeShellScript, runCommand, which
|
, writeShellScript, runCommand, which
|
||||||
, rustPlatform, jq, nix-prefetch-git, xe, curl, emscripten
|
, rustPlatform, jq, nix-prefetch-git, xe, curl, emscripten
|
||||||
, callPackage
|
, callPackage
|
||||||
|
, enableShared ? true
|
||||||
|
, enableStatic ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO: move to carnix or https://github.com/kolloch/crate2nix
|
# TODO: move to carnix or https://github.com/kolloch/crate2nix
|
||||||
@ -69,8 +71,9 @@ in rustPlatform.buildRustPackage {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
export PREFIX=$out
|
PREFIX=$out make install
|
||||||
make install
|
${lib.optionalString (!enableShared) "rm $out/lib/*.so{,.*}"}
|
||||||
|
${lib.optionalString (!enableStatic) "rm $out/lib/*.a"}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# test result: FAILED. 120 passed; 13 failed; 0 ignored; 0 measured; 0 filtered out
|
# test result: FAILED. 120 passed; 13 failed; 0 ignored; 0 measured; 0 filtered out
|
||||||
|
@ -286,6 +286,11 @@ in {
|
|||||||
|
|
||||||
libexecinfo = super.libexecinfo.override { enableShared = false; };
|
libexecinfo = super.libexecinfo.override { enableShared = false; };
|
||||||
|
|
||||||
|
tree-sitter = super.tree-sitter.override {
|
||||||
|
enableShared = false;
|
||||||
|
enableStatic = true;
|
||||||
|
};
|
||||||
|
|
||||||
xorg = super.xorg.overrideScope' (xorgself: xorgsuper: {
|
xorg = super.xorg.overrideScope' (xorgself: xorgsuper: {
|
||||||
libX11 = xorgsuper.libX11.overrideAttrs (attrs: {
|
libX11 = xorgsuper.libX11.overrideAttrs (attrs: {
|
||||||
depsBuildBuild = attrs.depsBuildBuild ++ [ (self.buildPackages.stdenv.cc.libc.static or null) ];
|
depsBuildBuild = attrs.depsBuildBuild ++ [ (self.buildPackages.stdenv.cc.libc.static or null) ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user