[mingw-dirac: 7/11] Fix mingw-w64 compatibility

epienbro epienbro at fedoraproject.org
Wed Mar 7 16:40:04 UTC 2012


commit a6d98ef569479e83ad623094d9127c2a555a828f
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Mon Feb 27 21:16:08 2012 +0100

    Fix mingw-w64 compatibility
    
    Dropped BR: mingw32-dlfcn as it's unneeded
    Fix compilation against latest mingw-w64 trunk

 dirac-1.0.2-mingw-w64-compatibility.patch |   12 ++++++++++++
 mingw32-dirac.spec                        |   11 ++++++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/dirac-1.0.2-mingw-w64-compatibility.patch b/dirac-1.0.2-mingw-w64-compatibility.patch
new file mode 100644
index 0000000..1b4fb1c
--- /dev/null
+++ b/dirac-1.0.2-mingw-w64-compatibility.patch
@@ -0,0 +1,12 @@
+--- util/conversion/common/setstdiomode.h.orig	2012-01-21 13:08:30.806899530 +0100
++++ util/conversion/common/setstdiomode.h	2012-01-21 13:10:14.231746427 +0100
+@@ -63,8 +63,8 @@
+ #define dirac_utilities_setstdiomode
+ 
+ #ifdef _WIN32
+-namespace dirac_vu { //dirac video utilities namespace
+ #include <fcntl.h>
++namespace dirac_vu { //dirac video utilities namespace
+ int _CRT_fmode = _O_BINARY;
+ }
+ #endif
diff --git a/mingw32-dirac.spec b/mingw32-dirac.spec
index 5f78d06..769508b 100644
--- a/mingw32-dirac.spec
+++ b/mingw32-dirac.spec
@@ -14,6 +14,7 @@ License:        MPLv1.1 or GPLv2+ or LGPLv2+
 URL:            http://dirac.sourceforge.net/
 Source0:        http://downloads.sourceforge.net/dirac/dirac-%{version}.tar.gz
 Patch0:         dirac-1.0.2-mingw32-gcc44.patch
+Patch1:         dirac-1.0.2-mingw-w64-compatibility.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
@@ -21,7 +22,6 @@ BuildRequires:  mingw32-filesystem >= 23
 BuildRequires:  mingw32-gcc
 BuildRequires:  mingw32-gcc-c++
 BuildRequires:  mingw32-binutils
-BuildRequires:  mingw32-dlfcn
 
 %description
 MinGW Windows dirac compression library.
@@ -30,10 +30,14 @@ MinGW Windows dirac compression library.
 %prep
 %setup -q -n dirac-%{version}
 %patch0 -p1 -b .gcc44
+%patch1 -p0 -b .mingw-w64
 rm util/conversion/common/setstdiomode.cpp
 touch util/conversion/common/setstdiomode.cpp
 
 %build
+# Make sure the compilation also succeeds when mingw32-cppunit is installed
+export ac_cv_header_cppunit_TestRunner_h=no
+
 %_mingw32_configure \
   --program-prefix=dirac_ \
   --program-transform-name=s,dirac_dirac_,dirac_, \
@@ -47,6 +51,9 @@ make %{?_smp_mflags}
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
 
+# Remove docs
+rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/doc
+rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/doc
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -69,6 +76,8 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Mon Feb 27 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 1.0.2-6
 - Rebuild against the mingw-w64 toolchain
+- Dropped BR: mingw32-dlfcn as it's unneeded
+- Fix compilation against latest mingw-w64 trunk
 
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.2-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild


More information about the scm-commits mailing list