vtk: fixup build with gcc13

https://hydra.nixos.org/build/245444944
This commit is contained in:
Vladimír Čunát 2024-01-11 10:17:40 +01:00
parent cccc171edb
commit c707dd20c9
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -55,6 +55,17 @@ in stdenv.mkDerivation {
patches = map fetchpatch patchesToFetch;
# GCC 13: error: 'int64_t' in namespace 'std' does not name a type
postPatch = ''
sed '1i#include <cstdint>' \
-i ThirdParty/libproj/vtklibproj/src/proj_json_streaming_writer.hpp
''
+ 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
sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c
'';
dontWrapQtApps = true;
# Shared libraries don't work, because of rpath troubles with the current
@ -87,12 +98,6 @@ in stdenv.mkDerivation {
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
sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c
'';
postInstall = optionalString enablePython ''
substitute \
${./vtk.egg-info} \