about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ncnn
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/ncnn')
-rw-r--r--nixpkgs/pkgs/development/libraries/ncnn/cmakelists.patch23
-rw-r--r--nixpkgs/pkgs/development/libraries/ncnn/default.nix6
2 files changed, 18 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/development/libraries/ncnn/cmakelists.patch b/nixpkgs/pkgs/development/libraries/ncnn/cmakelists.patch
index bdb3063acec4..a43d7b0c4b72 100644
--- a/nixpkgs/pkgs/development/libraries/ncnn/cmakelists.patch
+++ b/nixpkgs/pkgs/development/libraries/ncnn/cmakelists.patch
@@ -1,18 +1,27 @@
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c453d23e..66b4aa24 100644
+index 785e2cd..459024d 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -560,6 +560,8 @@ if(NCNN_VULKAN)
-                 message(WARNING "GLSLANG_TARGET_DIR must be defined! NCNN_SYSTEM_GLSLANG will be turned off.")
+@@ -589,7 +589,8 @@ endif()
+ if(NCNN_VULKAN)
+     if(NCNN_SYSTEM_GLSLANG)
+         find_package(Threads)
+-        find_package(glslang QUIET)
++        find_package(SPIRV-Tools-opt REQUIRED)
++        find_package(glslang REQUIRED)
+         if(glslang_FOUND)
+             add_library(glslang ALIAS glslang::glslang)
+             add_library(SPIRV ALIAS glslang::SPIRV)
+@@ -601,7 +602,6 @@ if(NCNN_VULKAN)
                  set(NCNN_SYSTEM_GLSLANG OFF)
              else()
-+                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}/OGLCompilerTargets.cmake")
+-                include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake")
                  if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
+                     # hlsl support can be optional
+                     include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
 diff --git a/src/ncnn.pc.in b/src/ncnn.pc.in
-index b580fcee..be2becd0 100644
+index b580fce..be2becd 100644
 --- a/src/ncnn.pc.in
 +++ b/src/ncnn.pc.in
 @@ -1,6 +1,6 @@
diff --git a/nixpkgs/pkgs/development/libraries/ncnn/default.nix b/nixpkgs/pkgs/development/libraries/ncnn/default.nix
index 69967eae160d..71b4bbc8fd42 100644
--- a/nixpkgs/pkgs/development/libraries/ncnn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ncnn/default.nix
@@ -11,13 +11,13 @@
 
 stdenv.mkDerivation rec {
   pname = "ncnn";
-  version = "20231027";
+  version = "20240102";
 
   src = fetchFromGitHub {
     owner = "Tencent";
     repo = pname;
     rev = version;
-    sha256 = "sha256-ak/5QTOptg5M2I+3olnrBK6JZ01haIE6oh+sagEboAc=";
+    hash = "sha256-kk70oLY+2QJOkyYq10whLRMxBuibQMWMOBA9dcbKf/I=";
   };
 
   patches = [
@@ -33,8 +33,6 @@ stdenv.mkDerivation rec {
     "-DNCNN_BUILD_TOOLS=0"
     "-DNCNN_SYSTEM_GLSLANG=1"
     "-DNCNN_PYTHON=0" # Should be an attribute
-
-    "-DGLSLANG_TARGET_DIR=${glslang}/lib/cmake"
   ];
 
   nativeBuildInputs = [ cmake ];