1 { stdenv, lib, fetchFromGitHub, cmake, pkg-config, libpng, libjpeg
2 , guiSupport ? false, libX11
4 # see http://dlib.net/compile.html
5 , sse4Support ? stdenv.hostPlatform.sse4_1Support
6 , avxSupport ? stdenv.hostPlatform.avxSupport
10 stdenv.mkDerivation rec {
14 src = fetchFromGitHub {
18 sha256 = "sha256-Z1fScuaIHjj2L1uqLIvsZ7ARKNjM+iaA8SAtWUTPFZk=";
26 "-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}"
27 "-DUSE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
28 "-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ];
30 nativeBuildInputs = [ cmake pkg-config ];
31 buildInputs = [ libpng libjpeg ] ++ lib.optional guiSupport libX11;
34 description = "A general purpose cross-platform C++ machine learning library";
35 homepage = "http://www.dlib.net";
36 license = licenses.boost;
37 maintainers = with maintainers; [ christopherpoole ];
38 platforms = platforms.unix;