[mingw-gdk-pixbuf: 4/22] Fix loader detection on Win32

epienbro epienbro at fedoraproject.org
Tue Mar 6 19:22:38 UTC 2012


commit 1d68c97a544396cb9d573c18a54ab4f774431527
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Mon Sep 20 20:06:24 2010 +0200

    Fix loader detection on Win32
    
    - Fixed a bug which caused the path /usr/i686-pc-mingw32/sys-root/mingw to get hardcoded in the resulting library resulting in runtime failures on Win32 environments
    - Move the file %{_mingw32_sysconfdir}/gtk-2.0/gdk-pixbuf.loaders to %{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders.cache

 ...uf-2.21.7-fix-loaders-cache-path-on-win32.patch |   28 ++++++++++++++++++++
 mingw32-gdk-pixbuf.spec                            |   19 ++++++++++---
 2 files changed, 42 insertions(+), 5 deletions(-)
---
diff --git a/gdk-pixbuf-2.21.7-fix-loaders-cache-path-on-win32.patch b/gdk-pixbuf-2.21.7-fix-loaders-cache-path-on-win32.patch
new file mode 100644
index 0000000..5714d23
--- /dev/null
+++ b/gdk-pixbuf-2.21.7-fix-loaders-cache-path-on-win32.patch
@@ -0,0 +1,28 @@
+--- gdk-pixbuf/gdk-pixbuf-io.c.orig	2010-09-20 19:53:21.941394362 +0200
++++ gdk-pixbuf/gdk-pixbuf-io.c	2010-09-20 19:55:13.648429932 +0200
+@@ -256,18 +256,18 @@
+ }
+ 
+ static char *
+-get_sysconfdir (void)
++get_libdir (void)
+ {
+-  static char *sysconfdir = NULL;
++  static char *libdir = NULL;
+ 
+-  if (sysconfdir == NULL)
+-          sysconfdir = g_build_filename (get_toplevel (), "etc", NULL);
++  if (libdir == NULL)
++          libdir = g_build_filename (get_toplevel (), "lib", NULL);
+ 
+-  return sysconfdir;
++  return libdir;
+ }
+ 
+-#undef GDK_PIXBUF_SYSCONFDIR
+-#define GDK_PIXBUF_SYSCONFDIR get_sysconfdir()
++#undef GDK_PIXBUF_LIBDIR
++#define GDK_PIXBUF_LIBDIR get_libdir()
+ 
+ static void
+ correct_prefix (gchar **path)
diff --git a/mingw32-gdk-pixbuf.spec b/mingw32-gdk-pixbuf.spec
index 6be50a5..745510a 100644
--- a/mingw32-gdk-pixbuf.spec
+++ b/mingw32-gdk-pixbuf.spec
@@ -7,7 +7,7 @@
 
 Name:           mingw32-gdk-pixbuf
 Version:        2.21.7
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        MinGW Windows GDK Pixbuf library
 
 License:        LGPLv2+
@@ -24,6 +24,9 @@ Source1:        gdk-pixbuf.loaders
 # Some Fedora-MinGW-specific changes are required by mingw32-libjpeg 7
 Patch0:         mingw32-gtk2-libjpeg7-compatibility.patch
 
+# Due to a bug in gdk-pixbuf the path /usr/i686-pc-mingw32/sys-root/mingw/lib gets hardcoded in the resulting library. Fix this
+Patch1:         gdk-pixbuf-2.21.7-fix-loaders-cache-path-on-win32.patch
+
 BuildArch:      noarch
 
 BuildRequires:  mingw32-filesystem >= 49
@@ -61,6 +64,7 @@ MinGW Windows GDK Pixbuf library.
 %setup -q -n gdk-pixbuf-%{version}
 
 %patch0 -p0
+%patch1 -p0
 
 
 %build
@@ -93,9 +97,8 @@ rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders/*.la
 rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/gtk-doc
 rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}
 
-# Install the gdk-pixbuf.loaders file
-mkdir -p $RPM_BUILD_ROOT%{_mingw32_sysconfdir}/gtk-2.0/
-install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_mingw32_sysconfdir}/gtk-2.0/
+# Install the loaders.cache file
+install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders.cache
 
 %find_lang %{name} --all-name
 
@@ -113,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_mingw32_libdir}/gdk-pixbuf-2.0
 %dir %{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0
 %dir %{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders
+%{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders.cache
 %{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.dll
 %{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gdip-bmp.dll
 %{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gdip-emf.dll
@@ -136,10 +140,15 @@ rm -rf $RPM_BUILD_ROOT
 %{_mingw32_libdir}/libgdk_pixbuf-2.0.la
 %{_mingw32_libdir}/pkgconfig/gdk-pixbuf-2.0.pc
 %{_mingw32_includedir}/gdk-pixbuf-2.0/
-%{_mingw32_sysconfdir}/gtk-2.0/
 
 
 %changelog
+* Mon Sep 20 2010 Erik van Pienbroek <epienbro at fedoraproject.org> - 2.21.7-2
+- Fixed a bug which caused the path /usr/i686-pc-mingw32/sys-root/mingw to get hardcoded
+  in the resulting library resulting in runtime failures on Win32 environments
+- Moved the file %%{_mingw32_sysconfdir}/gtk-2.0/gdk-pixbuf.loaders to
+  %%{_mingw32_libdir}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+
 * Sun Sep 12 2010 Erik van Pienbroek <epienbro at fedoraproject.org> - 2.21.7-1
 - Initial release (split off from the mingw32-gtk2 package)
 - Dropped the -static subpackage as it provides no added value


More information about the scm-commits mailing list