1 { stdenv, lib, fetchFromGitHub, fetchpatch
2 , autoreconfHook, perl, pkg-config, flux, zlib
3 , libjpeg, freetype, libpng, giflib
4 , enableX11 ? true, xorg
5 , enableSDL ? true, SDL }:
7 stdenv.mkDerivation rec {
11 src = fetchFromGitHub {
14 rev = "DIRECTFB_${lib.replaceStrings ["."] ["_"] version}";
15 sha256 = "0bs3yzb7hy3mgydrj8ycg7pllrd2b6j0gxj596inyr7ihssr3i0y";
19 # Fixes build in "davinci" with glibc >= 2.28
20 # The "davinci" module is only enabled on 32-bit arm.
21 # https://github.com/deniskropp/DirectFB/pull/17
23 url = "https://github.com/deniskropp/DirectFB/commit/3a236241bbec3f15b012b6f0dbe94353d8094557.patch";
24 sha256 = "0rj3gv0zlb225sqjz04p4yagy4xacf3210aa8vra8i1f0fv0w4kw";
28 nativeBuildInputs = [ autoreconfHook perl pkg-config flux ];
30 buildInputs = [ zlib libjpeg freetype giflib libpng ]
31 ++ lib.optional enableSDL SDL
32 ++ lib.optionals enableX11 (with xorg; [
33 xorgproto libX11 libXext
37 NIX_LDFLAGS = "-lgcc_s";
42 "--with-gfxdrivers=all"
48 "--with-smooth-scaling"
49 ] ++ lib.optional enableX11 "--enable-x11";
51 # Disable parallel building as parallel builds fail due to incomplete
52 # depends between autogenerated CoreSlave.h and it's include sites:
53 # CC prealloc_surface_pool_bridge.lo
54 # prealloc_surface_pool_bridge.c:41:10:
55 # fatal error: core/CoreSlave.h: No such file or directory
57 # Dependencies are specified manually in src/core/Makefile.am. Instead
58 # of fixing them one by one locally let's disable parallel builds until
59 # upstream fixes them.
60 enableParallelBuilding = false;
63 description = "Graphics and input library designed with embedded systems in mind";
65 DirectFB is a thin library that provides hardware graphics acceleration,
66 input device handling and abstraction, integrated windowing system with
67 support for translucent windows and multiple display layers, not only on
68 top of the Linux Framebuffer Device. It is a complete hardware
69 abstraction layer with software fallbacks for every graphics operation
70 that is not supported by the underlying hardware. DirectFB adds graphical
71 power to embedded systems and sets a new standard for graphics under
74 homepage = "https://github.com/deniskropp/DirectFB";
75 license = licenses.lgpl21;
76 platforms = platforms.linux;
77 maintainers = [ maintainers.bjornfor ];