libjpeg(-turbo): fix on mingw

By porting a patch from msys2.
This commit is contained in:
Vladimír Čunát 2016-02-10 12:40:20 +01:00
parent bd3d377e5e
commit 7d4ebb526c
2 changed files with 23 additions and 0 deletions

View file

@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
sha256 = "0gi349hp1x7mb98s4mf66sb2xay2kjjxj9ihrriw0yiy0k9va6sj";
};
patches =
stdenv.lib.optional (stdenv.cross.libc or null == "msvcrt")
./mingw-boolean.patch;
outputs = [ "dev" "out" "doc" "bin" ];
nativeBuildInputs = [ nasm ];

View file

@ -0,0 +1,19 @@
Ported to updated libjpeg-turbo from
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch
--- a/jmorecfg.h 2012-02-10 06:47:55 +0300
+++ b/jmorecfg.h 2012-05-03 10:29:13 +0400
@@ -224,7 +224,13 @@
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
-#ifndef HAVE_BOOLEAN
+#if defined(_WIN32) && !defined(HAVE_BOOLEAN)
+#ifndef __RPCNDR_H__
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN
+#endif
+#if !defined(HAVE_BOOLEAN) && !defined(__RPCNDR_H__)
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */