Mercurial > hg > syntilista
annotate build-win32.sh @ 235:20ce1339f36b
Remove text format copyright / license information in favour of the "HTML" formatted one.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 07 May 2018 18:36:55 +0300 |
parents | 07e7f254ef16 |
children | f65e0de45c2b |
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 |
227
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
2 INSTALL_USB="/mnt/sdb1" |
28
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 | 6 BUILDPATH="win32/" |
69 | 7 |
8 QT5_PREFIX="/misc/packages/qt5-src" | |
9 QT5_BASE="${QT5_PREFIX}/qtbase" | |
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" |
227
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
27 if test -d "$TARGET"; then |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
28 rm -fr "$TARGET" |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
29 else |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
30 echo "ERROR: Target '$TARGET' exists but is not a directory!" |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
31 return 1 |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
32 fi |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
33 if ! mkdir -p "$TARGET"; then |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
34 echo "ERROR: Could not create target directory '$TARGET'." |
28
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 return 1 |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
36 fi |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 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
|
39 |
69 | 40 do_cpinstall "$QT5_BASE/plugins/" "$TARGET" "platforms" "qwindows.dll" |
41 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
|
42 do_cpinstall "$QT5_BASE/plugins/" "$TARGET" "printsupport" "windowsprintersupport.dll" |
69 | 43 |
142
36c9cb759326
Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents:
114
diff
changeset
|
44 for i in Core Gui Sql Widgets PrintSupport Network; do |
69 | 45 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
|
46 done |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
48 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
|
49 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
|
50 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
|
51 done |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
53 cp -f "$BUILDPATH/Syntilista.exe" "$TARGET" |
235
20ce1339f36b
Remove text format copyright / license information in favour of the "HTML" formatted one.
Matti Hamalainen <ccr@tnsp.org>
parents:
227
diff
changeset
|
54 unix2dos -n "COPYING.html" "$TMPFILE" && cp -f "$TMPFILE" "$TARGET/COPYING.txt" |
72
cde3d200967c
Use temporary file for unix2dos because of exfat limitations causing warnings.
Matti Hamalainen <ccr@tnsp.org>
parents:
69
diff
changeset
|
55 rm -f "$TMPFILE" |
50 | 56 return 0 |
28
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
57 } |
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 |
29
0129b619511c
Check for qt5 crossbuild qmake before trying to build anything.
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
59 |
50 | 60 ### Create cross-building makefiles |
69 | 61 make -f Makefile.cross-mingw-win32 QT5_PREFIX="$QT5_PREFIX" BINPATH="$BUILDPATH" |
37 | 62 |
50 | 63 ### Install to targets |
227
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
64 if test -d "$INSTALL_USB" && mount|grep -q "$INSTALL_USB"; then |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
65 do_install "$INSTALL_USB/Syntilista" |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
66 else |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
67 echo "INFO: '$INSTALL_USB' is not mounted. Not installing." |
07e7f254ef16
Improve windows build script.
Matti Hamalainen <ccr@tnsp.org>
parents:
215
diff
changeset
|
68 fi |
28
b749685958d7
Add a script that performs the win32 cross-build (only the Syntilista
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
69 do_install "$INSTALL_WINE" |