at 18.09-beta 1.8 kB view raw
1{ stdenv, fetchurl, libjpeg, libpng, libmng, lcms1, libtiff, openexr, libGL 2, libX11, pkgconfig, OpenGL 3}: 4 5stdenv.mkDerivation rec { 6 7 name = "libdevil-${version}"; 8 version = "1.7.8"; 9 10 src = fetchurl { 11 url = "mirror://sourceforge/openil/DevIL-${version}.tar.gz"; 12 sha256 = "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"; 13 }; 14 15 outputs = [ "out" "dev" ]; 16 17 buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr libGL libX11 ] 18 ++ stdenv.lib.optionals stdenv.isDarwin [ OpenGL ]; 19 nativeBuildInputs = [ pkgconfig ]; 20 21 configureFlags = [ "--enable-ILU" "--enable-ILUT" ]; 22 23 preConfigure = '' 24 sed -i 's, -std=gnu99,,g' configure 25 sed -i 's,malloc.h,stdlib.h,g' src-ILU/ilur/ilur.c 26 '' + stdenv.lib.optionalString stdenv.cc.isClang '' 27 sed -i 's/libIL_la_CXXFLAGS = $(AM_CFLAGS)/libIL_la_CXXFLAGS =/g' lib/Makefile.in 28 ''; 29 30 postConfigure = '' 31 sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h 32 ''; 33 34 patches = 35 [ ( fetchurl { 36 url = http://patch-tracker.debian.org/patch/series/dl/devil/1.7.8-6.1/03_CVE-2009-3994.diff; 37 sha256 = "0qkx2qfv02igbrmsn6z5a3lbrbwjfh3rb0c2sj54wy0j1f775hbc"; 38 } ) 39 ./ftbfs-libpng15.patch 40 ./il_endian.h.patch 41 ]; 42 43 enableParallelBuilding = true; 44 45 postPatch = '' 46 for a in test/Makefile.in test/format_test/format_checks.sh.in ; do 47 substituteInPlace $a \ 48 --replace /bin/bash ${stdenv.shell} 49 done 50 ''; 51 52 meta = with stdenv.lib; { 53 homepage = http://openil.sourceforge.net/; 54 description = "An image library which can can load, save, convert, manipulate, filter and display a wide variety of image formats"; 55 license = licenses.lgpl2; 56 platforms = platforms.mesaPlatforms; 57 maintainers = [ maintainers.phreedom ]; 58 }; 59}