about summary refs log tree commit diff
path: root/pkgs/development/libraries/ncnn
diff options
context:
space:
mode:
authorRandy Eckenrode <randy@largeandhighquality.com>2024-03-23 09:18:53 -0400
committerRandy Eckenrode <randy@largeandhighquality.com>2024-03-23 16:51:52 -0400
commit0697a4a55b7cf4dda0503e157886fe2b7178207f (patch)
tree5d305a53a2cdfabb865545777a1de00f3abbdbb6 /pkgs/development/libraries/ncnn
parentc1a17238bc1b6ba15ca7855b8125499683e5ab36 (diff)
ncnn: fix build on Darwin
ncnn defaults to static linkage on Darwin against MoltenVK, but static
libraries are not build by default for MoltenVK in nixpkgs, and it’s not
taken as a dependency anyway. Override this behavior by specifying
`Vulkan_LIBRARY` explicitly as `-lvulkan` on Darwin.
Diffstat (limited to 'pkgs/development/libraries/ncnn')
-rw-r--r--pkgs/development/libraries/ncnn/default.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/libraries/ncnn/default.nix b/pkgs/development/libraries/ncnn/default.nix
index 71b4bbc8fd423..88a6d042cbf43 100644
--- a/pkgs/development/libraries/ncnn/default.nix
+++ b/pkgs/development/libraries/ncnn/default.nix
@@ -33,7 +33,9 @@ stdenv.mkDerivation rec {
     "-DNCNN_BUILD_TOOLS=0"
     "-DNCNN_SYSTEM_GLSLANG=1"
     "-DNCNN_PYTHON=0" # Should be an attribute
-  ];
+  ]
+  # Requires setting `Vulkan_LIBRARY` on Darwin. Otherwise the build fails due to missing symbols.
+  ++ lib.optionals stdenv.isDarwin [ "-DVulkan_LIBRARY=-lvulkan" ];
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ vulkan-headers vulkan-loader glslang opencv protobuf ];