From 536e8c558eb7c5ce7d7b3a8bf1500f40a4cfcb5f Mon Sep 17 00:00:00 2001 From: Chuang Zhu Date: Wed, 19 Oct 2022 23:40:50 +0800 Subject: [PATCH] ncnn: fix build Fixes #192617. The breakage is introduced by a glslang update. Now `${glslang}/lib/cmake/OSDependentTargets.cmake` points to `${glslang}/share/glslang/glslang-targets.cmake`. The latter requires the `SPIRV-Tools-opt` target. So the two lines in patch should be moved before `OSDependentTargets.cmake`. This also fixes a breakage introduced by cmake described in #144170. --- .../libraries/ncnn/cmakelists.patch | 29 ++++++++++++++----- pkgs/development/libraries/ncnn/default.nix | 1 - 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/ncnn/cmakelists.patch b/pkgs/development/libraries/ncnn/cmakelists.patch index 23499a1b9922..30f39a7a3f50 100644 --- a/pkgs/development/libraries/ncnn/cmakelists.patch +++ b/pkgs/development/libraries/ncnn/cmakelists.patch @@ -1,13 +1,26 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 98611276..989350bb 100644 +index c453d23e..66b4aa24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -260,6 +260,8 @@ if(NCNN_VULKAN) - include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") - endif() - include("${GLSLANG_TARGET_DIR}/glslangTargets.cmake") +@@ -478,6 +478,8 @@ if(NCNN_VULKAN) + + find_package(Threads) + + include("${GLSLANG_TARGET_DIR}/SPIRV-Tools/SPIRV-ToolsTarget.cmake") + include("${GLSLANG_TARGET_DIR}/SPIRV-Tools-opt/SPIRV-Tools-optTargets.cmake") - include("${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake") - - if (NOT TARGET glslang OR NOT TARGET SPIRV) + include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake") + include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake") + if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") +diff --git a/src/ncnn.pc.in b/src/ncnn.pc.in +index b580fcee..be2becd0 100644 +--- a/src/ncnn.pc.in ++++ b/src/ncnn.pc.in +@@ -1,6 +1,6 @@ + prefix=${pcfiledir}/../.. +-librarydir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++librarydir=@CMAKE_INSTALL_FULL_LIBDIR@ ++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + + Name: @CMAKE_PROJECT_NAME@ + Description: high-performance neural network inference framework optimized for the mobile platform diff --git a/pkgs/development/libraries/ncnn/default.nix b/pkgs/development/libraries/ncnn/default.nix index d8ed1c8a1943..0b07fab8668c 100644 --- a/pkgs/development/libraries/ncnn/default.nix +++ b/pkgs/development/libraries/ncnn/default.nix @@ -45,6 +45,5 @@ stdenv.mkDerivation rec { homepage = "https://github.com/Tencent/ncnn"; license = licenses.bsd3; maintainers = with maintainers; [ tilcreator ]; - broken = true; # at 2022-11-23 }; }