python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / ncnn / default.nix
blob0b07fab8668cf746226411a8b3a128bd7fe3f447
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , vulkan-headers
6 , vulkan-loader
7 , glslang
8 , opencv
9 , protobuf
12 stdenv.mkDerivation rec {
13   pname = "ncnn";
14   version = "20220729";
16   src = fetchFromGitHub {
17     owner = "Tencent";
18     repo = pname;
19     rev = version;
20     sha256 = "sha256-hZVeW3svuVpwQhQz67uqTPZ7B9pisLCwHhXB2zMLygo=";
21   };
23   patches = [
24     ./cmakelists.patch
25   ];
27   cmakeFlags = [
28     "-DNCNN_CMAKE_VERBOSE=1" # Only for debugging the build
29     "-DNCNN_SHARED_LIB=1"
30     "-DNCNN_ENABLE_LTO=1"
31     "-DNCNN_VULKAN=1"
32     "-DNCNN_BUILD_EXAMPLES=0"
33     "-DNCNN_BUILD_TOOLS=0"
34     "-DNCNN_SYSTEM_GLSLANG=1"
35     "-DNCNN_PYTHON=0" # Should be an attribute
37     "-DGLSLANG_TARGET_DIR=${glslang}/lib/cmake"
38   ];
40   nativeBuildInputs = [ cmake ];
41   buildInputs = [ vulkan-headers vulkan-loader glslang opencv protobuf ];
43   meta = with lib; {
44     description = "ncnn is a high-performance neural network inference framework optimized for the mobile platform";
45     homepage = "https://github.com/Tencent/ncnn";
46     license = licenses.bsd3;
47     maintainers = with maintainers; [ tilcreator ];
48   };