tree-sitter: embed path to emcc
so tree-sitter build --wasm
works
This commit is contained in:
parent
234e847ba2
commit
4852095139
|
@ -9,6 +9,7 @@
|
||||||
, Security
|
, Security
|
||||||
, callPackage
|
, callPackage
|
||||||
, linkFarm
|
, linkFarm
|
||||||
|
, substitute
|
||||||
, CoreServices
|
, CoreServices
|
||||||
, enableShared ? !stdenv.hostPlatform.isStatic
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
||||||
, enableStatic ? stdenv.hostPlatform.isStatic
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||||
|
@ -117,6 +118,13 @@ rustPlatform.buildRustPackage {
|
||||||
[ which ]
|
[ which ]
|
||||||
++ lib.optionals webUISupport [ emscripten ];
|
++ lib.optionals webUISupport [ emscripten ];
|
||||||
|
|
||||||
|
patches = lib.optionals webUISupport [
|
||||||
|
(substitute {
|
||||||
|
src = ./fix-paths.patch;
|
||||||
|
substitutions = [ "--subst-var-by" "emcc" "${emscripten}/bin/emcc" ];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
postPatch = lib.optionalString (!webUISupport) ''
|
postPatch = lib.optionalString (!webUISupport) ''
|
||||||
# remove web interface
|
# remove web interface
|
||||||
sed -e '/pub mod playground/d' \
|
sed -e '/pub mod playground/d' \
|
||||||
|
|
13
pkgs/development/tools/parsing/tree-sitter/fix-paths.patch
Normal file
13
pkgs/development/tools/parsing/tree-sitter/fix-paths.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs
|
||||||
|
index 9c1d8dfc..a5cfc74c 100644
|
||||||
|
--- a/cli/loader/src/lib.rs
|
||||||
|
+++ b/cli/loader/src/lib.rs
|
||||||
|
@@ -747,7 +747,7 @@ impl Loader {
|
||||||
|
Podman,
|
||||||
|
}
|
||||||
|
|
||||||
|
- let emcc_name = if cfg!(windows) { "emcc.bat" } else { "emcc" };
|
||||||
|
+ let emcc_name = if cfg!(windows) { "emcc.bat" } else { "@emcc@" };
|
||||||
|
|
||||||
|
// Order of preference: emscripten > docker > podman > error
|
||||||
|
let source = if !force_docker && Command::new(emcc_name).output().is_ok() {
|
Loading…
Reference in New Issue
Block a user