forked from torrent-file-editor/torrent-file-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-mxe-shared.sh
executable file
·115 lines (107 loc) · 4.29 KB
/
build-mxe-shared.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/bash
set -x
set -e
name=torrent-file-editor
exclude="debug debug-qt4 debug-qt5 release release-qt4 release-qt5 linux linux-qt4 linux-qt5 CMakeLists.txt.user build-mxe-shared.sh build-mxe-static.sh"
exclude=$(echo $exclude | sed -r 's/[^ ]+/-e &/g')
git clean -dfx . $exclude
if [ -x "$(command -v i686-w64-mingw32.shared-qmake-qt4)" ]; then
mkdir mxe32-qt4-shared
pushd mxe32-qt4-shared
i686-w64-mingw32.shared-cmake -DCMAKE_BUILD_TYPE=Release ..
make -j5
version=$(cat version)
destdir=../${name}-${version}-mxe-qt4-shared-x32
mkdir $destdir
mv ${name}.exe $destdir
libdir=$(i686-w64-mingw32.shared-qmake-qt4 -query QT_INSTALL_BINS)
cp $libdir/QtCore4.dll $destdir
cp $libdir/QtGui4.dll $destdir
cp $libdir/../../bin/libgcc_s_sjlj-1.dll $destdir
cp $libdir/../../bin/libpng16-16.dll $destdir
cp $libdir/../../bin/libqjson.dll $destdir
cp $libdir/../../bin/libstdc++-6.dll $destdir
cp $libdir/../../bin/zlib1.dll $destdir
popd
fi
if [ -x "$(command -v i686-w64-mingw32.shared-qmake-qt5)" ]; then
mkdir mxe32-qt5-shared
pushd mxe32-qt5-shared
i686-w64-mingw32.shared-cmake -DCMAKE_BUILD_TYPE=Release -DQT5_BUILD=ON ..
make -j5
version=$(cat version)
destdir=../${name}-${version}-mxe-qt5-shared-x32
mkdir $destdir
mv ${name}.exe $destdir
libdir=$(i686-w64-mingw32.shared-qmake-qt5 -query QT_INSTALL_BINS)
cp $libdir/Qt5Core.dll $destdir
cp $libdir/Qt5Gui.dll $destdir
cp $libdir/Qt5Widgets.dll $destdir
cp $libdir/../../bin/libbz2.dll $destdir
cp $libdir/../../bin/libfreetype-6.dll $destdir
cp $libdir/../../bin/libgcc_s_sjlj-1.dll $destdir
cp $libdir/../../bin/libglib-2.0-0.dll $destdir
cp $libdir/../../bin/libharfbuzz-0.dll $destdir
cp $libdir/../../bin/libiconv-2.dll $destdir
cp $libdir/../../bin/libintl-8.dll $destdir
cp $libdir/../../bin/libpcre-1.dll $destdir
cp $libdir/../../bin/libpcre2-16-0.dll $destdir
cp $libdir/../../bin/libpng16-16.dll $destdir
cp $libdir/../../bin/libstdc++-6.dll $destdir
cp $libdir/../../bin/zlib1.dll $destdir
mkdir $destdir/platforms
cp $libdir/../plugins/platforms/qwindows.dll $destdir/platforms
mkdir $destdir/styles
cp $libdir/../plugins/styles/qwindowsvistastyle.dll $destdir/styles
popd
fi
if [ -x "$(command -v x86_64-w64-mingw32.shared-qmake-qt4)" ]; then
mkdir mxe64-qt4-shared
pushd mxe64-qt4-shared
x86_64-w64-mingw32.shared-cmake -DCMAKE_BUILD_TYPE=Release ..
make -j5
version=$(cat version)
destdir=../${name}-${version}-mxe-qt4-shared-x64
mkdir $destdir
mv ${name}.exe $destdir
libdir=$(x86_64-w64-mingw32.shared-qmake-qt4 -query QT_INSTALL_BINS)
cp $libdir/QtCore4.dll $destdir
cp $libdir/QtGui4.dll $destdir
cp $libdir/../../bin/libgcc_s_seh-1.dll $destdir
cp $libdir/../../bin/libpng16-16.dll $destdir
cp $libdir/../../bin/libqjson.dll $destdir
cp $libdir/../../bin/libstdc++-6.dll $destdir
cp $libdir/../../bin/zlib1.dll $destdir
popd
fi
if [ -x "$(command -v x86_64-w64-mingw32.shared-qmake-qt5)" ]; then
mkdir mxe64-qt5-shared
pushd mxe64-qt5-shared
x86_64-w64-mingw32.shared-cmake -DCMAKE_BUILD_TYPE=Release -DQT5_BUILD=ON ..
make -j5
version=$(cat version)
destdir=../${name}-${version}-mxe-qt5-shared-x64
mkdir $destdir
mv ${name}.exe $destdir
libdir=$(x86_64-w64-mingw32.shared-qmake-qt5 -query QT_INSTALL_BINS)
cp $libdir/Qt5Core.dll $destdir
cp $libdir/Qt5Gui.dll $destdir
cp $libdir/Qt5Widgets.dll $destdir
cp $libdir/../../bin/libbz2.dll $destdir
cp $libdir/../../bin/libfreetype-6.dll $destdir
cp $libdir/../../bin/libgcc_s_seh-1.dll $destdir
cp $libdir/../../bin/libglib-2.0-0.dll $destdir
cp $libdir/../../bin/libharfbuzz-0.dll $destdir
cp $libdir/../../bin/libiconv-2.dll $destdir
cp $libdir/../../bin/libintl-8.dll $destdir
cp $libdir/../../bin/libpcre-1.dll $destdir
cp $libdir/../../bin/libpcre2-16-0.dll $destdir
cp $libdir/../../bin/libpng16-16.dll $destdir
cp $libdir/../../bin/libstdc++-6.dll $destdir
cp $libdir/../../bin/zlib1.dll $destdir
mkdir $destdir/platforms
cp $libdir/../plugins/platforms/qwindows.dll $destdir/platforms
mkdir $destdir/styles
cp $libdir/../plugins/styles/qwindowsvistastyle.dll $destdir/styles
popd
fi