From a7174a05015ea94a3e6fcbfdcbc86a925e553eba Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Wed, 10 Jun 2026 16:44:29 -0700 Subject: [PATCH] Fixes building of native module with Yocto or Buildroot Signed-off-by: Joel Winarske --- hook/build.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hook/build.dart b/hook/build.dart index 9e40174..b839f26 100644 --- a/hook/build.dart +++ b/hook/build.dart @@ -19,8 +19,15 @@ void main(List args) async { await build(args, (input, output) async { if (!input.config.buildCodeAssets) return; - if (Platform.environment.containsKey('SKIP_NATIVE_BUILD')) { - stderr.writeln('SKIP_NATIVE_BUILD set — skipping native build.'); + // Allow the embedder/build system to suppress the in-hook native build via + // a hooks user-define (e.g. an OpenEmbedded/Yocto recipe that builds + // libappstream.so itself with the cross toolchain). Dart runs hooks in a + // hermetic environment, so an environment variable would not reach here; + // user-defines from the workspace pubspec.yaml are passed to hooks. + if (input.userDefines['skip_native_build'] == true) { + stderr.writeln( + 'skip_native_build user-define set — skipping native build.', + ); return; }