Update to 1.0.6 and switch to cdecl calling convention

- Update to 1.0.6
- Export all symbols using the cdecl calling convention instead of
  stdcall as it is also done by various other downstream distributors
  (like mingw.org and gnuwin32) and it resolves various autoconf and
  cmake detection issues (RHBZ #811909, RHBZ #812573)
- Added -static subpackages (RHBZ #665539)
This commit is contained in:
Erik van Pienbroek 2012-04-25 17:26:26 +02:00
parent 0759b5d10e
commit 764941630b
4 changed files with 107 additions and 11 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
bzip2-1.0.5.tar.gz
/bzip2-1.0.6.tar.gz

View File

@ -0,0 +1,64 @@
--- bzip2-1.0.5/bzlib.h 2007-12-09 13:34:39.000000000 +0100
+++ src/bzip2/1.0.5/bzip2-1.0.5/bzlib.h 2008-03-20 20:05:47.000000000 +0100
@@ -81,18 +81,52 @@
/* windows.h define small to char */
# undef small
# endif
-# ifdef BZ_EXPORT
-# define BZ_API(func) WINAPI func
-# define BZ_EXTERN extern
+//# ifdef BZ_EXPORT
+//# define BZ_API(func) WINAPI func
+//# define BZ_EXTERN extern
+//# else
+// /* import windows dll dynamically */
+//# define BZ_API(func) (WINAPI * func)
+//# define BZ_EXTERN
+//# endif
+//#else
+//# define BZ_API(func) func
+//# define BZ_EXTERN extern
+# include <stdio.h>
+# include <io.h>
+# include <sys/utime.h>
+# define fdopen _fdopen
+# define isatty _isatty
+# define setmode _setmode
+# define utime _utime
+# endif
+
+#ifndef __GNUC__
+# define __DLL_IMPORT__ __declspec(dllimport)
+# define __DLL_EXPORT__ __declspec(dllexport)
# else
- /* import windows dll dynamically */
-# define BZ_API(func) (WINAPI * func)
-# define BZ_EXTERN
+# define __DLL_IMPORT__ __attribute__((dllimport)) extern
+# define __DLL_EXPORT__ __attribute__((dllexport)) extern
# endif
-#else
-# define BZ_API(func) func
-# define BZ_EXTERN extern
+
+#if (defined __WIN32__) || (defined _WIN32)
+# if defined BUILD_BZIP2_DLL || defined BZ_EXPORT
+# define BZIP2_DLL_IMPEXP __DLL_EXPORT__
+# elif defined(BZIP2_STATIC)
+# define BZIP2_DLL_IMPEXP
+# elif defined (USE_BZIP2_DLL) || defined BZ_IMPORT
+# define BZIP2_DLL_IMPEXP __DLL_IMPORT__
+# elif defined (USE_BZIP2_STATIC)
+# define BZIP2_DLL_IMPEXP
+# else /* assume USE_BZIP2_DLL */
+# define BZIP2_DLL_IMPEXP __DLL_IMPORT__
#endif
+#else /* __WIN32__ */
+# define BZIP2_DLL_IMPEXP
+#endif
+
+#define BZ_API(func) func
+#define BZ_EXTERN BZIP2_DLL_IMPEXP
/*-- Core (low-level) library functions --*/

View File

@ -1,13 +1,8 @@
%?mingw_package_header
%global mingw_build_win32 1
%global mingw_build_win64 1
%define library_version 1.0.4
Name: mingw-bzip2
Version: 1.0.5
Release: 13%{?dist}
Version: 1.0.6
Release: 1%{?dist}
Summary: MinGW port of bzip2 file compression utility
License: BSD
@ -23,6 +18,13 @@ Patch10: mingw32-bzip2-1.0.5-slash.patch
Patch12: bzip2-1.0.5-autoconfiscated.patch
# Export all symbols using the cdecl calling convention instead of
# stdcall as it is also done by various other downstream distributors
# (like mingw.org and gnuwin32) and it resolves various autoconf and
# cmake detection issues (RHBZ #811909, RHBZ #812573)
# Patch is taken from the gnuwin32 project
Patch13: bzip2-use-cdecl-calling-convention.patch
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw32-gcc
@ -60,6 +62,13 @@ and compression capability.
This package contains development tools and libraries for use when
cross-compiling Windows software in Fedora.
%package -n mingw32-bzip2-static
Summary: Static library for mingw32-bzip2 development
Requires: mingw32-bzip2 = %{version}-%{release}
%description -n mingw32-bzip2-static
Static library for mingw32-bzip2 development.
# Win64
%package -n mingw64-bzip2
Summary: 64 Bit version of bzip2 for Windows
@ -76,6 +85,13 @@ and compression capability.
This package contains development tools and libraries for use when
cross-compiling Windows software in Fedora.
%package -n mingw64-bzip2-static
Summary: Static library for mingw64-bzip2 development
Requires: mingw64-bzip2 = %{version}-%{release}
%description -n mingw64-bzip2-static
Static library for mingw64-bzip2 development.
%?mingw_debug_package
@ -89,6 +105,8 @@ cross-compiling Windows software in Fedora.
%patch12 -p1 -b .autoconfiscated
%patch13 -p1 -b .cdecl
sh ./autogen.sh
@ -118,12 +136,11 @@ done
rm -r $RPM_BUILD_ROOT%{mingw32_mandir}/man1
rm -r $RPM_BUILD_ROOT%{mingw64_mandir}/man1
# Remove static libraries and libtool .la files.
rm $RPM_BUILD_ROOT%{mingw32_libdir}/libbz2.a
# Remove libtool .la files.
rm $RPM_BUILD_ROOT%{mingw32_libdir}/libbz2.la
rm $RPM_BUILD_ROOT%{mingw64_libdir}/libbz2.a
rm $RPM_BUILD_ROOT%{mingw64_libdir}/libbz2.la
# Win32
%files -n mingw32-bzip2
%doc COPYING
%{mingw32_bindir}/libbz2-1.dll
@ -142,7 +159,10 @@ rm $RPM_BUILD_ROOT%{mingw64_libdir}/libbz2.la
%{mingw32_libdir}/libbz2.dll.a
%{mingw32_libdir}/pkgconfig/bzip2.pc
%files -n mingw32-bzip2-static
%{mingw32_libdir}/libbz2.a
# Win64
%files -n mingw64-bzip2
%doc COPYING
%{mingw64_bindir}/libbz2-1.dll
@ -161,8 +181,19 @@ rm $RPM_BUILD_ROOT%{mingw64_libdir}/libbz2.la
%{mingw64_libdir}/libbz2.dll.a
%{mingw64_libdir}/pkgconfig/bzip2.pc
%files -n mingw64-bzip2-static
%{mingw64_libdir}/libbz2.a
%changelog
* Wed Apr 25 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 1.0.6-1
- Update to 1.0.6
- Export all symbols using the cdecl calling convention instead of
stdcall as it is also done by various other downstream distributors
(like mingw.org and gnuwin32) and it resolves various autoconf and
cmake detection issues (RHBZ #811909, RHBZ #812573)
- Added -static subpackages (RHBZ #665539)
* Fri Mar 16 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 1.0.5-13
- Added win64 support (contributed by Jay Higley)
- Added the autoconf patch from http://ftp.suse.com/pub/people/sbrabec/bzip2/

View File

@ -1 +1 @@
3c15a0c8d1d3ee1c46a1634d00617b1a bzip2-1.0.5.tar.gz
00b516f4704d4a7cb50a1d97e6e8e15b bzip2-1.0.6.tar.gz