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 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
57 BuildRequires: mingw32-filesystem >= 35
58 BuildRequires: mingw32-gcc
59 BuildRequires: mingw32-gcc-c++
60 BuildRequires: mingw32-binutils
62 # For the native qmake, moc programs.
63 BuildRequires: qt-devel
65 BuildRequires: dos2unix
67 # This is required because we want qmake, but also because we
68 # install the cross-compile qmake specs into a directory owned
74 This package contains the Qt software toolkit for developing
75 cross-platform applications.
77 This is the Windows version of Qt, for use in conjunction with the
78 Fedora Windows cross-compiler.
82 %setup -q -n qt-win-opensource-src-%{version}
90 for f in changes-%{version} LICENSE.GPL2 LICENSE.GPL3 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT OPENSOURCE-NOTICE.TXT README; do
91 dos2unix --keepdate $f
94 # Override the .qmake.cache file.
96 sed -e s,@builddir@,$(pwd),g < %{SOURCE2} > .qmake.cache
98 # Cross-compilation qmake target.
99 mkdir mkspecs/fedora-win32-cross
100 cp %{SOURCE3} %{SOURCE4} mkspecs/fedora-win32-cross
104 for d in %{subdirs}; do
105 # Precompiled headers from a previous iteration of this loop
106 # cause the compiler deep confusion, so make sure any are removed
107 # _and_ the PCH directories are fresh and empty.
108 rm -rf tmp/obj/release_shared/qt_pch.h.gch
109 mkdir -p tmp/obj/release_shared/qt_pch.h.gch
110 rm -rf tmp/obj/release_shared/qt_gui_pch.h.gch
111 mkdir -p tmp/obj/release_shared/qt_gui_pch.h.gch
113 # Now build in this directory.
115 qmake-qt4 -win32 *.pro
122 rm -rf $RPM_BUILD_ROOT
124 for d in %{subdirs}; do
125 # As above ... WTF is Qt doing confusing make and make install??
126 rm -rf tmp/obj/release_shared/qt_pch.h.gch
127 mkdir -p tmp/obj/release_shared/qt_pch.h.gch
128 rm -rf tmp/obj/release_shared/qt_gui_pch.h.gch
129 mkdir -p tmp/obj/release_shared/qt_gui_pch.h.gch
132 make %{?_smp_mflags} INSTALL_ROOT=$RPM_BUILD_ROOT install
136 # Qt ignores our carefully configured directories and just
137 # puts stuff in default directories. Move them to the proper
139 # (Actually this may be because we are using the native qmake)
140 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
141 mv $RPM_BUILD_ROOT%{_includedir}/* $RPM_BUILD_ROOT%{_mingw32_includedir}
142 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
143 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
144 mv $RPM_BUILD_ROOT%{_libdir}/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
145 mv $RPM_BUILD_ROOT%{_libdir}/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
146 rm $RPM_BUILD_ROOT%{_libdir}/qt4/bin/*
147 rm $RPM_BUILD_ROOT%{_libdir}/*.prl
149 # Cross-compiler qmake specs.
150 mkdir -p $RPM_BUILD_ROOT%{_libdir}/qt4/mkspecs/fedora-win32-cross
151 cp %{SOURCE3} %{SOURCE4} \
152 $RPM_BUILD_ROOT%{_libdir}/qt4/mkspecs/fedora-win32-cross
156 rm -rf $RPM_BUILD_ROOT
160 %defattr(-,root,root)
161 %doc changes-%{version} configure.output
162 %doc LICENSE.GPL2 LICENSE.GPL3 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT
163 %doc OPENSOURCE-NOTICE.TXT README
164 %{_mingw32_bindir}/QtCore4.dll
165 %{_mingw32_bindir}/QtGui4.dll
166 %{_mingw32_bindir}/QtNetwork4.dll
167 %{_mingw32_bindir}/QtXml4.dll
168 %{_mingw32_libdir}/libQtCore4.a
169 %{_mingw32_libdir}/libQtGui4.a
170 %{_mingw32_libdir}/libQtNetwork4.a
171 %{_mingw32_libdir}/libQtXml4.a
172 %{_mingw32_libdir}/libqtmain.a
173 %{_mingw32_includedir}/Qt/
174 %{_mingw32_includedir}/QtCore/
175 %{_mingw32_includedir}/QtGui/
176 %{_mingw32_includedir}/QtNetwork/
177 %{_mingw32_includedir}/QtXml/
178 %{_libdir}/qt4/mkspecs/fedora-win32-cross
182 * Sun Feb 1 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.3-2
183 - Initial RPM release.