annotate build-win32.sh @ 215:1abb318f7ae3

No need to run rm -f "$INSTALL_USB/syntilista.sqlite3" anymore.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 18 Dec 2017 11:32:51 +0200
parents 8b7199f6d658
children 07e7f254ef16
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #!/bin/sh
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 INSTALL_USB="/mnt/sdb1/Syntilista/"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 INSTALL_WINE="$HOME/.wine/drive_c/Syntilista/"
72
cde3d200967c Use temporary file for unix2dos because of exfat limitations causing warnings.
Matti Hamalainen <ccr@tnsp.org>
parents: 69
diff changeset
4 TMPFILE="unix2dos.tmp"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
6 BUILDPATH="win32/"
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
7
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
8 QT5_PREFIX="/misc/packages/qt5-src"
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
9 QT5_BASE="${QT5_PREFIX}/qtbase"
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
10
214
8b7199f6d658 Automatically determien MinGW path via gcc.
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
11 MINGWPATH=$(dirname $(i686-w64-mingw32-g++ -print-prog-name=cc1))
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 do_cpinstall()
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 {
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 # $1 src base path
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 # $2 dst base path
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 # $3 common sub path
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 # $4 filename
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 mkdir -p "$2/$3"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 cp -f "$1/$3/$4" "$2/$3/$4"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 }
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 do_install()
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 {
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 TARGET="$1"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 if test ! -d "$TARGET"; then
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 echo "ERROR: Target directory '$TARGET' does not exist."
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 return 1
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 fi
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 echo "Installing to '$TARGET' ..."
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
34 do_cpinstall "$QT5_BASE/plugins/" "$TARGET" "platforms" "qwindows.dll"
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
35 do_cpinstall "$QT5_BASE/plugins/" "$TARGET" "sqldrivers" "qsqlite.dll"
114
a5c8741b8662 Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents: 72
diff changeset
36 do_cpinstall "$QT5_BASE/plugins/" "$TARGET" "printsupport" "windowsprintersupport.dll"
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
37
142
36c9cb759326 Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents: 114
diff changeset
38 for i in Core Gui Sql Widgets PrintSupport Network; do
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
39 cp -f "$QT5_BASE/lib/Qt5$i.dll" "$TARGET"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 done
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 for i in libstdc++-6 libgcc_s_sjlj-1; do
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 cp -f "$MINGWPATH/$i.dll" "$TARGET"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 strip "$TARGET/$i.dll"
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 done
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 cp -f "$BUILDPATH/Syntilista.exe" "$TARGET"
72
cde3d200967c Use temporary file for unix2dos because of exfat limitations causing warnings.
Matti Hamalainen <ccr@tnsp.org>
parents: 69
diff changeset
48 unix2dos -n "COPYING" "$TMPFILE" && cp -f "$TMPFILE" "$TARGET/COPYING.txt"
cde3d200967c Use temporary file for unix2dos because of exfat limitations causing warnings.
Matti Hamalainen <ccr@tnsp.org>
parents: 69
diff changeset
49 rm -f "$TMPFILE"
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
50 return 0
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 }
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52
29
0129b619511c Check for qt5 crossbuild qmake before trying to build anything.
Matti Hamalainen <ccr@tnsp.org>
parents: 28
diff changeset
53
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
54 ### Create cross-building makefiles
69
a242548ccce8 Build system cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 59
diff changeset
55 make -f Makefile.cross-mingw-win32 QT5_PREFIX="$QT5_PREFIX" BINPATH="$BUILDPATH"
37
3d1990eb1020 Actually run qmake.
Matti Hamalainen <ccr@tnsp.org>
parents: 29
diff changeset
56
50
402446a76794 And more build system work.
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
57 ### Install to targets
215
1abb318f7ae3 No need to run rm -f "$INSTALL_USB/syntilista.sqlite3" anymore.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
58 do_install "$INSTALL_USB"
28
b749685958d7 Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 do_install "$INSTALL_WINE"