From 43fdc9248e6b43f690d4c571a06d9faabe5e63fe Mon Sep 17 00:00:00 2001 From: qbisi Date: Fri, 23 May 2025 10:43:17 +0800 Subject: [PATCH] otb: include vcl_legacy_aliases.h in otbMosaicFunctors.h --- pkgs/by-name/ot/otb/package.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ot/otb/package.nix b/pkgs/by-name/ot/otb/package.nix index b30b092ae6c63..1a9b06d863379 100644 --- a/pkgs/by-name/ot/otb/package.nix +++ b/pkgs/by-name/ot/otb/package.nix @@ -234,9 +234,17 @@ stdenv.mkDerivation (finalAttrs: { ./1-otb-swig-include-itk.diff ]; - postPatch = ( - "substituteInPlace Modules/Core/Wrappers/SWIG/src/python/CMakeLists.txt --replace-fail '''$''{ITK_INCLUDE_DIRS}' ${otb-itk}/include/ITK-${itkMajorMinorVersion}" - ); + postPatch = + '' + substituteInPlace Modules/Core/Wrappers/SWIG/src/python/CMakeLists.txt \ + --replace-fail ''\'''${ITK_INCLUDE_DIRS}' "${otb-itk}/include/ITK-${itkMajorMinorVersion}" + '' + # Add the header file "vcl_legacy_aliases.h", which defines the legacy vcl_* functions. + # This patch fixes the unreproducible build of OTB. + # See https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2484. + + '' + sed -i '/#include "vcl_compiler.h"/a #include "vcl_legacy_aliases.h"' Modules/Core/Mosaic/include/otbMosaicFunctors.h + ''; nativeBuildInputs = [ cmake