uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
59
pkgs/development/libraries/libdevil/default.nix
Normal file
59
pkgs/development/libraries/libdevil/default.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{ lib, stdenv, fetchurl, libjpeg, libpng, libmng, lcms1, libtiff, openexr, libGL
|
||||
, libX11, pkg-config, OpenGL
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
pname = "libdevil";
|
||||
version = "1.7.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/openil/DevIL-${version}.tar.gz";
|
||||
sha256 = "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr libGL libX11 ]
|
||||
++ lib.optionals stdenv.isDarwin [ OpenGL ];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
configureFlags = [ "--enable-ILU" "--enable-ILUT" ];
|
||||
|
||||
preConfigure = ''
|
||||
sed -i 's, -std=gnu99,,g' configure
|
||||
sed -i 's,malloc.h,stdlib.h,g' src-ILU/ilur/ilur.c
|
||||
'' + lib.optionalString stdenv.cc.isClang ''
|
||||
sed -i 's/libIL_la_CXXFLAGS = $(AM_CFLAGS)/libIL_la_CXXFLAGS =/g' lib/Makefile.in
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h
|
||||
'';
|
||||
|
||||
patches =
|
||||
[ ( fetchurl {
|
||||
url = "https://sources.debian.org/data/main/d/devil/1.7.8-10/debian/patches/03_CVE-2009-3994.diff";
|
||||
sha256 = "0qkx2qfv02igbrmsn6z5a3lbrbwjfh3rb0c2sj54wy0j1f775hbc";
|
||||
} )
|
||||
./ftbfs-libpng15.patch
|
||||
./il_endian.h.patch
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postPatch = ''
|
||||
for a in test/Makefile.in test/format_test/format_checks.sh.in ; do
|
||||
substituteInPlace $a \
|
||||
--replace /bin/bash ${stdenv.shell}
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://openil.sourceforge.net/";
|
||||
description = "An image library which can can load, save, convert, manipulate, filter and display a wide variety of image formats";
|
||||
license = licenses.lgpl2;
|
||||
platforms = platforms.mesaPlatforms;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
31
pkgs/development/libraries/libdevil/ftbfs-libpng15.patch
Normal file
31
pkgs/development/libraries/libdevil/ftbfs-libpng15.patch
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
Source: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649554
|
||||
--- devil-1.7.8.orig/src-IL/src/il_icon.c
|
||||
+++ devil-1.7.8/src-IL/src/il_icon.c
|
||||
@@ -525,7 +525,11 @@
|
||||
|
||||
// Expand low-bit-depth grayscale images to 8 bits
|
||||
if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
|
||||
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
|
||||
+ png_set_expand_gray_1_2_4_to_8(ico_png_ptr);
|
||||
+#else
|
||||
png_set_gray_1_2_4_to_8(ico_png_ptr);
|
||||
+#endif
|
||||
}
|
||||
|
||||
// Expand RGB images with transparency to full alpha channels
|
||||
only in patch2:
|
||||
unchanged:
|
||||
--- devil-1.7.8.orig/src-IL/src/il_png.c
|
||||
+++ devil-1.7.8/src-IL/src/il_png.c
|
||||
@@ -278,7 +278,11 @@
|
||||
|
||||
// Expand low-bit-depth grayscale images to 8 bits
|
||||
if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
|
||||
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
|
||||
+ png_set_expand_gray_1_2_4_to_8(png_ptr);
|
||||
+#else
|
||||
png_set_gray_1_2_4_to_8(png_ptr);
|
||||
+#endif
|
||||
}
|
||||
|
||||
// Expand RGB images with transparency to full alpha channels
|
||||
27
pkgs/development/libraries/libdevil/il_endian.h.patch
Normal file
27
pkgs/development/libraries/libdevil/il_endian.h.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
Source: http://sourceforge.net/p/resil/tickets/8/
|
||||
--- devil-1.7.8.orig/src-IL/include/il_endian.h.orig 2009-03-08 01:10:08.000000000 -0600
|
||||
+++ devil-1.7.8/src-IL/include/il_endian.h 2013-11-03 01:52:37.000000000 -0600
|
||||
@@ -19,9 +19,13 @@
|
||||
#ifndef __BIG_ENDIAN__
|
||||
#define __BIG_ENDIAN__ 1
|
||||
#endif
|
||||
+#else
|
||||
+ #ifndef __LITTLE_ENDIAN__
|
||||
+ #define __LITTLE_ENDIAN__ 1
|
||||
+ #endif
|
||||
#endif
|
||||
|
||||
-#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __BIG_ENDIAN__) \
|
||||
+#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \
|
||||
|| (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__))
|
||||
#undef __LITTLE_ENDIAN__
|
||||
#define Short(s) iSwapShort(s)
|
||||
@@ -39,8 +43,6 @@
|
||||
#define BigDouble(d)
|
||||
#else
|
||||
#undef __BIG_ENDIAN__
|
||||
- #undef __LITTLE_ENDIAN__ // Not sure if it's defined by any compiler...
|
||||
- #define __LITTLE_ENDIAN__
|
||||
#define Short(s)
|
||||
#define UShort(s)
|
||||
#define Int(i)
|
||||
Loading…
Add table
Add a link
Reference in a new issue