realesrgan-ncnn-vulkan: fix build failure

fixes #289910

Updates build for glslang 14.0.0
This commit is contained in:
Lin Xianyi 2024-03-08 10:30:12 +08:00
parent c8cd65298e
commit 40754aafe9
2 changed files with 13 additions and 6 deletions

View file

@ -1,13 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e7b71a..9db85b1 100644 index 1e7b71a..e743ab0 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -107,6 +107,8 @@ if(USE_SYSTEM_NCNN) @@ -106,9 +106,9 @@ if(USE_SYSTEM_NCNN)
message(STATUS "Using glslang install located at ${GLSLANG_TARGET_DIR}")
find_package(Threads) find_package(Threads)
+ find_package(SPIRV-Tools-opt REQUIRED)
+ include("${GLSLANG_TARGET_DIR}/SPIRV-Tools/SPIRV-ToolsTarget.cmake")
+ include("${GLSLANG_TARGET_DIR}/SPIRV-Tools-opt/SPIRV-Tools-optTargets.cmake")
include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake") include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake")
include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake") - include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake")
if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
# hlsl support can be optional
include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")

View file

@ -50,15 +50,20 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/share mkdir -p $out/bin $out/share
cp realesrgan-ncnn-vulkan $out/bin/ cp realesrgan-ncnn-vulkan $out/bin/
cp -r ${models}/models $out/share cp -r ${models}/models $out/share
''; '';
postFixup = ''
patchelf $out/bin/realesrgan-ncnn-vulkan --add-needed libvulkan.so
'';
meta = with lib; { meta = with lib; {
description = "NCNN implementation of Real-ESRGAN. Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration"; description = "NCNN implementation of Real-ESRGAN. Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration";
homepage = "https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan"; homepage = "https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ tilcreator ]; maintainers = with maintainers; [ tilcreator iynaix ];
platforms = platforms.all; platforms = platforms.all;
mainProgram = "realesrgan-ncnn-vulkan"; mainProgram = "realesrgan-ncnn-vulkan";
}; };