1{ stdenv, fetchurl, pkgconfig, perl, zlib, libjpeg, freetype, libpng, giflib
2, enableX11 ? true, xorg
3, enableSDL ? true, SDL }:
4
5let s =
6rec {
7 version = "1.7.7";
8 name="directfb-${version}";
9 sha256 = "18r7h0pwbyyk8z3pgdv77nmma8lvr1si9gl1ghxgxf1ivhwcd1dp";
10 url="http://directfb.org/downloads/Core/DirectFB-1.7/DirectFB-${version}.tar.gz";
11}
12; in
13stdenv.mkDerivation {
14 inherit (s) name;
15 src = fetchurl {
16 inherit (s) url sha256;
17 };
18
19 nativeBuildInputs = [ perl pkgconfig ];
20
21 buildInputs = [ zlib libjpeg freetype giflib libpng ]
22 ++ stdenv.lib.optional enableSDL SDL
23 ++ stdenv.lib.optionals enableX11 (with xorg; [
24 xproto libX11 libXext #xextproto
25 #renderproto libXrender
26 ]);
27
28 NIX_LDFLAGS="-lgcc_s";
29
30 configureFlags = [
31 "--enable-sdl"
32 "--enable-zlib"
33 "--with-gfxdrivers=all"
34 "--enable-devmem"
35 "--enable-fbdev"
36 "--enable-mmx"
37 "--enable-sse"
38 #"--enable-sysfs" # not recognized
39 "--with-software"
40 "--with-smooth-scaling"
41 ] ++ stdenv.lib.optionals enableX11 [
42 "--enable-x11"
43 ];
44
45 meta = with stdenv.lib; {
46 description = "Graphics and input library designed with embedded systems in mind";
47 longDescription = ''
48 DirectFB is a thin library that provides hardware graphics acceleration,
49 input device handling and abstraction, integrated windowing system with
50 support for translucent windows and multiple display layers, not only on
51 top of the Linux Framebuffer Device. It is a complete hardware
52 abstraction layer with software fallbacks for every graphics operation
53 that is not supported by the underlying hardware. DirectFB adds graphical
54 power to embedded systems and sets a new standard for graphics under
55 Linux.
56 '';
57 homepage = http://directfb.org/;
58 license = licenses.lgpl21;
59 platforms = platforms.linux;
60 maintainers = [ maintainers.bjornfor ];
61 };
62}