diff --git a/pkgs/applications/misc/visidata/default.nix b/pkgs/applications/misc/visidata/default.nix index 4790d433647e..7cb59e2c8c2b 100644 --- a/pkgs/applications/misc/visidata/default.nix +++ b/pkgs/applications/misc/visidata/default.nix @@ -116,7 +116,7 @@ buildPythonApplication rec { ]; # check phase uses the output bin, which is not possible when cross-compiling - doCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; checkPhase = '' runHook preCheck diff --git a/pkgs/applications/networking/cluster/kaniko/default.nix b/pkgs/applications/networking/cluster/kaniko/default.nix index 2d9136484e22..24779b603511 100644 --- a/pkgs/applications/networking/cluster/kaniko/default.nix +++ b/pkgs/applications/networking/cluster/kaniko/default.nix @@ -29,7 +29,7 @@ buildGoModule rec { doCheck = false; # requires docker, container-diff (unpackaged yet) - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' for shell in bash fish zsh; do $out/bin/executor completion $shell > executor.$shell installShellCompletion executor.$shell diff --git a/pkgs/applications/networking/cluster/kubeshark/default.nix b/pkgs/applications/networking/cluster/kubeshark/default.nix index 27eb93f11824..e8156c872c2c 100644 --- a/pkgs/applications/networking/cluster/kubeshark/default.nix +++ b/pkgs/applications/networking/cluster/kubeshark/default.nix @@ -29,7 +29,7 @@ buildGoModule rec { ''; doCheck = true; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd kubeshark \ --bash <($out/bin/kubeshark completion bash) \ --fish <($out/bin/kubeshark completion fish) \ diff --git a/pkgs/applications/networking/cluster/kubevela/default.nix b/pkgs/applications/networking/cluster/kubevela/default.nix index 75e68b3c1944..b61535492b1e 100644 --- a/pkgs/applications/networking/cluster/kubevela/default.nix +++ b/pkgs/applications/networking/cluster/kubevela/default.nix @@ -40,7 +40,7 @@ buildGoModule rec { ''; nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd vela \ --bash <($out/bin/vela completion bash) \ --zsh <($out/bin/vela completion zsh) diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix index c2c8f98251b6..e999c27cfb09 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix @@ -117,7 +117,7 @@ let --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" ''; - doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; # In particular, this detects missing python imports in some of the tools. postFixup = let # TODO: python is a script, so it doesn't work as interpreter on darwin diff --git a/pkgs/applications/networking/instant-messengers/utox/default.nix b/pkgs/applications/networking/instant-messengers/utox/default.nix index 706904a8dd2c..259735919cd5 100644 --- a/pkgs/applications/networking/instant-messengers/utox/default.nix +++ b/pkgs/applications/networking/instant-messengers/utox/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { "-DENABLE_TESTS=${if doCheck then "ON" else "OFF"}" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; nativeCheckInputs = [ check ]; meta = with lib; { diff --git a/pkgs/applications/office/kmymoney/default.nix b/pkgs/applications/office/kmymoney/default.nix index a910d76b29c9..86547c638dfa 100644 --- a/pkgs/applications/office/kmymoney/default.nix +++ b/pkgs/applications/office/kmymoney/default.nix @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { "kmymoney/plugins/woob/interface/kmymoneywoob.py" ''; - doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; nativeInstallCheckInputs = [ xvfb-run ]; installCheckPhase = lib.optionalString doInstallCheck '' diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix index 9443c1e9cdea..a00cc8e78cc7 100644 --- a/pkgs/applications/version-management/fossil/default.nix +++ b/pkgs/applications/version-management/fossil/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; configureFlags = lib.optional (!withInternalSqlite) "--disable-internal-sqlite" diff --git a/pkgs/by-name/ei/eiwd/package.nix b/pkgs/by-name/ei/eiwd/package.nix index c2d54101db63..281837fd4bd4 100644 --- a/pkgs/by-name/ei/eiwd/package.nix +++ b/pkgs/by-name/ei/eiwd/package.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; # override this to false if you don't want to build python3 - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; # prevent the `install-data-local` Makefile rule from running; # all it does is attempt to `mkdir` the `localstatedir`. diff --git a/pkgs/by-name/gl/glab/package.nix b/pkgs/by-name/gl/glab/package.nix index c0a321858f0e..444f916bb7be 100644 --- a/pkgs/by-name/gl/glab/package.nix +++ b/pkgs/by-name/gl/glab/package.nix @@ -28,7 +28,7 @@ buildGo123Module rec { nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' make manpage installManPage share/man/man1/* installShellCompletion --cmd glab \ diff --git a/pkgs/by-name/ma/mangal/package.nix b/pkgs/by-name/ma/mangal/package.nix index c1d7c1540508..332c1d33ec25 100644 --- a/pkgs/by-name/ma/mangal/package.nix +++ b/pkgs/by-name/ma/mangal/package.nix @@ -26,7 +26,7 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' # Mangal creates a config file in the folder ~/.config/mangal and fails if not possible export HOME=$(mktemp -d) installShellCompletion --cmd mangal \ diff --git a/pkgs/by-name/mt/mtdutils/package.nix b/pkgs/by-name/mt/mtdutils/package.nix index 15359970cfca..3347739d81c3 100644 --- a/pkgs/by-name/mt/mtdutils/package.nix +++ b/pkgs/by-name/mt/mtdutils/package.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { makeFlags = [ "AR:=$(AR)" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; outputs = [ "out" diff --git a/pkgs/by-name/ve/velero/package.nix b/pkgs/by-name/ve/velero/package.nix index 65934fb56b8c..357c68d3c8c7 100644 --- a/pkgs/by-name/ve/velero/package.nix +++ b/pkgs/by-name/ve/velero/package.nix @@ -31,7 +31,7 @@ buildGoModule rec { ''; nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' $out/bin/velero completion bash > velero.bash $out/bin/velero completion zsh > velero.zsh installShellCompletion velero.{bash,zsh} diff --git a/pkgs/by-name/ze/zerotierone/package.nix b/pkgs/by-name/ze/zerotierone/package.nix index 728ec4ee3c37..3252cce49d60 100644 --- a/pkgs/by-name/ze/zerotierone/package.nix +++ b/pkgs/by-name/ze/zerotierone/package.nix @@ -115,7 +115,7 @@ in stdenv.mkDerivation { buildFlags = [ "all" "selftest" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; checkPhase = '' runHook preCheck ./zerotier-selftest diff --git a/pkgs/development/libraries/bencodetools/default.nix b/pkgs/development/libraries/bencodetools/default.nix index 7a826efa7ef7..b6a9ab68dda0 100644 --- a/pkgs/development/libraries/bencodetools/default.nix +++ b/pkgs/development/libraries/bencodetools/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation { ]; # installCheck instead of check due to -install_name'd library on Darwin - doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; installCheckTarget = "check"; meta = with lib; { diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index b0ccaeeb45fb..28a08cb0d2f5 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -840,7 +840,7 @@ stdenv.mkDerivation (finalAttrs: { ]; }; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; # Fails with SIGABRT otherwise FIXME: Why? checkPhase = let diff --git a/pkgs/development/libraries/flatbuffers/23.nix b/pkgs/development/libraries/flatbuffers/23.nix index 5263694b0562..4e30c3dd37b6 100644 --- a/pkgs/development/libraries/flatbuffers/23.nix +++ b/pkgs/development/libraries/flatbuffers/23.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; checkTarget = "test"; meta = with lib; { diff --git a/pkgs/development/libraries/flatbuffers/default.nix b/pkgs/development/libraries/flatbuffers/default.nix index 00bb9cc8d187..58ea13a50b92 100644 --- a/pkgs/development/libraries/flatbuffers/default.nix +++ b/pkgs/development/libraries/flatbuffers/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; checkTarget = "test"; meta = with lib; { diff --git a/pkgs/development/libraries/minizip-ng/default.nix b/pkgs/development/libraries/minizip-ng/default.nix index b15997cb436b..ffc6665af42a 100644 --- a/pkgs/development/libraries/minizip-ng/default.nix +++ b/pkgs/development/libraries/minizip-ng/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: { fi ''; - doCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; nativeCheckInputs = [ gtest ]; enableParallelChecking = false; diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix index 339db2bb0879..d690cc45b2f9 100644 --- a/pkgs/development/libraries/nlohmann_json/default.nix +++ b/pkgs/development/libraries/nlohmann_json/default.nix @@ -29,7 +29,7 @@ in stdenv.mkDerivation (finalAttrs: { "-DJSON_MultipleHeaders=ON" ] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}"; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; # skip tests that require git or modify “installed files” preCheck = '' diff --git a/pkgs/development/libraries/tpm2-tss/default.nix b/pkgs/development/libraries/tpm2-tss/default.nix index 79abe0f827b8..c1f3aeb7a34a 100644 --- a/pkgs/development/libraries/tpm2-tss/default.nix +++ b/pkgs/development/libraries/tpm2-tss/default.nix @@ -87,7 +87,7 @@ stdenv.mkDerivation rec { ''; doCheck = false; - doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; # Since we rewrote the load path in the dynamic loader for the TCTI # The various tcti implementation should be placed in their target directory # before we could run tests, so we make turn checkPhase into installCheckPhase diff --git a/pkgs/development/libraries/uriparser/default.nix b/pkgs/development/libraries/uriparser/default.nix index dd93f49f5946..370a1dfe4ea9 100644 --- a/pkgs/development/libraries/uriparser/default.nix +++ b/pkgs/development/libraries/uriparser/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { ] ++ lib.optional (!doCheck) "-DURIPARSER_BUILD_TESTS=OFF"; nativeCheckInputs = [ gtest ]; - doCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; meta = with lib; { changelog = "https://github.com/uriparser/uriparser/blob/uriparser-${version}/ChangeLog"; diff --git a/pkgs/development/tools/k6/default.nix b/pkgs/development/tools/k6/default.nix index 291c28c0bf25..48ea4c103f31 100644 --- a/pkgs/development/tools/k6/default.nix +++ b/pkgs/development/tools/k6/default.nix @@ -22,7 +22,7 @@ buildGoModule rec { $out/bin/k6 version | grep ${version} > /dev/null ''; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd k6 \ --bash <($out/bin/k6 completion bash) \ --fish <($out/bin/k6 completion fish) \