diff options
Diffstat (limited to 'pkgs/games/anki/patches/0002-Allow-setting-YARN_BINARY-for-the-build-system.patch')
-rw-r--r-- | pkgs/games/anki/patches/0002-Allow-setting-YARN_BINARY-for-the-build-system.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/games/anki/patches/0002-Allow-setting-YARN_BINARY-for-the-build-system.patch b/pkgs/games/anki/patches/0002-Allow-setting-YARN_BINARY-for-the-build-system.patch new file mode 100644 index 00000000000..1dbba76ae08 --- /dev/null +++ b/pkgs/games/anki/patches/0002-Allow-setting-YARN_BINARY-for-the-build-system.patch @@ -0,0 +1,36 @@ +From 16af7d4cabcf10797bd110c905a9d7694bde0fb4 Mon Sep 17 00:00:00 2001 +From: Euan Kemp <euank@euank.com> +Date: Fri, 17 Mar 2023 23:07:05 +0900 +Subject: [PATCH 2/2] Allow setting YARN_BINARY for the build system + +--- + build/ninja_gen/src/node.rs | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/build/ninja_gen/src/node.rs b/build/ninja_gen/src/node.rs +index d08c7011e..c1e2ce1b3 100644 +--- a/build/ninja_gen/src/node.rs ++++ b/build/ninja_gen/src/node.rs +@@ -129,7 +129,18 @@ pub fn setup_node( + let node_binary = build.expand_inputs(node_binary); + build.variable("node_binary", &node_binary[0]); + +- build.add("yarn", YarnSetup {})?; ++ match std::env::var("YARN_BINARY") { ++ Ok(path) => { ++ assert!( ++ Utf8Path::new(&path).is_absolute(), ++ "YARN_BINARY must be absolute" ++ ); ++ build.add_resolved_files_to_group("yarn:bin", &vec![path]); ++ }, ++ Err(_) => { ++ build.add("yarn", YarnSetup {})?; ++ }, ++ }; + + for binary in binary_exports { + data_exports.insert( +-- +2.39.2 + |