Merge pull request #301336 from philiptaron/tree-sitter-webUI
tree-sitter: embed path to `emcc` so that `build --wasm` works
This commit is contained in:
commit
51b4ffe7f3
|
@ -9,6 +9,7 @@
|
|||
, Security
|
||||
, callPackage
|
||||
, linkFarm
|
||||
, substitute
|
||||
, CoreServices
|
||||
, enableShared ? !stdenv.hostPlatform.isStatic
|
||||
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||
|
@ -117,6 +118,13 @@ rustPlatform.buildRustPackage {
|
|||
[ which ]
|
||||
++ 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) ''
|
||||
# remove web interface
|
||||
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