From 9f1d63f8d46b7ed89f3b6c0ea41777735a030eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Tue, 15 Oct 2024 18:48:24 +1100 Subject: [PATCH] cmtk: darwin Fix the Darwin build. It required the same c++ standard setting as other platforms. Moved the options to cmake format too. --- pkgs/applications/science/biology/cmtk/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/biology/cmtk/default.nix b/pkgs/applications/science/biology/cmtk/default.nix index 1263f8194c9f..531f9047ba2b 100644 --- a/pkgs/applications/science/biology/cmtk/default.nix +++ b/pkgs/applications/science/biology/cmtk/default.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-iE164NCOSOypZLLZfZy9RTyrS+YnY9ECqfb4QhlsMS4="; }; + postPatch = '' + substituteInPlace apps/vtkxform.cxx --replace-fail \ + "float xyzFloat[3] = { xyz[0], xyz[1], xyz[2] };" \ + "float xyzFloat[3] = { (float)xyz[0], (float)xyz[1], (float)xyz[2] };" + ''; + nativeBuildInputs = [ cmake ]; buildInputs = [ @@ -28,10 +34,10 @@ stdenv.mkDerivation (finalAttrs: { llvmPackages.openmp ]; - env.NIX_CFLAGS_COMPILE = toString [ - (lib.optionalString stdenv.cc.isGNU "-std=c++11") - (lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing") - (lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "-Dfinite=isfinite") + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_CXX_STANDARD" "14") + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Dfinite=isfinite") ]; meta = with lib; {