[tkimg] fix build against zlib 1.2.7+, use gzgetc_ instead of gzgetc
Tom Callaway
spot at fedoraproject.org
Tue Jul 31 18:59:13 UTC 2012
commit 7eb9fdee666a9abfaf6739f31d0cbfe4f80130aa
Author: Tom Callaway <spot at fedoraproject.org>
Date: Tue Jul 31 14:59:30 2012 -0400
fix build against zlib 1.2.7+, use gzgetc_ instead of gzgetc
tkimg-zlib127-gzgetc_fix.patch | 44 ++++++++++++++++++++++++++++++++++++++++
tkimg.spec | 14 ++++++++++-
2 files changed, 56 insertions(+), 2 deletions(-)
---
diff --git a/tkimg-zlib127-gzgetc_fix.patch b/tkimg-zlib127-gzgetc_fix.patch
new file mode 100644
index 0000000..1b9ce15
--- /dev/null
+++ b/tkimg-zlib127-gzgetc_fix.patch
@@ -0,0 +1,44 @@
+diff -up tkimg1.4/zlib/zlibtcl.decls.gzgetc_fix tkimg1.4/zlib/zlibtcl.decls
+--- tkimg1.4/zlib/zlibtcl.decls.gzgetc_fix 2012-07-31 14:54:11.104302862 -0400
++++ tkimg1.4/zlib/zlibtcl.decls 2012-07-31 14:54:24.846303790 -0400
+@@ -138,7 +138,7 @@ declare 38 {
+ int gzputc(gzFile file, int c)
+ }
+ declare 39 {
+- int gzgetc(gzFile file)
++ int gzgetc_(gzFile file)
+ }
+ declare 40 {
+ int gzflush(gzFile file, int flush)
+diff -up tkimg1.4/zlib/zlibtclDecls.h.gzgetc_fix tkimg1.4/zlib/zlibtclDecls.h
+--- tkimg1.4/zlib/zlibtclDecls.h.gzgetc_fix 2012-07-31 14:55:12.754307116 -0400
++++ tkimg1.4/zlib/zlibtclDecls.h 2012-07-31 14:55:17.520307957 -0400
+@@ -120,7 +120,7 @@ ZEXTERN char * gzgets(gzFile file, char
+ /* 38 */
+ ZEXTERN int gzputc(gzFile file, int c);
+ /* 39 */
+-ZEXTERN int gzgetc(gzFile file);
++ZEXTERN int gzgetc_(gzFile file);
+ /* 40 */
+ ZEXTERN int gzflush(gzFile file, int flush);
+ /* 41 */
+@@ -179,7 +179,7 @@ typedef struct ZlibtclStubs {
+ int (*gzputsPtr) (gzFile file, const char *s); /* 36 */
+ char * (*gzgetsPtr) (gzFile file, char *buf, int len); /* 37 */
+ int (*gzputcPtr) (gzFile file, int c); /* 38 */
+- int (*gzgetcPtr) (gzFile file); /* 39 */
++ int (*gzgetc_Ptr) (gzFile file); /* 39 */
+ int (*gzflushPtr) (gzFile file, int flush); /* 40 */
+ z_off_t (*gzseekPtr) (gzFile file, z_off_t offset, int whence); /* 41 */
+ int (*gzrewindPtr) (gzFile file); /* 42 */
+@@ -273,8 +273,8 @@ ZEXTERN const ZlibtclStubs *zlibtclStubs
+ (zlibtclStubsPtr->gzgetsPtr) /* 37 */
+ #define gzputc \
+ (zlibtclStubsPtr->gzputcPtr) /* 38 */
+-#define gzgetc \
+- (zlibtclStubsPtr->gzgetcPtr) /* 39 */
++#define gzgetc_ \
++ (zlibtclStubsPtr->gzgetc_Ptr) /* 39 */
+ #define gzflush \
+ (zlibtclStubsPtr->gzflushPtr) /* 40 */
+ #define gzseek \
diff --git a/tkimg.spec b/tkimg.spec
index ceec41a..73e1992 100644
--- a/tkimg.spec
+++ b/tkimg.spec
@@ -3,7 +3,7 @@
Name: tkimg
Version: 1.4
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: Image support library for Tk
Group: Development/Libraries
License: BSD
@@ -15,11 +15,17 @@ Patch2: tkimg-libpng.patch
Patch3: tkimg-libtiff.patch
Patch4: tkimg-libpng15.patch
Patch5: tkimg-libtiff4.patch
+# gzgetc is now defined as a macro in zlib, which causes tkimg to ftbfs
+# because it wants to define all of its functions internally to map to the
+# tcl/tk bits. The simple fix is to use the abstraction function "gzgetc_"
+# which avoids the problem. See: https://bugzilla.redhat.com/show_bug.cgi?id=844462
+Patch6: tkimg-zlib127-gzgetc_fix.patch
# A request to allow building with system libraries has been submitted
# https://sourceforge.net/tracker/index.php?func=detail&aid=2292032&group_id=52039&atid=465495
BuildRequires: tcl-devel tk-devel tcllib
-BuildRequires: zlib-devel libjpeg-devel
+BuildRequires: zlib-devel >= 1.2.7
+BuildRequires: libjpeg-devel
BuildRequires: libpng-devel >= 1.5
BuildRequires: libtiff-devel >= 4.0
@@ -55,6 +61,7 @@ rm -rf compat/libpng
rm -rf compat/libtiff
%patch4 -p1 -b .png15
%patch5 -p1 -b .tiff4
+%patch6 -p1 -b .gzgetc_fix
%build
%configure --with-tcl=%{tcl_sitearch} --with-tk=%{_libdir} --libdir=%{tcl_sitearch} --disable-threads --enable-64bit
@@ -96,6 +103,9 @@ done
%{tcl_sitearch}/Img1.4/*.a
%changelog
+* Tue Jul 31 2012 Tom Callaway <spot at fedoraproject.org> - 1.4-10
+- fix for newer zlib (1.2.7+)
+
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
More information about the scm-commits
mailing list