at 23.05-pre 79 lines 2.8 kB view raw
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 }: 6 7stdenv.mkDerivation rec { 8 pname = "directfb"; 9 version = "1.7.7"; 10 11 src = fetchFromGitHub { 12 owner = "deniskropp"; 13 repo = "DirectFB"; 14 rev = "DIRECTFB_${lib.replaceStrings ["."] ["_"] version}"; 15 sha256 = "0bs3yzb7hy3mgydrj8ycg7pllrd2b6j0gxj596inyr7ihssr3i0y"; 16 }; 17 18 patches = [ 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 22 (fetchpatch { 23 url = "https://github.com/deniskropp/DirectFB/commit/3a236241bbec3f15b012b6f0dbe94353d8094557.patch"; 24 sha256 = "0rj3gv0zlb225sqjz04p4yagy4xacf3210aa8vra8i1f0fv0w4kw"; 25 }) 26 ]; 27 28 nativeBuildInputs = [ autoreconfHook perl pkg-config flux ]; 29 30 buildInputs = [ zlib libjpeg freetype giflib libpng ] 31 ++ lib.optional enableSDL SDL 32 ++ lib.optionals enableX11 (with xorg; [ 33 xorgproto libX11 libXext 34 libXrender 35 ]); 36 37 NIX_LDFLAGS = "-lgcc_s"; 38 39 configureFlags = [ 40 "--enable-sdl" 41 "--enable-zlib" 42 "--with-gfxdrivers=all" 43 "--enable-devmem" 44 "--enable-fbdev" 45 "--enable-mmx" 46 "--enable-sse" 47 "--with-software" 48 "--with-smooth-scaling" 49 ] ++ lib.optional enableX11 "--enable-x11"; 50 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 56 # 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; 61 62 meta = with lib; { 63 description = "Graphics and input library designed with embedded systems in mind"; 64 longDescription = '' 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 72 Linux. 73 ''; 74 homepage = "https://github.com/deniskropp/DirectFB"; 75 license = licenses.lgpl21; 76 platforms = platforms.linux; 77 maintainers = [ maintainers.bjornfor ]; 78 }; 79}