2024-01-02 11:29:13 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, fftw
|
|
|
|
, libpng
|
|
|
|
, libjpeg
|
|
|
|
, libwebp
|
|
|
|
, openblas
|
|
|
|
, guiSupport ? false
|
|
|
|
, libX11
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# see http://dlib.net/compile.html
|
2021-03-09 03:18:52 +00:00
|
|
|
, sse4Support ? stdenv.hostPlatform.sse4_1Support
|
2020-09-25 04:45:31 +00:00
|
|
|
, avxSupport ? stdenv.hostPlatform.avxSupport
|
2020-04-24 23:36:52 +00:00
|
|
|
, cudaSupport ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dlib";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "19.24.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "davisking";
|
|
|
|
repo = "dlib";
|
|
|
|
rev ="v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-Z1fScuaIHjj2L1uqLIvsZ7ARKNjM+iaA8SAtWUTPFZk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -rf dlib/external
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
cmakeFlags = [
|
2024-01-02 11:29:13 +00:00
|
|
|
(lib.cmakeBool "USE_DLIB_USE_CUDA" cudaSupport)
|
|
|
|
(lib.cmakeBool "USE_SSE4_INSTRUCTIONS" sse4Support)
|
|
|
|
(lib.cmakeBool "USE_AVX_INSTRUCTIONS" avxSupport)
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
fftw
|
|
|
|
libpng
|
|
|
|
libjpeg
|
|
|
|
libwebp
|
|
|
|
openblas
|
|
|
|
] ++ lib.optional guiSupport libX11;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A general purpose cross-platform C++ machine learning library";
|
|
|
|
homepage = "http://www.dlib.net";
|
|
|
|
license = licenses.boost;
|
2023-10-19 13:55:26 +00:00
|
|
|
maintainers = with maintainers; [ christopherpoole ];
|
2022-09-09 14:08:57 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|