3bfab935aac0728a81717cf704852ec10a476bac
[fedora-mingw.git] / qt-win / qt-win-configure.sh
1 #!/bin/bash -
2
3 # Before running this, you will need the following RPMs installed:
4 #   . wine
5 #   . qt-devel
6 #   . mingw32-filesystem
7 # and you need to have downloaded the source zip file.  Run this
8 # command from the RPM SOURCES directory in order to (re-)create
9 # qt-win-configure.patch
10
11 # Notes:
12 #   . -no-mmx is needed because we didn't enable MMX instructions
13 #     when building GCC (I think?).  The error is:
14 #     /usr/lib64/gcc/i686-pc-mingw32/4.3.2/include/mmintrin.h:35:3:
15 #     error: #error "MMX instruction set not enabled"
16 #   . Same as above for -no-sse and -no-sse2
17
18 version=4.5.0-rc1
19 platform=fedora-win32-cross
20
21 set -e
22
23 if [ ! -f qt-win-opensource-src-$version.zip -o \
24      ! -f qmake.conf -o \
25      ! -f qplatformdefs.h ]; then
26   echo "You're trying to run this from the wrong directory."
27   echo "Run it from the RPM SOURCES directory, or Fedora CVS checkout."
28   exit 1
29 fi
30
31 echo "Unpacking source file ... (this can take a minute or two)"
32
33 srcdir=qt-win-opensource-src-$version
34
35 rm -rf $srcdir.orig $srcdir
36
37 unzip -qq qt-win-opensource-src-$version.zip
38 cp -a $srcdir $srcdir.orig
39 mkdir $srcdir/mkspecs/fedora-win32-cross
40 cp qmake.conf qplatformdefs.h $srcdir/mkspecs/fedora-win32-cross
41
42 cd $srcdir
43
44 wine configure.exe \
45   -platform $platform \
46   -confirm-license \
47   -no-qmake \
48   -dont-process \
49   -prefix $(rpm --eval %{_mingw32_prefix}) \
50   -bindir $(rpm --eval %{_mingw32_bindir}) \
51   -datadir $(rpm --eval %{_mingw32_datadir}) \
52   -demosdir $(rpm --eval %{_mingw32_libdir})/qt4/demos \
53   -docdir $(rpm --eval %{_mingw32_docdir}) \
54   -examplesdir $(rpm --eval %{_mingw32_datadir})/qt4/examples \
55   -headerdir $(rpm --eval %{_mingw32_includedir}) \
56   -libdir $(rpm --eval %{_mingw32_libdir}) \
57   -plugindir $(rpm --eval %{_mingw32_libdir})/qt4/plugins \
58   -translationdir $(rpm --eval %{_mingw32_datadir})/qt4/translations \
59   -no-mmx -no-sse -no-sse2 \
60   -release \
61   -shared > configure.output 2>&1
62
63 cd ..
64
65 rm -r $srcdir/mkspecs/fedora-win32-cross
66
67 diff -urN $srcdir.orig $srcdir > qt-win-configure.patch ||:
68
69 rm -r $srcdir.orig $srcdir
70
71 echo qt-win-configure.patch successfully updated