14 , enableShared ? !stdenv.hostPlatform.isStatic # dlib has a build system that forces the user to choose between either shared or static libraries. See https://github.com/davisking/dlib/issues/923#issuecomment-2175865174
15 , sse4Support ? stdenv.hostPlatform.sse4_1Support
16 , avxSupport ? stdenv.hostPlatform.avxSupport
17 , cudaSupport ? config.cudaSupport
20 (if cudaSupport then cudaPackages.backendStdenv else inputs.stdenv).mkDerivation rec {
24 src = fetchFromGitHub {
27 rev = "refs/tags/v${version}";
28 sha256 = "sha256-BpE7ZrtiiaDqwy1G4IHOQBJMr6sAadFbRxsdObs1SIY=";
36 (lib.cmakeBool "BUILD_SHARED_LIBS" enableShared)
37 (lib.cmakeBool "USE_SSE4_INSTRUCTIONS" sse4Support)
38 (lib.cmakeBool "USE_AVX_INSTRUCTIONS" avxSupport)
39 (lib.cmakeBool "DLIB_USE_CUDA" cudaSupport)
40 ] ++ lib.optionals cudaSupport [
41 (lib.cmakeFeature "DLIB_USE_CUDA_COMPUTE_CAPABILITIES" (builtins.concatStringsSep "," (with cudaPackages.flags; map dropDot cudaCapabilities)))
47 ] ++ lib.optionals cudaSupport (with cudaPackages; [
58 ++ lib.optionals guiSupport [ libX11 ]
59 ++ lib.optionals cudaSupport (with cudaPackages; [
71 cudaSupport cudaPackages
72 sse4Support avxSupport;
76 description = "General purpose cross-platform C++ machine learning library";
77 homepage = "http://www.dlib.net";
78 license = licenses.boost;
79 maintainers = with maintainers; [ christopherpoole ];
80 platforms = platforms.unix;