10 cudaSupport ? config.cudaSupport,
15 effectiveStdenv = if cudaSupport then cudaPackages.backendStdenv else inputs.stdenv;
17 effectiveStdenv.mkDerivation (finalAttrs: {
18 pname = "fastdeploy-ppocr";
19 version = "0-unstable-2023-10-09";
21 src = fetchFromGitHub {
22 owner = "MaaAssistantArknights";
24 # follows but not fully follows https://github.com/MaaAssistantArknights/MaaDeps/blob/master/vcpkg-overlay/ports/maa-fastdeploy/portfile.cmake#L4
25 rev = "0db6000aaac250824266ac37451f43ce272d80a3";
26 hash = "sha256-5TItnPDc5WShpZAgBYeqgI9KKkk3qw/M8HPMlq/H4BM=";
37 ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ];
44 ++ lib.optionals cudaSupport (
47 cuda_cccl # cub/cub.cuh
48 libcublas # cublas_v2.h
50 libcusparse # cusparse.h
57 cmakeBuildType = "None";
61 (lib.cmakeBool "BUILD_SHARED_LIBS" true)
63 ++ lib.optionals cudaSupport [
64 (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString)
69 install -Dm644 ${finalAttrs.src}/cmake/Findonnxruntime.cmake $cmake/
73 description = "MaaAssistantArknights stripped-down version of FastDeploy";
74 homepage = "https://github.com/MaaAssistantArknights/FastDeploy";
75 platforms = platforms.linux ++ platforms.darwin;
76 license = licenses.asl20;
77 broken = cudaSupport && stdenv.hostPlatform.system != "x86_64-linux";