git.iko.soy/typeable/nixpkgs
on master help sign in
tree-sitter: make shared/static libraries configurable
commitaea7f1b5401c6e96b418f67e540ee5779d97fcdc authorNick Hu <me@nickhu.co.uk> dateMon 9 Nov 2020, 18:41 (6 years ago) parent562eaaf
2 files changed+10−2
pkgs/development/tools/parsing/tree-sitter/default.nix+5−2 pkgs/top-level/static.nix+5
pkgs/development/tools/parsing/tree-sitter/default.nix+5−2
@@ -3,6 +3,8 @@
33, writeShellScript, runCommand, which
44, rustPlatform, jq, nix-prefetch-git, xe, curl, emscripten
55, callPackage
6+, enableShared ? true
7+, enableStatic ? false
68}:
79
810# TODO: move to carnix or https://github.com/kolloch/crate2nix
@@ -69,8 +71,9 @@ in rustPlatform.buildRustPackage {
6971 '';
7072
7173 postInstall = ''
72− export PREFIX=$out
73− make install
74+ PREFIX=$out make install
75+ ${lib.optionalString (!enableShared) "rm $out/lib/*.so{,.*}"}
76+ ${lib.optionalString (!enableStatic) "rm $out/lib/*.a"}
7477 '';
7578
7679 # test result: FAILED. 120 passed; 13 failed; 0 ignored; 0 measured; 0 filtered out
pkgs/top-level/static.nix+5
@@ -286,6 +286,11 @@ in {
286286
287287 libexecinfo = super.libexecinfo.override { enableShared = false; };
288288
289+ tree-sitter = super.tree-sitter.override {
290+ enableShared = false;
291+ enableStatic = true;
292+ };
293+
289294 xorg = super.xorg.overrideScope' (xorgself: xorgsuper: {
290295 libX11 = xorgsuper.libX11.overrideAttrs (attrs: {
291296 depsBuildBuild = attrs.depsBuildBuild ++ [ (self.buildPackages.stdenv.cc.libc.static or null) ];