diff --git a/pkgs/applications/blockchains/bitcoin-knots/default.nix b/pkgs/applications/blockchains/bitcoin-knots/default.nix index 49e97d731593e..03c8c8ba1f82c 100644 --- a/pkgs/applications/blockchains/bitcoin-knots/default.nix +++ b/pkgs/applications/blockchains/bitcoin-knots/default.nix @@ -134,7 +134,7 @@ stdenv.mkDerivation (finalAttrs: { nativeCheckInputs = [ python3 ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; checkFlags = [ "LC_ALL=en_US.UTF-8" diff --git a/pkgs/applications/blockchains/bitcoin/default.nix b/pkgs/applications/blockchains/bitcoin/default.nix index 1c63e4293929b..c78489205a76d 100644 --- a/pkgs/applications/blockchains/bitcoin/default.nix +++ b/pkgs/applications/blockchains/bitcoin/default.nix @@ -172,7 +172,7 @@ stdenv.mkDerivation (finalAttrs: { nativeCheckInputs = [ python3 ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; checkFlags = [ "LC_ALL=en_US.UTF-8" diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 5c9b7a84f8a3f..9b19d5a25a433 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -359,7 +359,7 @@ lib.extendMkDerivation { '' ); - doCheck = args.doCheck or true; + doCheck = args.doCheck or (stdenv.buildPlatform.canExecute stdenv.hostPlatform); checkPhase = args.checkPhase or '' runHook preCheck diff --git a/pkgs/by-name/fe/feedbackd-device-themes/package.nix b/pkgs/by-name/fe/feedbackd-device-themes/package.nix index 6b38b57950226..5542333dad934 100644 --- a/pkgs/by-name/fe/feedbackd-device-themes/package.nix +++ b/pkgs/by-name/fe/feedbackd-device-themes/package.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonOption "validate" (if finalAttrs.doCheck then "enabled" else "disabled")) ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/gs/gsl-lite/package.nix b/pkgs/by-name/gs/gsl-lite/package.nix index 8a916de95881d..3445d79d17b5d 100644 --- a/pkgs/by-name/gs/gsl-lite/package.nix +++ b/pkgs/by-name/gs/gsl-lite/package.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation (finalAttrs: { ]; # Building tests is broken on Darwin. - doCheck = !stdenv.hostPlatform.isDarwin; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform && !stdenv.hostPlatform.isDarwin; meta = { description = "Single-file header-only version of ISO C++ GSL"; diff --git a/pkgs/by-name/gz/gz-cmake/package.nix b/pkgs/by-name/gz/gz-cmake/package.nix index c5995dae8250e..09afbf0851bbc 100644 --- a/pkgs/by-name/gz/gz-cmake/package.nix +++ b/pkgs/by-name/gz/gz-cmake/package.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: { nativeCheckInputs = [ python3 ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; # Extract the version by matching the tag's prefix. passthru.updateScript = nix-update-script { diff --git a/pkgs/by-name/in/iniparser/package.nix b/pkgs/by-name/in/iniparser/package.nix index d467ca2834487..53e24461b300c 100644 --- a/pkgs/by-name/in/iniparser/package.nix +++ b/pkgs/by-name/in/iniparser/package.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeBool "BUILD_TESTING" finalAttrs.doCheck) ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; nativeCheckInputs = [ ruby ctestCheckHook diff --git a/pkgs/by-name/li/libvncserver/package.nix b/pkgs/by-name/li/libvncserver/package.nix index 85e83d0b04606..f518c3731e0e2 100644 --- a/pkgs/by-name/li/libvncserver/package.nix +++ b/pkgs/by-name/li/libvncserver/package.nix @@ -69,7 +69,7 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; - doCheck = enableShared; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform && enableShared; meta = with lib; { description = "VNC server library"; diff --git a/pkgs/by-name/nl/nlopt/package.nix b/pkgs/by-name/nl/nlopt/package.nix index 5a78662322e86..8962187b46c64 100644 --- a/pkgs/by-name/nl/nlopt/package.nix +++ b/pkgs/by-name/nl/nlopt/package.nix @@ -130,7 +130,7 @@ clangStdenv.mkDerivation (finalAttrs: { --no-directory-urls ''; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; postFixup = '' substituteInPlace $out/lib/cmake/nlopt/NLoptLibraryDepends.cmake --replace-fail \ diff --git a/pkgs/by-name/so/sobjectizer/package.nix b/pkgs/by-name/so/sobjectizer/package.nix index e46c47baafabf..4bc4817b2fb92 100644 --- a/pkgs/by-name/so/sobjectizer/package.nix +++ b/pkgs/by-name/so/sobjectizer/package.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation (finalAttrs: { ]; # The tests require the shared library thanks to the patch. - doCheck = withShared; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform && withShared; # Receive semi-automated updates. passthru.updateScript = pkgs.nix-update-script { }; diff --git a/pkgs/by-name/tp/tpm2-pkcs11/package.nix b/pkgs/by-name/tp/tpm2-pkcs11/package.nix index 233f578d6596e..d2b8cd2ad0774 100644 --- a/pkgs/by-name/tp/tpm2-pkcs11/package.nix +++ b/pkgs/by-name/tp/tpm2-pkcs11/package.nix @@ -158,7 +158,7 @@ chosenStdenv.mkDerivation (finalAttrs: { "dev" ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; dontStrip = true; dontPatchELF = true; diff --git a/pkgs/by-name/z3/z3/package.nix b/pkgs/by-name/z3/z3/package.nix index 8dca36473acea..8f8649591b852 100644 --- a/pkgs/by-name/z3/z3/package.nix +++ b/pkgs/by-name/z3/z3/package.nix @@ -103,7 +103,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "Z3_JAVA_JAR_INSTALLDIR" "${placeholder "java"}/share/java") ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; checkPhase = '' runHook preCheck diff --git a/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix b/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix index b9e622b9f31e1..42478dc98ebc8 100644 --- a/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix +++ b/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix @@ -99,7 +99,7 @@ stdenv.mkDerivation (finalAttrs: { nlohmann_json ]; - doCheck = true; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; postInstall = optionalString finalAttrs.doCheck '' moveToOutput "bin/legacy_samples" "$legacy_samples" diff --git a/pkgs/tools/system/nvtop/build-nvtop.nix b/pkgs/tools/system/nvtop/build-nvtop.nix index 79721da656b43..81d5ce47cf932 100644 --- a/pkgs/tools/system/nvtop/build-nvtop.nix +++ b/pkgs/tools/system/nvtop/build-nvtop.nix @@ -90,7 +90,7 @@ stdenv.mkDerivation (finalAttrs: { + (lib.optionalString nvidia "addDriverRunpath $out/bin/nvtop"); # https://github.com/Syllo/nvtop/commit/33ec008e26a00227a666ccb11321e9971a50daf8 - doCheck = !stdenv.hostPlatform.isDarwin; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform && !stdenv.hostPlatform.isDarwin; passthru = { tests.version = testers.testVersion {