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 src/svg src/sql src/qt3support
21 Summary: Qt for Windows
23 License: GPLv3 with exceptions or LGPLv2 with exceptions
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 Patch11: mingw32-qt-4.4.3-no-fpu-functions.patch
49 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
52 BuildRequires: mingw32-filesystem >= 35
53 BuildRequires: mingw32-gcc
54 BuildRequires: mingw32-gcc-c++
55 BuildRequires: mingw32-binutils
57 # For the native qmake, moc programs.
58 # Note that the precise same native version is required - eg. moc will
59 # not work unless it's the same version.
60 #BuildRequires: qt-devel = %{version} Stupid, can't write this ...
61 BuildRequires: qt-devel
64 BuildRequires: dos2unix
66 # This is required because we want qmake, but also because we
67 # install the cross-compile qmake specs into a directory owned
73 This package contains the Qt software toolkit for developing
74 cross-platform applications.
76 This is the Windows version of Qt, for use in conjunction with the
77 Fedora Windows cross-compiler.
81 %setup -q -n qt-win-opensource-src-%{version}
87 for f in LICENSE.GPL3 LICENSE.LGPL LGPL_EXCEPTION.txt KNOWN.ISSUES README; do
88 dos2unix --keepdate $f
91 # Override the .qmake.cache file.
93 sed -e s,@builddir@,$(pwd),g < %{SOURCE2} > .qmake.cache
95 # Cross-compilation qmake target.
96 mkdir mkspecs/fedora-win32-cross
97 cp %{SOURCE3} %{SOURCE4} mkspecs/fedora-win32-cross
101 for d in %{subdirs}; do
102 # Precompiled headers from a previous iteration of this loop
103 # cause the compiler deep confusion, so make sure any are removed
104 # _and_ the PCH directories are fresh and empty.
105 rm -rf tmp/obj/release_shared/qt_pch.h.gch
106 mkdir -p tmp/obj/release_shared/qt_pch.h.gch
107 rm -rf tmp/obj/release_shared/qt_gui_pch.h.gch
108 mkdir -p tmp/obj/release_shared/qt_gui_pch.h.gch
110 # Now build in this directory.
112 qmake-qt4 -win32 *.pro
119 rm -rf $RPM_BUILD_ROOT
121 for d in %{subdirs}; do
122 # As above ... WTF is Qt doing confusing make and make install??
123 rm -rf tmp/obj/release_shared/qt_pch.h.gch
124 mkdir -p tmp/obj/release_shared/qt_pch.h.gch
125 rm -rf tmp/obj/release_shared/qt_gui_pch.h.gch
126 mkdir -p tmp/obj/release_shared/qt_gui_pch.h.gch
129 make %{?_smp_mflags} INSTALL_ROOT=$RPM_BUILD_ROOT install
133 # Qt ignores our carefully configured directories and just
134 # puts stuff in default directories. Move them to the proper
136 # (Actually this may be because we are using the native qmake)
137 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
138 mv $RPM_BUILD_ROOT%{_includedir}/* $RPM_BUILD_ROOT%{_mingw32_includedir}
139 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
140 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
141 mv $RPM_BUILD_ROOT%{_libdir}/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
142 mv $RPM_BUILD_ROOT%{_libdir}/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
143 rm $RPM_BUILD_ROOT%{_libdir}/qt4/bin/*
144 rm $RPM_BUILD_ROOT%{_libdir}/*.prl
146 # Cross-compiler qmake specs.
147 mkdir -p $RPM_BUILD_ROOT%{_libdir}/qt4/mkspecs/fedora-win32-cross
148 cp %{SOURCE3} %{SOURCE4} \
149 $RPM_BUILD_ROOT%{_libdir}/qt4/mkspecs/fedora-win32-cross
153 rm -rf $RPM_BUILD_ROOT
157 %defattr(-,root,root)
158 %doc configure.output
159 %doc LICENSE.GPL3 LICENSE.LGPL LGPL_EXCEPTION.txt KNOWN.ISSUES README
160 %{_mingw32_bindir}/QtCore4.dll
161 %{_mingw32_bindir}/QtGui4.dll
162 %{_mingw32_bindir}/QtNetwork4.dll
163 %{_mingw32_bindir}/QtXml4.dll
164 %{_mingw32_bindir}/QtSvg4.dll
165 %{_mingw32_bindir}/QtSql4.dll
166 %{_mingw32_bindir}/Qt3Support4.dll
167 %{_mingw32_libdir}/libQtCore4.a
168 %{_mingw32_libdir}/libQtGui4.a
169 %{_mingw32_libdir}/libQtNetwork4.a
170 %{_mingw32_libdir}/libQtXml4.a
171 %{_mingw32_libdir}/libQtSvg4.a
172 %{_mingw32_libdir}/libQtSql4.a
173 %{_mingw32_libdir}/libQt3Support4.a
174 %{_mingw32_libdir}/libqtmain.a
175 %{_mingw32_includedir}/Qt/
176 %{_mingw32_includedir}/QtCore/
177 %{_mingw32_includedir}/QtGui/
178 %{_mingw32_includedir}/QtNetwork/
179 %{_mingw32_includedir}/QtXml/
180 %{_mingw32_includedir}/QtSvg/
181 %{_mingw32_includedir}/QtSql/
182 %{_mingw32_includedir}/Qt3Support/
183 %{_libdir}/qt4/mkspecs/fedora-win32-cross
187 * Thu Mar 12 2009 Thomas Sailer <t.sailer@alumni.ethz.ch> - 4.5.0-1
188 - update to Qt 4.5.0 (release)
189 - also build QtSvg, QtSql, Qt3Support
191 * Sat Feb 21 2009 Richard W.M. Jones <rjones@redhat.com> - 4.5.0-0.2.rc1
192 - Update to Qt 4.5.0-rc1.
194 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.3-4
195 - Rebuild for mingw32-gcc 4.4
197 * Fri Feb 6 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.3-3
198 - Fix required for older W32API in Fedora 10.
200 * Sun Feb 1 2009 Richard W.M. Jones <rjones@redhat.com> - 4.4.3-2
201 - Initial RPM release.