From ad5e744714640aad36eda89e6b6026c397b4ace5 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 30 Nov 2023 18:50:59 +0100 Subject: [PATCH] treewide: finalAttrs.doCheck -> finalAttrs.finalPackage.doCheck This will respect `doCheck = false;` overrides, common for cross. --- pkgs/by-name/db/dbus-cpp/package.nix | 2 +- pkgs/by-name/ne/net-cpp/package.nix | 2 +- pkgs/by-name/tr/trealla/package.nix | 2 +- pkgs/desktops/lomiri/development/deviceinfo/default.nix | 2 +- pkgs/desktops/lomiri/development/geonames/default.nix | 4 ++-- pkgs/desktops/lomiri/development/gmenuharness/default.nix | 2 +- pkgs/desktops/lomiri/development/libusermetrics/default.nix | 4 ++-- pkgs/development/libraries/cairo/default.nix | 2 +- pkgs/development/libraries/epoll-shim/default.nix | 2 +- pkgs/development/libraries/glib/default.nix | 2 +- pkgs/development/libraries/hnswlib/default.nix | 4 ++-- pkgs/development/libraries/libayatana-common/default.nix | 2 +- pkgs/development/libraries/libcbor/default.nix | 2 +- pkgs/development/libraries/libqtdbusmock/default.nix | 2 +- pkgs/development/libraries/libqtdbustest/default.nix | 2 +- pkgs/development/libraries/libspatialindex/default.nix | 2 +- pkgs/development/libraries/libuv/default.nix | 2 +- pkgs/development/libraries/minizip-ng/default.nix | 4 ++-- pkgs/development/libraries/msgpack-c/default.nix | 2 +- pkgs/development/libraries/msgpack-cxx/default.nix | 2 +- pkgs/development/libraries/nlohmann_json/default.nix | 4 ++-- pkgs/development/libraries/open62541/default.nix | 2 +- pkgs/development/libraries/poppler/default.nix | 4 ++-- pkgs/development/libraries/properties-cpp/default.nix | 2 +- pkgs/development/libraries/qmenumodel/default.nix | 4 ++-- pkgs/development/libraries/xsimd/default.nix | 2 +- pkgs/development/libraries/xtensor/default.nix | 2 +- pkgs/development/python-modules/xtensor-python/default.nix | 2 +- pkgs/os-specific/linux/libnvme/default.nix | 2 +- pkgs/servers/mir/default.nix | 4 ++-- pkgs/tools/graphics/mangohud/default.nix | 6 +++--- 31 files changed, 41 insertions(+), 41 deletions(-) diff --git a/pkgs/by-name/db/dbus-cpp/package.nix b/pkgs/by-name/db/dbus-cpp/package.nix index 2e834111c9d9..542601e7fb65 100644 --- a/pkgs/by-name/db/dbus-cpp/package.nix +++ b/pkgs/by-name/db/dbus-cpp/package.nix @@ -64,7 +64,7 @@ stdenv.mkDerivation (finalAttrs: { # pkg-config output patching hook expects prefix variable here substituteInPlace data/dbus-cpp.pc.in \ --replace 'includedir=''${exec_prefix}' 'includedir=''${prefix}' - '' + lib.optionalString (!finalAttrs.doCheck) '' + '' + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt ''; diff --git a/pkgs/by-name/ne/net-cpp/package.nix b/pkgs/by-name/ne/net-cpp/package.nix index d123e5bea2ec..3397d7820ce3 100644 --- a/pkgs/by-name/ne/net-cpp/package.nix +++ b/pkgs/by-name/ne/net-cpp/package.nix @@ -64,7 +64,7 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = lib.optionalString finalAttrs.doCheck '' + postPatch = lib.optionalString finalAttrs.finalPackage.doCheck '' # Use wrapped python. Removing just the /usr/bin doesn't seem to work? substituteInPlace tests/httpbin.h.in \ --replace '/usr/bin/python3' '${lib.getExe pythonEnv}' diff --git a/pkgs/by-name/tr/trealla/package.nix b/pkgs/by-name/tr/trealla/package.nix index c8fc25f20696..25786428dfbf 100644 --- a/pkgs/by-name/tr/trealla/package.nix +++ b/pkgs/by-name/tr/trealla/package.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional enableSSL openssl ++ lib.optional (lineEditingLibrary == "readline") readline; - nativeCheckInputs = lib.optionals finalAttrs.doCheck [ valgrind ]; + nativeCheckInputs = lib.optionals finalAttrs.finalPackage.doCheck [ valgrind ]; strictDeps = true; diff --git a/pkgs/desktops/lomiri/development/deviceinfo/default.nix b/pkgs/desktops/lomiri/development/deviceinfo/default.nix index 04abf4f88f46..00ba1d864bf6 100644 --- a/pkgs/desktops/lomiri/development/deviceinfo/default.nix +++ b/pkgs/desktops/lomiri/development/deviceinfo/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - "-DDISABLE_TESTS=${lib.boolToString (!finalAttrs.doCheck)}" + "-DDISABLE_TESTS=${lib.boolToString (!finalAttrs.finalPackage.doCheck)}" ]; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; diff --git a/pkgs/desktops/lomiri/development/geonames/default.nix b/pkgs/desktops/lomiri/development/geonames/default.nix index ee4a3b77b72b..8fc5a65b72ff 100644 --- a/pkgs/desktops/lomiri/development/geonames/default.nix +++ b/pkgs/desktops/lomiri/development/geonames/default.nix @@ -73,7 +73,7 @@ stdenv.mkDerivation (finalAttrs: { ]; # Tests need to be able to check locale - LC_ALL = lib.optionalString finalAttrs.doCheck "en_US.UTF-8"; + LC_ALL = lib.optionalString finalAttrs.finalPackage.doCheck "en_US.UTF-8"; nativeCheckInputs = [ glibcLocales ]; @@ -86,7 +86,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DWANT_DOC=${lib.boolToString withDocumentation}" "-DWANT_DEMO=${lib.boolToString withExamples}" - "-DWANT_TESTS=${lib.boolToString finalAttrs.doCheck}" + "-DWANT_TESTS=${lib.boolToString finalAttrs.finalPackage.doCheck}" # Keeps finding & using glib-compile-resources from buildInputs otherwise "-DCMAKE_PROGRAM_PATH=${lib.makeBinPath [ buildPackages.glib.dev ]}" ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ diff --git a/pkgs/desktops/lomiri/development/gmenuharness/default.nix b/pkgs/desktops/lomiri/development/gmenuharness/default.nix index d5143e94d914..101b6e216777 100644 --- a/pkgs/desktops/lomiri/development/gmenuharness/default.nix +++ b/pkgs/desktops/lomiri/development/gmenuharness/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - "-Denable_tests=${lib.boolToString finalAttrs.doCheck}" + "-Denable_tests=${lib.boolToString finalAttrs.finalPackage.doCheck}" ]; dontWrapQtApps = true; diff --git a/pkgs/desktops/lomiri/development/libusermetrics/default.nix b/pkgs/desktops/lomiri/development/libusermetrics/default.nix index 7ccaccfa395e..0c4ed003e597 100644 --- a/pkgs/desktops/lomiri/development/libusermetrics/default.nix +++ b/pkgs/desktops/lomiri/development/libusermetrics/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace doc/CMakeLists.txt \ --replace "\''${CMAKE_INSTALL_DATAROOTDIR}/doc/libusermetrics-doc" "\''${CMAKE_INSTALL_DOCDIR}" - '' + lib.optionalString (!finalAttrs.doCheck) '' + '' + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' # Only needed by tests sed -i -e '/QTDBUSTEST/d' CMakeLists.txt ''; @@ -93,7 +93,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DGSETTINGS_LOCALINSTALL=ON" "-DGSETTINGS_COMPILE=ON" - "-DENABLE_TESTS=${lib.boolToString finalAttrs.doCheck}" + "-DENABLE_TESTS=${lib.boolToString finalAttrs.finalPackage.doCheck}" ]; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix index 017b4cf46a79..8ac9da237d19 100644 --- a/pkgs/development/libraries/cairo/default.nix +++ b/pkgs/development/libraries/cairo/default.nix @@ -57,7 +57,7 @@ in { "-Dspectre=disabled" (lib.mesonEnable "glib" gobjectSupport) - (lib.mesonEnable "tests" finalAttrs.doCheck) + (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) (lib.mesonEnable "xlib" x11Support) (lib.mesonEnable "xcb" xcbSupport) ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ diff --git a/pkgs/development/libraries/epoll-shim/default.nix b/pkgs/development/libraries/epoll-shim/default.nix index ae2c22afd633..d303f814b271 100644 --- a/pkgs/development/libraries/epoll-shim/default.nix +++ b/pkgs/development/libraries/epoll-shim/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DCMAKE_INSTALL_PKGCONFIGDIR=${placeholder "out"}/lib/pkgconfig" - "-DBUILD_TESTING=${lib.boolToString finalAttrs.doCheck}" + "-DBUILD_TESTING=${lib.boolToString finalAttrs.finalPackage.doCheck}" ]; # https://github.com/jiixyj/epoll-shim/issues/41 diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index c11f6b8432bc..a2e4ad8f47cf 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -224,7 +224,7 @@ stdenv.mkDerivation (finalAttrs: { nativeCheckInputs = [ tzdata desktop-file-utils shared-mime-info ]; - preCheck = lib.optionalString finalAttrs.doCheck or config.doCheckByDefault or false '' + preCheck = lib.optionalString finalAttrs.finalPackage.doCheck or config.doCheckByDefault or false '' export LD_LIBRARY_PATH="$NIX_BUILD_TOP/glib-${finalAttrs.version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" export TZDIR="${tzdata}/share/zoneinfo" export XDG_CACHE_HOME="$TMP" diff --git a/pkgs/development/libraries/hnswlib/default.nix b/pkgs/development/libraries/hnswlib/default.nix index 9033d9f5ff4d..cba73d569344 100644 --- a/pkgs/development/libraries/hnswlib/default.nix +++ b/pkgs/development/libraries/hnswlib/default.nix @@ -32,13 +32,13 @@ stdenv.mkDerivation (finalAttrs: { # this is a header-only library, so we don't need to build it # we need `cmake` only to run tests - nativeBuildInputs = lib.optionals finalAttrs.doCheck [ + nativeBuildInputs = lib.optionals finalAttrs.finalPackage.doCheck [ cmake python ]; # we only want to run buildPhase when we run tests - dontBuild = !finalAttrs.doCheck; + dontBuild = !finalAttrs.finalPackage.doCheck; installPhase = '' runHook preInstall diff --git a/pkgs/development/libraries/libayatana-common/default.nix b/pkgs/development/libraries/libayatana-common/default.nix index 98cf028a55e1..4206c46f1f53 100644 --- a/pkgs/development/libraries/libayatana-common/default.nix +++ b/pkgs/development/libraries/libayatana-common/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - "-DENABLE_TESTS=${lib.boolToString finalAttrs.doCheck}" + "-DENABLE_TESTS=${lib.boolToString finalAttrs.finalPackage.doCheck}" "-DENABLE_LOMIRI_FEATURES=OFF" "-DGSETTINGS_LOCALINSTALL=ON" "-DGSETTINGS_COMPILE=ON" diff --git a/pkgs/development/libraries/libcbor/default.nix b/pkgs/development/libraries/libcbor/default.nix index efb17eeaf315..514ee36d02df 100644 --- a/pkgs/development/libraries/libcbor/default.nix +++ b/pkgs/development/libraries/libcbor/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: { cmocka # cmake expects cmocka module ]; - cmakeFlags = lib.optional finalAttrs.doCheck "-DWITH_TESTS=ON" + cmakeFlags = lib.optional finalAttrs.finalPackage.doCheck "-DWITH_TESTS=ON" ++ lib.optional (!stdenv.hostPlatform.isStatic) "-DBUILD_SHARED_LIBS=ON"; # Tests are restricted while pkgsStatic.cmocka is broken. Tracked at: diff --git a/pkgs/development/libraries/libqtdbusmock/default.nix b/pkgs/development/libraries/libqtdbusmock/default.nix index 491b8583fc93..d9993947b553 100644 --- a/pkgs/development/libraries/libqtdbusmock/default.nix +++ b/pkgs/development/libraries/libqtdbusmock/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { # Workaround for "error: expected unqualified-id before 'public'" on "**signals" sed -i -e '/add_definitions/a -DQT_NO_KEYWORDS' CMakeLists.txt - '' + lib.optionalString (!finalAttrs.doCheck) '' + '' + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' # Don't build tests when we're not running them sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt ''; diff --git a/pkgs/development/libraries/libqtdbustest/default.nix b/pkgs/development/libraries/libqtdbustest/default.nix index 8ef8975a01af..fe6a3e041798 100644 --- a/pkgs/development/libraries/libqtdbustest/default.nix +++ b/pkgs/development/libraries/libqtdbustest/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - postPatch = lib.optionalString (!finalAttrs.doCheck) '' + postPatch = lib.optionalString (!finalAttrs.finalPackage.doCheck) '' # Don't build tests when we're not running them sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt ''; diff --git a/pkgs/development/libraries/libspatialindex/default.nix b/pkgs/development/libraries/libspatialindex/default.nix index 16c98abf4417..e1f93c822471 100644 --- a/pkgs/development/libraries/libspatialindex/default.nix +++ b/pkgs/development/libraries/libspatialindex/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; cmakeFlags = [ - "-DSIDX_BUILD_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}" + "-DSIDX_BUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" ]; doCheck = true; diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix index d8b7cbdab521..1255b0bc21f2 100644 --- a/pkgs/development/libraries/libuv/default.nix +++ b/pkgs/development/libraries/libuv/default.nix @@ -86,7 +86,7 @@ stdenv.mkDerivation (finalAttrs: { "shutdown_close_pipe" ]; tdRegexp = lib.concatStringsSep "\\|" toDisable; - in lib.optionalString (finalAttrs.doCheck) '' + in lib.optionalString (finalAttrs.finalPackage.doCheck) '' sed '/${tdRegexp}/d' -i test/test-list.h ''; diff --git a/pkgs/development/libraries/minizip-ng/default.nix b/pkgs/development/libraries/minizip-ng/default.nix index bfb7cd26fbb2..5be1f2e51925 100644 --- a/pkgs/development/libraries/minizip-ng/default.nix +++ b/pkgs/development/libraries/minizip-ng/default.nix @@ -29,8 +29,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" "-DMZ_OPENSSL=ON" - "-DMZ_BUILD_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}" - "-DMZ_BUILD_UNIT_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}" + "-DMZ_BUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" + "-DMZ_BUILD_UNIT_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" "-DMZ_LIB_SUFFIX='-ng'" ] ++ lib.optionals stdenv.isDarwin [ # missing header file diff --git a/pkgs/development/libraries/msgpack-c/default.nix b/pkgs/development/libraries/msgpack-c/default.nix index fed8cee33231..41d174bce7d9 100644 --- a/pkgs/development/libraries/msgpack-c/default.nix +++ b/pkgs/development/libraries/msgpack-c/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DMSGPACK_BUILD_EXAMPLES=OFF" # examples are not installed even if built - ] ++ lib.optional (!finalAttrs.doCheck) "-DMSGPACK_BUILD_TESTS=OFF"; + ] ++ lib.optional (!finalAttrs.finalPackage.doCheck) "-DMSGPACK_BUILD_TESTS=OFF"; checkInputs = [ gtest diff --git a/pkgs/development/libraries/msgpack-cxx/default.nix b/pkgs/development/libraries/msgpack-cxx/default.nix index 198593df5018..25ce9a5520d2 100644 --- a/pkgs/development/libraries/msgpack-cxx/default.nix +++ b/pkgs/development/libraries/msgpack-cxx/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DMSGPACK_BUILD_DOCS=OFF" # docs are not installed even if built - ] ++ lib.optional finalAttrs.doCheck "-DMSGPACK_BUILD_TESTS=ON"; + ] ++ lib.optional finalAttrs.finalPackage.doCheck "-DMSGPACK_BUILD_TESTS=ON"; checkInputs = [ zlib diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix index 29c7ca2c690b..2128fde93d04 100644 --- a/pkgs/development/libraries/nlohmann_json/default.nix +++ b/pkgs/development/libraries/nlohmann_json/default.nix @@ -43,10 +43,10 @@ in stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; cmakeFlags = [ - "-DJSON_BuildTests=${if finalAttrs.doCheck then "ON" else "OFF"}" + "-DJSON_BuildTests=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" "-DJSON_FastTests=ON" "-DJSON_MultipleHeaders=ON" - ] ++ lib.optional finalAttrs.doCheck "-DJSON_TestDataDirectory=${testData}"; + ] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}"; doCheck = stdenv.hostPlatform == stdenv.buildPlatform; diff --git a/pkgs/development/libraries/open62541/default.nix b/pkgs/development/libraries/open62541/default.nix index e25ac7bfca51..5982910c7c6b 100644 --- a/pkgs/development/libraries/open62541/default.nix +++ b/pkgs/development/libraries/open62541/default.nix @@ -55,7 +55,7 @@ stdenv.mkDerivation (finalAttrs: { "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" "-DUA_NAMESPACE_ZERO=FULL" - "-DUA_BUILD_UNIT_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}" + "-DUA_BUILD_UNIT_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" ] ++ lib.optional withExamples "-DUA_BUILD_EXAMPLES=ON" ++ lib.optional (withEncryption != false) diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index d2af5d9e1e94..89c91ccd9206 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -102,10 +102,10 @@ stdenv.mkDerivation (finalAttrs: rec { (mkFlag qt5Support "QT5") (mkFlag qt6Support "QT6") (mkFlag gpgmeSupport "GPGME") - ] ++ lib.optionals finalAttrs.doCheck [ + ] ++ lib.optionals finalAttrs.finalPackage.doCheck [ "-DTESTDATADIR=${testData}" ]; - disallowedReferences = lib.optional finalAttrs.doCheck testData; + disallowedReferences = lib.optional finalAttrs.finalPackage.doCheck testData; dontWrapQtApps = true; diff --git a/pkgs/development/libraries/properties-cpp/default.nix b/pkgs/development/libraries/properties-cpp/default.nix index 72538da6a997..65ad4ed6a293 100644 --- a/pkgs/development/libraries/properties-cpp/default.nix +++ b/pkgs/development/libraries/properties-cpp/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-C/BDEuKNMQHOjATO5aWBptjIlgfv6ykzjFAsHb6uP3Q="; }; - postPatch = lib.optionalString (!finalAttrs.doCheck) '' + postPatch = lib.optionalString (!finalAttrs.finalPackage.doCheck) '' sed -i "/add_subdirectory(tests)/d" CMakeLists.txt ''; diff --git a/pkgs/development/libraries/qmenumodel/default.nix b/pkgs/development/libraries/qmenumodel/default.nix index a8d11529808f..7d1384df364b 100644 --- a/pkgs/development/libraries/qmenumodel/default.nix +++ b/pkgs/development/libraries/qmenumodel/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace libqmenumodel/QMenuModel/CMakeLists.txt \ --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" - '' + lib.optionalString finalAttrs.doCheck '' + '' + lib.optionalString finalAttrs.finalPackage.doCheck '' patchShebangs tests/{client,script}/*.py ''; @@ -64,7 +64,7 @@ stdenv.mkDerivation (finalAttrs: { dontWrapQtApps = true; cmakeFlags = [ - "-DENABLE_TESTS=${lib.boolToString finalAttrs.doCheck}" + "-DENABLE_TESTS=${lib.boolToString finalAttrs.finalPackage.doCheck}" ]; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; diff --git a/pkgs/development/libraries/xsimd/default.nix b/pkgs/development/libraries/xsimd/default.nix index 8b53db0388fe..dd3a0d11f465 100644 --- a/pkgs/development/libraries/xsimd/default.nix +++ b/pkgs/development/libraries/xsimd/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - "-DBUILD_TESTS=${if (finalAttrs.doCheck && stdenv.hostPlatform == stdenv.buildPlatform) then "ON" else "OFF"}" + "-DBUILD_TESTS=${if (finalAttrs.finalPackage.doCheck && stdenv.hostPlatform == stdenv.buildPlatform) then "ON" else "OFF"}" ]; doCheck = true; diff --git a/pkgs/development/libraries/xtensor/default.nix b/pkgs/development/libraries/xtensor/default.nix index bb01b7f875ea..678f87af74cf 100644 --- a/pkgs/development/libraries/xtensor/default.nix +++ b/pkgs/development/libraries/xtensor/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = let cmakeBool = x: if x then "ON" else "OFF"; in [ - "-DBUILD_TESTS=${cmakeBool finalAttrs.doCheck}" + "-DBUILD_TESTS=${cmakeBool finalAttrs.finalPackage.doCheck}" "-DXTENSOR_ENABLE_ASSERT=${cmakeBool enableAssertions}" "-DXTENSOR_CHECK_DIMENSION=${cmakeBool enableBoundChecks}" ]; diff --git a/pkgs/development/python-modules/xtensor-python/default.nix b/pkgs/development/python-modules/xtensor-python/default.nix index 2d652fbd245c..4b2123162cc1 100644 --- a/pkgs/development/python-modules/xtensor-python/default.nix +++ b/pkgs/development/python-modules/xtensor-python/default.nix @@ -31,7 +31,7 @@ toPythonModule (stdenv.mkDerivation(finalAttrs: { ]; doCheck = true; cmakeFlags = [ - "-DBUILD_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}" + "-DBUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" ]; propagatedBuildInputs = [ diff --git a/pkgs/os-specific/linux/libnvme/default.nix b/pkgs/os-specific/linux/libnvme/default.nix index 129bb49e81e9..aee0dc1e0094 100644 --- a/pkgs/os-specific/linux/libnvme/default.nix +++ b/pkgs/os-specific/linux/libnvme/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation (finalAttrs: { mesonFlags = [ "-Ddocs=man" - (lib.mesonBool "tests" finalAttrs.doCheck) + (lib.mesonBool "tests" finalAttrs.finalPackage.doCheck) (lib.mesonBool "docs-build" withDocs) ]; diff --git a/pkgs/servers/mir/default.nix b/pkgs/servers/mir/default.nix index 078125016bf0..ed28e3be4181 100644 --- a/pkgs/servers/mir/default.nix +++ b/pkgs/servers/mir/default.nix @@ -93,7 +93,7 @@ stdenv.mkDerivation (finalAttrs: { pkg-config (python3.withPackages (ps: with ps; [ pillow - ] ++ lib.optionals finalAttrs.doCheck [ + ] ++ lib.optionals finalAttrs.finalPackage.doCheck [ pygobject3 python-dbusmock ])) @@ -141,7 +141,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DBUILD_DOXYGEN=OFF" "-DMIR_PLATFORM='gbm-kms;x11;eglstream-kms;wayland'" - "-DMIR_ENABLE_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}" + "-DMIR_ENABLE_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" # BadBufferTest.test_truncated_shm_file *doesn't* throw an error as the test expected, mark as such # https://github.com/MirServer/mir/pull/1947#issuecomment-811810872 "-DMIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN=ON" diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index e42ca26cfb08..5dc243ec2d7e 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -94,7 +94,7 @@ stdenv.mkDerivation (finalAttrs: { # Unpack subproject sources postUnpack = ''( cd "$sourceRoot/subprojects" - ${lib.optionalString finalAttrs.doCheck '' + ${lib.optionalString finalAttrs.finalPackage.doCheck '' cp -R --no-preserve=mode,ownership ${cmocka.src} cmocka ''} cp -R --no-preserve=mode,ownership ${imgui.src} imgui-${imgui.version} @@ -146,7 +146,7 @@ stdenv.mkDerivation (finalAttrs: { mesonFlags = [ "-Dwith_wayland=enabled" "-Duse_system_spdlog=enabled" - "-Dtests=${if finalAttrs.doCheck then "enabled" else "disabled"}" + "-Dtests=${if finalAttrs.finalPackage.doCheck then "enabled" else "disabled"}" ] ++ lib.optionals gamescopeSupport [ "-Dmangoapp=true" "-Dmangoapp_layer=true" @@ -215,7 +215,7 @@ stdenv.mkDerivation (finalAttrs: { addOpenGLRunpath "$out/lib/mangohud/libMangoHud.so" '' + lib.optionalString gamescopeSupport '' addOpenGLRunpath "$out/bin/mangoapp" - '' + lib.optionalString finalAttrs.doCheck '' + '' + lib.optionalString finalAttrs.finalPackage.doCheck '' # libcmocka.so is only used for tests rm "$out/lib/libcmocka.so" '';