Unverified Commit 9f755397 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #265665 from wegank/vtk-clang-16

vtk: fix build with clang 16
parents b23f12e0 524b9beb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -43,6 +43,12 @@ stdenv.mkDerivation rec {
      url = "https://github.com/flann-lib/flann/commit/25eb56ec78472bd419a121c6905095a793cf8992.patch";
      sha256 = "qt8h576Gn8uR7+T9u9bEBIRz6e6AoTKpa1JfdZVvW9s=";
    })
  ] ++ lib.optionals stdenv.cc.isClang [
    # Fix build with Clang 16.
    (fetchpatch {
      url = "https://github.com/flann-lib/flann/commit/be80cefa69b314a3d9e1ab971715e84145863ebb.patch";
      hash = "sha256-4SUKzQCm0Sx8N43Z6ShuMbgbbe7q8b2Ibk3WgkB0qa4=";
    })
  ];

  cmakeFlags = [
+2 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
, libiconv
, enablePython ? false
, python ? null
, swig
, swig4
}:

stdenv.mkDerivation rec {
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
    ApplicationServices
    Cocoa
    libiconv
  ] ++ lib.optionals enablePython [ swig python ];
  ] ++ lib.optionals enablePython [ swig4 python ];

  disabledTests = [
    # require networking:
+4 −0
Original line number Diff line number Diff line
@@ -86,6 +86,10 @@ in stdenv.mkDerivation rec {
      "-DVTK_PYTHON_VERSION:STRING=${pythonMajor}"
    ];

  env = lib.optionalAttrs stdenv.cc.isClang {
    NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
  };

  postPatch = optionalString stdenv.isDarwin ''
    sed -i 's|COMMAND vtkHashSource|COMMAND "DYLD_LIBRARY_PATH=''${VTK_BINARY_DIR}/lib" ''${VTK_BINARY_DIR}/bin/vtkHashSource-${majorVersion}|' ./Parallel/Core/CMakeLists.txt
    sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/' ./ThirdParty/libxml2/vtklibxml2/xmlschemas.c
+11 −6
Original line number Diff line number Diff line
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, isPyPy
@@ -50,12 +51,16 @@ buildPythonPackage rec {
    NO_NET=1 NO_CDL=1 ${python.interpreter} run_all.py
  '';

  env = {
    # Variables used to configure the build process
    USE_NCCONFIG = "0";
    HDF5_DIR = lib.getDev hdf5;
    NETCDF4_DIR = netcdf;
    CURL_DIR = curl.dev;
    JPEG_DIR = libjpeg.dev;
  } // lib.optionalAttrs stdenv.cc.isClang {
    NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion";
  };

  pythonImportsCheck = [ "netCDF4" ];

+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@ buildPythonPackage rec {

  propagatedBuildInputs = [ cffi ];

  env = lib.optionalAttrs stdenv.cc.isClang {
    NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
  };

  nativeCheckInputs = [ pytestCheckHook ];

  postPatch = ''