Unverified Commit 4d6ee5dc authored by Pavol Rusnak's avatar Pavol Rusnak Committed by GitHub
Browse files

suitesparse + openimagedenoise: fix build with GCC14 (#393413)

parents 34857ed1 069a6632
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -15,19 +15,20 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "openimagedenoise";
  version = "2.2.2";
  version = "2.3.2";

  # The release tarballs include pretrained weights, which would otherwise need to be fetched with git-lfs
  src = fetchzip {
    url = "https://github.com/OpenImageDenoise/oidn/releases/download/v${finalAttrs.version}/oidn-${finalAttrs.version}.src.tar.gz";
    sha256 = "sha256-ZIrs4oEb+PzdMh2x2BUFXKyu/HBlFb3CJX24ciEHy3Q=";
    url = "https://github.com/RenderKit/oidn/releases/download/v${finalAttrs.version}/oidn-${finalAttrs.version}.src.tar.gz";
    sha256 = "sha256-yTa6U/1idfidbfNTQ7mXcroe7M4eM7Frxi45A/7e2A8=";
  };

  patches = lib.optional cudaSupport ./cuda.patch;

  postPatch = ''
    substituteInPlace devices/metal/CMakeLists.txt \
      --replace-fail "AppleClang" "Clang"
    # fix build failure with GCC14
    substituteInPlace cmake/oidn_platform.cmake \
      --replace-fail "set(CMAKE_CXX_STANDARD 11)" "set(CMAKE_CXX_STANDARD 14)"
  '';

  nativeBuildInputs =
@@ -61,11 +62,11 @@ stdenv.mkDerivation (finalAttrs: {
  ];

  meta = with lib; {
    homepage = "https://openimagedenoise.github.io";
    homepage = "https://www.openimagedenoise.org";
    description = "High-Performance Denoising Library for Ray Tracing";
    license = licenses.asl20;
    maintainers = [ maintainers.leshainc ];
    platforms = platforms.unix;
    changelog = "https://github.com/OpenImageDenoise/oidn/blob/v${version}/CHANGELOG.md";
    changelog = "https://github.com/RenderKit/oidn/blob/v${version}/CHANGELOG.md";
  };
})
+11 −5
Original line number Diff line number Diff line
@@ -93,7 +93,13 @@ effectiveStdenv.mkDerivation rec {
      "LAPACK=-llapack"
    ];

  env = lib.optionalAttrs effectiveStdenv.hostPlatform.isDarwin {
  env =
    {
      # in GCC14 these two warnings were promoted to error
      # let's make them warnings again to fix the build failure
      NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types";
    }
    // lib.optionalAttrs effectiveStdenv.hostPlatform.isDarwin {
      # Ensure that there is enough space for the `fixDarwinDylibNames` hook to
      # update the install names of the output dylibs.
      NIX_LDFLAGS = "-headerpad_max_install_names";