Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5808,18 +5808,23 @@ with pkgs;
# example of an error which this fixes
# [Errno 8] Exec format error: './gdk3-scan'
mesonEmulatorHook =
if (!stdenv.buildPlatform.canExecute stdenv.targetPlatform) then
makeSetupHook
{
name = "mesonEmulatorHook";
substitutions = {
crossFile = writeText "cross-file.conf" ''
makeSetupHook
{
name = "mesonEmulatorHook";
substitutions = {
crossFile = writeText "cross-file.conf" ''
[binaries]
exe_wrapper = ${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)}
exe_wrapper = ${lib.escapeShellArg (stdenv.targetPlatform.emulator pkgs)}
'';
};
} ../development/tools/build-managers/meson/emulator-hook.sh
else throw "mesonEmulatorHook has to be in a conditional to check if the target binaries can be executed i.e. (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)";
};
}
# The throw is moved into the `makeSetupHook` derivation, so that its
# outer level, but not its outPath can still be evaluated if the condition
# doesn't hold. This ensures that splicing still can work correctly.
(if (!stdenv.hostPlatform.canExecute stdenv.targetPlatform) then
../development/tools/build-managers/meson/emulator-hook.sh
else
throw "mesonEmulatorHook may only be added to nativeBuildInputs when the target binaries can't be executed; however you are attempting to use it in a situation where ${stdenv.hostPlatform.config} can execute ${stdenv.targetPlatform.config}. Consider only adding mesonEmulatorHook according to a conditional based canExecute in your package expression.");

meson-tools = callPackage ../misc/meson-tools { };

Expand Down