1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
7 # NOTES, please read these carefully first:
9 # . We only build a few libraries at the moment, those listed in
10 # %{subdirs} below. We could build more without too much effort.
12 # . We should build our own qmake instead of relying on the one
13 # from the native Fedora package. The reason is so that we can
14 # set the default include and library paths correctly.
16 %define subdirs src/corelib src/xml src/network src/gui src/winmain
21 Summary: Qt for Windows
24 Group: Development/Libraries
26 URL: http://www.qtsoftware.com/
27 Source0: ftp://ftp.trolltech.no/qt/source/qt-win-opensource-src-%{version}.zip
29 # To make the configure patch - see below.
30 Source1: qt-win-configure.sh
32 # Override .qmake.cache
33 Source2: qmake.cache.in
35 # Special cross-compilation qmake target.
37 Source4: qplatformdefs.h
39 # Qt-win is supplied with a binary configure.exe. Although we have source
40 # for this, (a) it can't be compiled on Linux, and (b) we cannot run
41 # the Windows binary during the build. Instead we run the command by
42 # hand and create this diff to record what it did.
44 # Generate this patch using "qt-win-configure.sh".
45 Patch0: qt-win-configure.patch
47 # The released source contains multiple, blatant build bugs which have
48 # been fixed (further) upstream months ago. Urgghhh. These patches
50 Patch10: mingw32-qt-4.4.3-atomic-volatile.patch
51 Patch11: mingw32-qt-4.4.3-no-fpu-functions.patch
52 Patch12: mingw32-qt-4.4.3-wininput.patch
54 # http://lists-archives.org/mingw-users/11845-problem-compile-qt-4-4-2-with-latest-w32api.html
55 Patch20: mingw32-qt-4.4.3-subauth.patch
57 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
60 BuildRequires: mingw32-filesystem >= 35
61 BuildRequires: mingw32-gcc
62 BuildRequires: mingw32-gcc-c++
63 BuildRequires: mingw32-binutils
65 # For the native qmake, moc programs.
66 BuildRequires: qt-devel
68 BuildRequires: dos2unix
70 # This is required because we want qmake, but also because we
71 # install the cross-compile qmake specs into a directory owned
77 This package contains the Qt software toolkit for developing
78 cross-platform applications.
80 This is the Windows version of Qt, for use in conjunction with the
81 Fedora Windows cross-compiler.
85 %setup -q -n qt-win-opensource-src-%{version}
95 for f in changes-%{version} LICENSE.GPL2 LICENSE.GPL3 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT OPENSOURCE-NOTICE.TXT README; do
96 dos2unix --keepdate $f
99 # Override the .qmake.cache file.
101 sed -e s,@builddir@,$(pwd),g < %{SOURCE2} > .qmake.cache
103 # Cross-compilation qmake target.
104 mkdir mkspecs/fedora-win32-cross
105 cp %{SOURCE3} %{SOURCE4} mkspecs/fedora-win32-cross
109 for d in %{subdirs}; do
110 # Precompiled headers from a previous iteration of this loop
111 # cause the compiler deep confusion, so make sure any are removed
112 # _and_ the PCH directories are fresh and empty.
113 rm -rf tmp/obj/release_shared/qt_pch.h.gch
114 mkdir -p tmp/obj/release_shared/qt_pch.h.gch
115 rm -rf tmp/obj/release_shared/qt_gui_pch.h.gch
116 mkdir -p tmp/obj/release_shared/qt_gui_pch.h.gch
118 # Now build in this directory.
120 qmake-qt4 -win32 *.pro
127 rm -rf $RPM_BUILD_ROOT
129 for d in %{subdirs}; do
130 # As above ... WTF is Qt doing confusing make and make install??
131 rm -rf tmp/obj/release_shared/qt_pch.h.gch
132 mkdir -p tmp/obj/release_shared/qt_pch.h.gch
133 rm -rf tmp/obj/release_shared/qt_gui_pch.h.gch
134 mkdir -p tmp/obj/release_shared/qt_gui_pch.h.gch
137 make %{?_smp_mflags} INSTALL_ROOT=$RPM_BUILD_ROOT install
141 # Qt ignores our carefully configured directories and just
142 # puts stuff in default directories. Move them to the proper
144 # (Actually this may be because we are using the native qmake)
145 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
146 mv $RPM_BUILD_ROOT%{_includedir}/* $RPM_BUILD_ROOT%{_mingw32_includedir}
147 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
148 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
149 mv $RPM_BUILD_ROOT%{_libdir}/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
150 mv $RPM_BUILD_ROOT%{_libdir}/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
151 rm $RPM_BUILD_ROOT%{_libdir}/qt4/bin/*
152 rm $RPM_BUILD_ROOT%{_libdir}/*.prl
154 # Cross-compiler qmake specs.
155 mkdir -p $RPM_BUILD_ROOT%{_libdir}/qt4/mkspecs/fedora-win32-cross
156 cp %{SOURCE3} %{SOURCE4} \
157 $RPM_BUILD_ROOT%{_libdir}/qt4/mkspecs/fedora-win32-cross
161 rm -rf $RPM_BUILD_ROOT
165 %defattr(-,root,root)
166 %doc changes-%{version} configure.output
167 %doc LICENSE.GPL2 LICENSE.GPL3 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT
168 %doc OPENSOURCE-NOTICE.TXT README
169 %{_mingw32_bindir}/QtCore4.dll
170 %{_mingw32_bindir}/QtGui4.dll
171 %{_mingw32_bindir}/QtNetwork4.dll
172 %{_mingw32_bindir}/QtXml4.dll
173 %{_mingw32_libdir}/libQtCore4.a
174 %{_mingw32_libdir}/libQtGui4.a
175 %{_mingw32_libdir}/libQtNetwork4.a
176 %{_mingw32_libdir}/libQtXml4.a
177 %{_mingw32_libdir}/libqtmain.a
178 %{_mingw32_includedir}/Qt/
179 %{_mingw32_includedir}/QtCore/
180 %{_mingw32_includedir}/QtGui/
181 %{_mingw32_includedir}/QtNetwork/
182 %{_mingw32_includedir}/QtXml/
183 %{_libdir}/qt4/mkspecs/fedora-win32-cross
187 * Fri Feb 6 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.3-3
188 - Fix required for older W32API in Fedora 10.
190 * Sun Feb 1 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.3-2
191 - Initial RPM release.