From 6ae62cd2c872d594cf56b70f90235aaef2d7ab11 Mon Sep 17 00:00:00 2001 From: Christian Bourjau Date: Sun, 30 Jul 2023 12:00:18 +0200 Subject: [PATCH] piper: Apply patch to build with onnxruntime 1.15.1 --- pkgs/tools/audio/piper/default.nix | 4 ++++ ...ix-compilation-with-newer-onnxruntime.patch | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 pkgs/tools/audio/piper/fix-compilation-with-newer-onnxruntime.patch diff --git a/pkgs/tools/audio/piper/default.nix b/pkgs/tools/audio/piper/default.nix index df8ed3e969e..c3d8a763830 100644 --- a/pkgs/tools/audio/piper/default.nix +++ b/pkgs/tools/audio/piper/default.nix @@ -25,6 +25,10 @@ stdenv.mkDerivation { sourceRoot = "source/src/cpp"; + patches = [ + ./fix-compilation-with-newer-onnxruntime.patch + ]; + postPatch = '' substituteInPlace CMakeLists.txt \ --replace "/usr/local/include/onnxruntime" "${onnxruntime}" diff --git a/pkgs/tools/audio/piper/fix-compilation-with-newer-onnxruntime.patch b/pkgs/tools/audio/piper/fix-compilation-with-newer-onnxruntime.patch new file mode 100644 index 00000000000..9d2e46bb4e9 --- /dev/null +++ b/pkgs/tools/audio/piper/fix-compilation-with-newer-onnxruntime.patch @@ -0,0 +1,18 @@ +diff --git a/src/cpp/synthesize.hpp b/src/cpp/synthesize.hpp +index ef61aef..4c7db7a 100644 +--- a/synthesize.hpp ++++ b/synthesize.hpp +@@ -119,11 +119,11 @@ void synthesize(SynthesisConfig &synthesisConfig, ModelSession &session, + + // Clean up + for (size_t i = 0; i < outputTensors.size(); i++) { +- Ort::OrtRelease(outputTensors[i].release()); ++ Ort::detail::OrtRelease(outputTensors[i].release()); + } + + for (size_t i = 0; i < inputTensors.size(); i++) { +- Ort::OrtRelease(inputTensors[i].release()); ++ Ort::detail::OrtRelease(inputTensors[i].release()); + } + } + } // namespace larynx