From 91f0c848f4961ae8d0e50039fb712dd4ae6a02b7 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 21 Feb 2019 20:21:31 -0500 Subject: [PATCH 1/2] cmake: set BUILD_TESTING=OFF when doCheck is false This means we can avoid building test suites that will never be run. --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index c21e10bb0616..8c6b11bd73e7 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -71,6 +71,11 @@ cmakeConfigurePhase() { cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags" cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags" + # Don’t build tests when doCheck = false + if [ -z "$doCheck" ]; then + cmakeFlags="-DBUILD_TESTING=OFF $cmakeFlags" + fi + # Avoid cmake resetting the rpath of binaries, on make install # And build always Release, to ensure optimisation flags cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags" From 6ed49262f50691b77919fd867a5d142e407caf14 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 21 Feb 2019 20:51:58 -0500 Subject: [PATCH 2/2] treewide: remove BUILD_TESTING flag This is now set by CMake --- pkgs/applications/editors/kdevelop5/kdev-php.nix | 4 ---- pkgs/applications/editors/kdevelop5/kdev-python.nix | 1 - pkgs/applications/graphics/seg3d/default.nix | 1 - pkgs/applications/science/biology/ants/default.nix | 4 +--- pkgs/applications/science/biology/mni_autoreg/default.nix | 3 +-- pkgs/development/libraries/arguments/default.nix | 2 +- pkgs/development/libraries/catch2/default.nix | 4 +--- pkgs/development/libraries/google-gflags/default.nix | 1 - pkgs/development/libraries/itk/default.nix | 1 - pkgs/development/libraries/libminc/default.nix | 3 +-- pkgs/development/libraries/qt-5/mkDerivation.nix | 1 - pkgs/development/libraries/science/biology/bicpl/default.nix | 2 +- pkgs/development/libraries/science/biology/mirtk/default.nix | 2 +- pkgs/development/libraries/vtk/default.nix | 3 +-- pkgs/development/libraries/vxl/default.nix | 2 +- pkgs/development/python-modules/hoomd-blue/default.nix | 2 -- pkgs/tools/filesystems/cryfs/default.nix | 1 - pkgs/tools/misc/hdf4/default.nix | 1 - pkgs/tools/package-management/appimagekit/default.nix | 1 - 19 files changed, 9 insertions(+), 30 deletions(-) diff --git a/pkgs/applications/editors/kdevelop5/kdev-php.nix b/pkgs/applications/editors/kdevelop5/kdev-php.nix index 532bb99e7d8e..ea0514066e98 100644 --- a/pkgs/applications/editors/kdevelop5/kdev-php.nix +++ b/pkgs/applications/editors/kdevelop5/kdev-php.nix @@ -12,10 +12,6 @@ stdenv.mkDerivation rec { sha256 = "1xiz4v6w30dsa7l4nk3jw3hxpkx71b0yaaj2k8s7xzgjif824bgl"; }; - cmakeFlags = [ - "-DBUILD_TESTING=OFF" - ]; - nativeBuildInputs = [ cmake extra-cmake-modules ]; buildInputs = [ kdevelop-pg-qt threadweaver ktexteditor kdevelop-unwrapped ]; diff --git a/pkgs/applications/editors/kdevelop5/kdev-python.nix b/pkgs/applications/editors/kdevelop5/kdev-python.nix index be27e10f42a1..1c311539dd7c 100644 --- a/pkgs/applications/editors/kdevelop5/kdev-python.nix +++ b/pkgs/applications/editors/kdevelop5/kdev-python.nix @@ -13,7 +13,6 @@ stdenv.mkDerivation rec { }; cmakeFlags = [ - "-DBUILD_TESTING=OFF" "-DPYTHON_EXECUTABLE=${python}/bin/python" ]; diff --git a/pkgs/applications/graphics/seg3d/default.nix b/pkgs/applications/graphics/seg3d/default.nix index bca88cc70130..58cec2ec1703 100644 --- a/pkgs/applications/graphics/seg3d/default.nix +++ b/pkgs/applications/graphics/seg3d/default.nix @@ -23,7 +23,6 @@ stdenv.mkDerivation { "-DBUILD_BIOMESH3D=1" "-DWITH_TETGEN=1" "-DBUILD_TYPE=Release" - "-DBUILD_TESTING=0" "-DWITH_WXWIDGETS=ON" "-DITK_DIR=${itk}/lib/InsightToolkit" "-DGDCM_LIBRARY=${itk}/lib/libitkgdcm.a" diff --git a/pkgs/applications/science/biology/ants/default.nix b/pkgs/applications/science/biology/ants/default.nix index f54bd9af0288..d1a990a5eb28 100644 --- a/pkgs/applications/science/biology/ants/default.nix +++ b/pkgs/applications/science/biology/ants/default.nix @@ -15,9 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake makeWrapper ]; buildInputs = [ itk vtk ]; - cmakeFlags = [ "-DANTS_SUPERBUILD=FALSE" "-DUSE_VTK=TRUE" - # as cmake otherwise tries to download test data: - "-DBUILD_TESTING=FALSE" ]; + cmakeFlags = [ "-DANTS_SUPERBUILD=FALSE" "-DUSE_VTK=TRUE" ]; enableParallelBuilding = true; diff --git a/pkgs/applications/science/biology/mni_autoreg/default.nix b/pkgs/applications/science/biology/mni_autoreg/default.nix index 5901b696d642..ab22fb7232ff 100644 --- a/pkgs/applications/science/biology/mni_autoreg/default.nix +++ b/pkgs/applications/science/biology/mni_autoreg/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ libminc ]; propagatedBuildInputs = with perlPackages; [ perl GetoptTabular MNI-Perllib ]; - cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/" "-DBUILD_TESTING=FALSE" ]; + cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/" ]; # testing broken: './minc_wrapper: Permission denied' from Testing/ellipse0.mnc postFixup = '' @@ -33,4 +33,3 @@ stdenv.mkDerivation rec { license = licenses.free; }; } - diff --git a/pkgs/development/libraries/arguments/default.nix b/pkgs/development/libraries/arguments/default.nix index ebef604e1be6..cb0c65e97e3b 100644 --- a/pkgs/development/libraries/arguments/default.nix +++ b/pkgs/development/libraries/arguments/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ ]; - #cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" "-DBICPL_DIR=${bicpl}/lib" "-DBUILD_TESTING=FALSE" ]; + #cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" "-DBICPL_DIR=${bicpl}/lib" ]; doCheck = false; # internal_volume_io.h: No such file or directory diff --git a/pkgs/development/libraries/catch2/default.nix b/pkgs/development/libraries/catch2/default.nix index 54f1c459212d..ffe027c89612 100644 --- a/pkgs/development/libraries/catch2/default.nix +++ b/pkgs/development/libraries/catch2/default.nix @@ -13,9 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = [ - "-H.." - "-DBUILD_TESTING=OFF"]; + cmakeFlags = [ "-H.." ]; meta = with stdenv.lib; { description = "A multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C)"; diff --git a/pkgs/development/libraries/google-gflags/default.nix b/pkgs/development/libraries/google-gflags/default.nix index a6f062b8126a..fefc3a8b4b81 100644 --- a/pkgs/development/libraries/google-gflags/default.nix +++ b/pkgs/development/libraries/google-gflags/default.nix @@ -19,7 +19,6 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DBUILD_STATIC_LIBS=ON" - "-DBUILD_TESTING=${if doCheck then "ON" else "OFF"}" ]; doCheck = false; diff --git a/pkgs/development/libraries/itk/default.nix b/pkgs/development/libraries/itk/default.nix index df016d9fcac0..878c82215429 100644 --- a/pkgs/development/libraries/itk/default.nix +++ b/pkgs/development/libraries/itk/default.nix @@ -9,7 +9,6 @@ stdenv.mkDerivation rec { }; cmakeFlags = [ - "-DBUILD_TESTING=OFF" "-DBUILD_EXAMPLES=OFF" "-DBUILD_SHARED_LIBS=ON" "-DModule_ITKMINC=ON" diff --git a/pkgs/development/libraries/libminc/default.nix b/pkgs/development/libraries/libminc/default.nix index 1e13f3238222..aea7a5959fac 100644 --- a/pkgs/development/libraries/libminc/default.nix +++ b/pkgs/development/libraries/libminc/default.nix @@ -22,13 +22,12 @@ stdenv.mkDerivation rec { buildInputs = [ zlib netcdf nifticlib hdf5 ]; cmakeFlags = [ - "-DBUILD_TESTING=${if doCheck then "ON" else "OFF"}" "-DLIBMINC_MINC1_SUPPORT=ON" "-DLIBMINC_BUILD_SHARED_LIBS=ON" "-DLIBMINC_USE_SYSTEM_NIFTI=ON" ]; - doCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doCheck = true; checkPhase = '' export LD_LIBRARY_PATH="$(pwd)" # see #22060 ctest -E 'ezminc_rw_test|minc_conversion' --output-on-failure diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix index 96014cfbc779..d4e2143d564b 100644 --- a/pkgs/development/libraries/qt-5/mkDerivation.nix +++ b/pkgs/development/libraries/qt-5/mkDerivation.nix @@ -19,7 +19,6 @@ let cmakeFlags = (args.cmakeFlags or []) ++ [ - "-DBUILD_TESTING=OFF" ("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release")) ]; diff --git a/pkgs/development/libraries/science/biology/bicpl/default.nix b/pkgs/development/libraries/science/biology/bicpl/default.nix index f763e8a4fcc0..0c634c0f265c 100644 --- a/pkgs/development/libraries/science/biology/bicpl/default.nix +++ b/pkgs/development/libraries/science/biology/bicpl/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ libminc netpbm ]; - cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" "-DBUILD_TESTING=FALSE" ]; + cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" ]; doCheck = false; # internal_volume_io.h: No such file or directory diff --git a/pkgs/development/libraries/science/biology/mirtk/default.nix b/pkgs/development/libraries/science/biology/mirtk/default.nix index ce2050e82e6d..51beba898f6c 100644 --- a/pkgs/development/libraries/science/biology/mirtk/default.nix +++ b/pkgs/development/libraries/science/biology/mirtk/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - cmakeFlags = "-DWITH_VTK=ON -DBUILD_ALL_MODULES=ON -DBUILD_TESTING=ON"; + cmakeFlags = "-DWITH_VTK=ON -DBUILD_ALL_MODULES=ON"; doCheck = true; diff --git a/pkgs/development/libraries/vtk/default.nix b/pkgs/development/libraries/vtk/default.nix index dee363f23b6a..9843b1289cfc 100644 --- a/pkgs/development/libraries/vtk/default.nix +++ b/pkgs/development/libraries/vtk/default.nix @@ -40,8 +40,7 @@ stdenv.mkDerivation rec { # objects. cmakeFlags = [ "-DCMAKE_C_FLAGS=-fPIC" "-DCMAKE_CXX_FLAGS=-fPIC" ] ++ optional (qtLib != null) [ "-DVTK_USE_QT:BOOL=ON" ] - ++ optional stdenv.isDarwin [ "-DBUILD_TESTING:BOOL=OFF" - "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ]; + ++ optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"; postPatch = stdenv.lib.optionalString stdenv.isDarwin '' sed -i 's|COMMAND vtkHashSource|COMMAND "DYLD_LIBRARY_PATH=''${VTK_BINARY_DIR}/lib" ''${VTK_BINARY_DIR}/bin/vtkHashSource-7.0|' ./Parallel/Core/CMakeLists.txt diff --git a/pkgs/development/libraries/vxl/default.nix b/pkgs/development/libraries/vxl/default.nix index 777b8bb1f403..9651e9a5f80c 100644 --- a/pkgs/development/libraries/vxl/default.nix +++ b/pkgs/development/libraries/vxl/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { # BUILD_OUL wants old linux headers for videodev.h, not available # in stdenv linux headers # BUILD_BRL fails to find open() - cmakeFlags = "-DBUILD_TESTING=OFF -DBUILD_OUL=OFF -DBUILD_BRL=OFF -DBUILD_CONTRIB=OFF " + cmakeFlags = "-DBUILD_OUL=OFF -DBUILD_BRL=OFF -DBUILD_CONTRIB=OFF " + (if stdenv.hostPlatform.system == "x86_64-linux" then "-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC" else diff --git a/pkgs/development/python-modules/hoomd-blue/default.nix b/pkgs/development/python-modules/hoomd-blue/default.nix index 3463f471c5eb..ad25b8977c05 100644 --- a/pkgs/development/python-modules/hoomd-blue/default.nix +++ b/pkgs/development/python-modules/hoomd-blue/default.nix @@ -10,7 +10,6 @@ let components = { hpmc = true; md = true; metal = true; - testing = false; }; onOffBool = b: if b then "ON" else "OFF"; withMPI = (mpi != null); @@ -44,7 +43,6 @@ stdenv.mkDerivation rec { "-DBUILD_HPMC=${onOffBool components.hpmc}" "-DBUILD_MD=${onOffBool components.md}" "-DBUILD_METAL=${onOffBool components.metal}" - "-DBUILD_TESTING=${onOffBool components.testing}" ]; preConfigure = '' diff --git a/pkgs/tools/filesystems/cryfs/default.nix b/pkgs/tools/filesystems/cryfs/default.nix index 4e2f8eaf5c9b..71e27c94dbdb 100644 --- a/pkgs/tools/filesystems/cryfs/default.nix +++ b/pkgs/tools/filesystems/cryfs/default.nix @@ -48,7 +48,6 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCRYFS_UPDATE_CHECKS=OFF" "-DBoost_USE_STATIC_LIBS=OFF" # this option is case sensitive - "-DBUILD_TESTING=ON" ]; doCheck = true; diff --git a/pkgs/tools/misc/hdf4/default.nix b/pkgs/tools/misc/hdf4/default.nix index ef3839f67de9..eb57cc45f6a0 100644 --- a/pkgs/tools/misc/hdf4/default.nix +++ b/pkgs/tools/misc/hdf4/default.nix @@ -42,7 +42,6 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" - "-DBUILD_TESTING=ON" "-DHDF4_BUILD_TOOLS=ON" "-DHDF4_BUILD_UTILS=ON" "-DHDF4_BUILD_WITH_INSTALL_NAME=OFF" diff --git a/pkgs/tools/package-management/appimagekit/default.nix b/pkgs/tools/package-management/appimagekit/default.nix index 2c389c144b1e..b9454e64ccf7 100644 --- a/pkgs/tools/package-management/appimagekit/default.nix +++ b/pkgs/tools/package-management/appimagekit/default.nix @@ -87,7 +87,6 @@ in stdenv.mkDerivation rec { "-DUSE_SYSTEM_LIBARCHIVE=ON" "-DUSE_SYSTEM_GTEST=ON" "-DUSE_SYSTEM_MKSQUASHFS=ON" - "-DBUILD_TESTING=${if doCheck then "ON" else "OFF"}" ]; checkInputs = [ gtest ];