From db2ac6fee91425e9540224151bfea55cddb7224d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Added libgsf --- .hgignore | 1 + ...ngw32-libgsf-1.14.10-better-bz2-detection.patch | 57 +++++++++++ .../mingw32-libgsf-1.14.10-glib-deprecated.patch | 14 +++ libgsf/mingw32-libgsf.spec | 105 +++++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100644 libgsf/mingw32-libgsf-1.14.10-better-bz2-detection.patch create mode 100644 libgsf/mingw32-libgsf-1.14.10-glib-deprecated.patch create mode 100644 libgsf/mingw32-libgsf.spec diff --git a/.hgignore b/.hgignore index b2ed60e..118df8f 100644 --- a/.hgignore +++ b/.hgignore @@ -54,6 +54,7 @@ libgcrypt/libgcrypt-1.4.3.tar.bz2 libgcrypt/libgcrypt-1.4.3.tar.bz2.sig libgpg-error/libgpg-error-1.6.tar.bz2 libgpg-error/libgpg-error-1.6.tar.bz2.sig +libgsf/libgsf-1.14.10.tar.bz2 libidn/libidn-1.9.tar.gz libjpeg/jpegsrc.v6b.tar.gz libpng/libpng-1.2.31.tar.bz2 diff --git a/libgsf/mingw32-libgsf-1.14.10-better-bz2-detection.patch b/libgsf/mingw32-libgsf-1.14.10-better-bz2-detection.patch new file mode 100644 index 0000000..08fc7f0 --- /dev/null +++ b/libgsf/mingw32-libgsf-1.14.10-better-bz2-detection.patch @@ -0,0 +1,57 @@ +--- libgsf-1.14.10.orig/configure.in 2008-10-19 13:37:35.000000000 +0100 ++++ libgsf-1.14.10.mingw/configure.in 2008-11-22 17:04:10.000000000 +0000 +@@ -321,30 +321,36 @@ + + with_bz2=false + if test "x$test_bz2" = xtrue ; then +- AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, +- bz2_ok=yes, +- bz2_ok=no +- AC_MSG_WARN(*** BZ2 support disabled (BZ2 library not found) ***)) +- +- if test "$bz2_ok" = yes; then +- AC_MSG_CHECKING([for bzlib.h]) +- AC_PREPROC_IFELSE( +- [AC_LANG_SOURCE( ++ dnl AC_CHECK_LIB doesn't work with the Windows port of libbz2 because ++ dnl it uses the __stdcall calling convention where the callee cleans ++ dnl up the stack. You have to include in order to get the ++ dnl right calling convention, and the link fails if not. Since we ++ dnl require both -lbz2 and , just test if a program which ++ dnl uses both can be compiled. ++ ++ old_LIBS="$LIBS" ++ LIBS="-lbz2 $LIBS" ++ AC_LINK_IFELSE( ++ [AC_LANG_SOURCE( + [[#include +- #undef PACKAGE +- #undef VERSION +- #undef HAVE_STDLIB_H +- #include ]])], +- bz2_ok=yes, +- bz2_ok=no) +- AC_MSG_RESULT($bz2_ok) +- fi ++ #undef PACKAGE ++ #undef VERSION ++ #undef HAVE_STDLIB_H ++ #include ++ main () ++ { ++ return BZ2_bzDecompressInit (NULL, 0, 0); ++ } ++ ]])], ++ bz2_ok=yes, ++ bz2_ok=no) ++ LIBS="$old_LIBS" + + if test "$bz2_ok" = yes; then + AC_DEFINE(HAVE_BZ2, 1, [Is bzip2 available and enabled]) + BZ2_LIBS="-lbz2" + else +- AC_MSG_WARN(*** BZ2 support disabled (BZ2 header not found) ***) ++ AC_MSG_WARN(*** BZ2 support disabled (BZ2 header or library not found) ***) + fi + else + AC_MSG_WARN([BZ2 support disabled, as requested (Use --with-bz2 to enable)]) diff --git a/libgsf/mingw32-libgsf-1.14.10-glib-deprecated.patch b/libgsf/mingw32-libgsf-1.14.10-glib-deprecated.patch new file mode 100644 index 0000000..69c3ab9 --- /dev/null +++ b/libgsf/mingw32-libgsf-1.14.10-glib-deprecated.patch @@ -0,0 +1,14 @@ +--- libgsf-1.14.10.orig/gsf/gsf-utils.c 2008-07-01 13:56:53.000000000 +0100 ++++ libgsf-1.14.10.mingw/gsf/gsf-utils.c 2008-11-22 17:01:35.000000000 +0000 +@@ -19,6 +19,11 @@ + * USA + */ + ++/* Needed for G_WIN32_DLLMAIN_FOR_DLL_NAME below. Maybe a better ++ * solution would be to remove that macro use instead. ++ */ ++#undef G_DISABLE_DEPRECATED ++ + #include + #include + #include diff --git a/libgsf/mingw32-libgsf.spec b/libgsf/mingw32-libgsf.spec new file mode 100644 index 0000000..acf9063 --- /dev/null +++ b/libgsf/mingw32-libgsf.spec @@ -0,0 +1,105 @@ +%define __strip %{_mingw32_strip} +%define __objdump %{_mingw32_objdump} +%define _use_internal_dependency_generator 0 +%define __find_requires %{_mingw32_findrequires} +%define __find_provides %{_mingw32_findprovides} + +Name: mingw32-libgsf +Version: 1.14.10 +Release: 1%{?dist} +Summary: MinGW Windows port of GNOME Structured File Library + +License: LGPLv2 +Group: Development/Libraries + +URL: http://www.gnome.org/projects/libgsf/ +Source0: ftp://ftp.gnome.org/pub/GNOME/sources/libgsf/1.14/libgsf-%{version}.tar.bz2 + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch + +BuildRequires: mingw32-filesystem >= 35 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw32-glib2 +BuildRequires: mingw32-libxml2 +BuildRequires: mingw32-bzip2 >= 1.0.5-4 +BuildRequires: mingw32-gettext +BuildRequires: mingw32-iconv +BuildRequires: mingw32-zlib +# We don't have bonobo in MinGW yet: +#BuildRequires: mingw32-libbonobo +# We don't build Python packages yet: +#BuildRequires: mingw32-pygtk2 +# Seems like this is only needed for GNOME integration: +#BuildRequires: mingw32-gnome-vfs2 + +BuildRequires: autoconf, pkgconfig + +Patch1000: mingw32-libgsf-1.14.10-better-bz2-detection.patch +Patch1001: mingw32-libgsf-1.14.10-glib-deprecated.patch + + +%description +A library for reading and writing structured files (eg MS OLE and Zip). + +This is the MinGW Windows cross-compiled port of libgsf. + + +%prep +%setup -q -n libgsf-%{version} + +%patch1000 -p1 +%patch1001 -p1 + +autoconf + + +%build +%{_mingw32_configure} \ + --disable-gtk-doc --disable-static \ + --without-gnome-vfs --without-bonobo +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT + +export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 +make DESTDIR=$RPM_BUILD_ROOT install + +# Remove documentation which duplicates the Fedora native package. +rm -r $RPM_BUILD_ROOT%{_mingw32_datadir}/gtk-doc +rm -r $RPM_BUILD_ROOT%{_mingw32_mandir}/man1 + +# If native gconftool was installed then we will build the +# schemas. However those are not useful under Windows because +# we don't have gconf itself. Thus remove them if they were +# built. +rm -rf $RPM_BUILD_ROOT%{_mingw32_sysconfdir}/gconf + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root) +%{_mingw32_bindir}/gsf.exe +%{_mingw32_bindir}/gsf-office-thumbnailer.exe +%{_mingw32_bindir}/gsf-vba-dump.exe +%{_mingw32_bindir}/libgsf-1-114.dll +%{_mingw32_bindir}/libgsf-win32-1-114.dll +%{_mingw32_libdir}/libgsf-1.dll.a +%{_mingw32_libdir}/libgsf-1.la +%{_mingw32_libdir}/libgsf-win32-1.dll.a +%{_mingw32_libdir}/libgsf-win32-1.la +%{_mingw32_libdir}/pkgconfig/libgsf-1.pc +%{_mingw32_libdir}/pkgconfig/libgsf-win32-1.pc +%{_mingw32_includedir}/libgsf-1/ +%{_mingw32_datadir}/locale/*/LC_MESSAGES/libgsf.mo + + +%changelog +* Sat Nov 22 2008 Richard W.M. Jones - 1.14.10-1 +- Initial RPM release. -- 1.8.3.1