From 685aeb5b9f85c97875ba7907406ca64dd0bef59f Mon Sep 17 00:00:00 2001 From: Alexpux Date: Thu, 11 Dec 2014 11:27:39 +0300 Subject: [PATCH] libjpeg-turbo: Remove unneeded patches. Apply header compatibility patch. --- mingw-w64-libjpeg-turbo/PKGBUILD | 7 +--- .../jpeg-7-tiff-ojpeg.patch | 39 ------------------- mingw-w64-libjpeg-turbo/jpeg-typedefs.patch | 26 ------------- .../libjpeg-buf-oflo.patch | 19 --------- ...ibjpeg-turbo-match-autoconf-behavior.patch | 31 --------------- 5 files changed, 2 insertions(+), 120 deletions(-) delete mode 100644 mingw-w64-libjpeg-turbo/jpeg-7-tiff-ojpeg.patch delete mode 100644 mingw-w64-libjpeg-turbo/jpeg-typedefs.patch delete mode 100644 mingw-w64-libjpeg-turbo/libjpeg-buf-oflo.patch delete mode 100644 mingw-w64-libjpeg-turbo/libjpeg-turbo-match-autoconf-behavior.patch diff --git a/mingw-w64-libjpeg-turbo/PKGBUILD b/mingw-w64-libjpeg-turbo/PKGBUILD index b9fc3a2993..b225451fe2 100644 --- a/mingw-w64-libjpeg-turbo/PKGBUILD +++ b/mingw-w64-libjpeg-turbo/PKGBUILD @@ -3,7 +3,7 @@ _realname=libjpeg-turbo pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=1.3.1 -pkgrel=5 +pkgrel=6 pkgdesc="JPEG image codec with accelerated baseline compression and decompression (mingw-w64)" arch=('any') url="http://libjpeg-turbo.virtualgl.org" @@ -17,17 +17,14 @@ replaces=("${MINGW_PACKAGE_PREFIX}-libjpeg") options=('staticlibs' 'strip') source=("http://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-$pkgver.tar.gz" "0001-header-compat.mingw.patch" - "jpeg-typedefs.patch" "libjpeg-turbo-1.3.1-libmng-compatibility.patch") md5sums=('2c3a68129dac443a72815ff5bb374b05' '4cd30dbda4e54a6875e74ed437e41b49' - 'b758ab3ac6a0604c6ed5fb9d850c9a73' 'b54c2ab69837e1b72605184364360af0') prepare() { cd "$srcdir/libjpeg-turbo-$pkgver" - #patch -p1 -i ${srcdir}/0001-header-compat.mingw.patch - #patch -p1 -i ${srcdir}/jpeg-typedefs.patch + patch -p1 -i ${srcdir}/0001-header-compat.mingw.patch patch -p1 -i ${srcdir}/libjpeg-turbo-1.3.1-libmng-compatibility.patch } diff --git a/mingw-w64-libjpeg-turbo/jpeg-7-tiff-ojpeg.patch b/mingw-w64-libjpeg-turbo/jpeg-7-tiff-ojpeg.patch deleted file mode 100644 index 388449532c..0000000000 --- a/mingw-w64-libjpeg-turbo/jpeg-7-tiff-ojpeg.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/jdhuff.c 2012-05-03 10:41:17 +0400 -+++ b/jdhuff.c 2012-05-03 10:43:15 +0400 -@@ -806,3 +806,36 @@ - entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; - } - } -+ -+/* -+ * BEWARE OF KLUDGE: This subroutine is a hack for decoding illegal JPEG-in- -+ * TIFF encapsulations produced by Microsoft's Wang Imaging -+ * for Windows application with the public-domain TIFF Library. Based upon an -+ * examination of selected output files, this program apparently divides a JPEG -+ * bit-stream into consecutive horizontal TIFF "strips", such that the JPEG -+ * encoder's/decoder's DC coefficients for each image component are reset before -+ * each "strip". Moreover, a "strip" is not necessarily encoded in a multiple -+ * of 8 bits, so one must sometimes discard 1-7 bits at the end of each "strip" -+ * for alignment to the next input-Byte storage boundary. IJG JPEG Library -+ * decoder state is not normally exposed to client applications, so this sub- -+ * routine provides the TIFF Library with a "hook" to make these corrections. -+ * It should be called after "jpeg_start_decompress()" and before -+ * "jpeg_finish_decompress()", just before decoding each "strip" using -+ * "jpeg_read_raw_data()" or "jpeg_read_scanlines()". -+ * -+ * This kludge is not sanctioned or supported by the Independent JPEG Group, and -+ * future changes to the IJG JPEG Library might invalidate it. Do not send bug -+ * reports about this code to IJG developers. Instead, contact the author for -+ * advice: Scott B. Marovich , Hewlett-Packard Labs, 6/01. -+ */ -+GLOBAL(void) -+jpeg_reset_huff_decode (register j_decompress_ptr cinfo,register float *refbw) -+{ register huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; -+ register int ci = 0; -+ -+ /* Re-initialize DC predictions */ -+ do entropy->saved.last_dc_val[ci] = -refbw[ci << 1]; -+ while (++ci < cinfo->comps_in_scan); -+ /* Discard encoded input bits, up to the next Byte boundary */ -+ entropy->bitstate.bits_left &= ~7; -+} diff --git a/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch b/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch deleted file mode 100644 index b7c5ccca5a..0000000000 --- a/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/jmorecfg.h 2012-02-10 06:47:55 +0300 -+++ b/jmorecfg.h 2012-05-03 10:29:13 +0400 -@@ -159,7 +159,7 @@ - /* INT32 must hold at least signed 32-bit values. */ - - #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ --typedef long INT32; -+typedef int INT32; - #endif - - /* Datatype used for image dimensions. The JPEG standard only supports -@@ -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 */ diff --git a/mingw-w64-libjpeg-turbo/libjpeg-buf-oflo.patch b/mingw-w64-libjpeg-turbo/libjpeg-buf-oflo.patch deleted file mode 100644 index b2ddb8979d..0000000000 --- a/mingw-w64-libjpeg-turbo/libjpeg-buf-oflo.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/wrjpgcom.c 2012-05-03 10:37:26 +0400 -+++ b/wrjpgcom.c 2012-05-03 10:38:10 +0400 -@@ -446,6 +446,8 @@ - } else if (keymatch(arg, "comment", 1)) { - if (++argn >= argc) usage(); - comment_arg = argv[argn]; -+#if 0 -+#error "There is a buffer overflow in the code below" - /* If the comment text starts with '"', then we are probably running - * under MS-DOG and must parse out the quoted string ourselves. Sigh. - */ -@@ -466,6 +468,7 @@ - strcat(comment_arg, argv[argn]); - } - } -+#endif - comment_length = (unsigned int) strlen(comment_arg); - } else - usage(); diff --git a/mingw-w64-libjpeg-turbo/libjpeg-turbo-match-autoconf-behavior.patch b/mingw-w64-libjpeg-turbo/libjpeg-turbo-match-autoconf-behavior.patch deleted file mode 100644 index d18a449603..0000000000 --- a/mingw-w64-libjpeg-turbo/libjpeg-turbo-match-autoconf-behavior.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- libjpeg-turbo-1.3.0/win/jconfig.h.in.orig 2013-08-03 21:52:45.115856655 +0200 -+++ libjpeg-turbo-1.3.0/win/jconfig.h.in 2013-08-03 21:53:40.335912080 +0200 -@@ -7,14 +7,14 @@ - #cmakedefine D_ARITH_CODING_SUPPORTED - #cmakedefine MEM_SRCDST_SUPPORTED - --#define HAVE_PROTOTYPES --#define HAVE_UNSIGNED_CHAR --#define HAVE_UNSIGNED_SHORT -+#define HAVE_PROTOTYPES 1 -+#define HAVE_UNSIGNED_CHAR 1 -+#define HAVE_UNSIGNED_SHORT 1 - /* #define void char */ - /* #define const */ - #undef CHAR_IS_UNSIGNED --#define HAVE_STDDEF_H --#define HAVE_STDLIB_H -+#define HAVE_STDDEF_H 1 -+#define HAVE_STDLIB_H 1 - #undef NEED_BSD_STRINGS - #undef NEED_SYS_TYPES_H - #undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ -@@ -25,7 +25,7 @@ - #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ - typedef unsigned char boolean; - #endif --#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ -+#define HAVE_BOOLEAN 1 /* prevent jmorecfg.h from redefining it */ - - /* Define "INT32" as int, not long, per Windows custom */ - #if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */