annotate scripts/win32/deploy_build.sh @ 244:3a4aa9b4814c

scripts: convert to use posix shell it's not like we even need bash anyway
author Paper <paper@paper.us.eu.org>
date Mon, 22 Jan 2024 22:19:39 -0800
parents ed5ab3896666
children 699a20c57dc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
243
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
1 #!/bin/sh
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
2 #
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
3 # deploys needed libraries for minori on win32
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
4 #
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
5 # this also runs windeployqt to deploy qt crap
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
6 # as well
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
7
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
8 DIR="${DIR:-minori}"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
9
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
10 GetNeededLibraries() {
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
11 # do not run this on untrusted executables.
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
12 # see: ldd(1)
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
13 ldd "$1" | while IFS="" read -r dependency; do
244
3a4aa9b4814c scripts: convert to use posix shell
Paper <paper@paper.us.eu.org>
parents: 243
diff changeset
14 lib="$(cut -d' ' -f3 <<< $dependency)"
243
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
15 if [[ "$lib" == /"${MSYSTEM,,}"/* ]]; then
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
16 echo "$lib"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
17 fi
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
18 done
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
19 }
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
20
244
3a4aa9b4814c scripts: convert to use posix shell
Paper <paper@paper.us.eu.org>
parents: 243
diff changeset
21
243
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
22 if [ -d "$DIR" ]; then
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
23 rm -r "$DIR"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
24 fi
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
25
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
26 mkdir "$DIR"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
27
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
28 for lib in $(GetNeededLibraries ".libs/minori.exe"); do
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
29 cp "$lib" "$DIR/"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
30 done
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
31
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
32 cp ".libs/minori.exe" "$DIR/"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
33
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
34 windeployqt "$DIR/minori.exe"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
35
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
36 zip -r "$DIR.zip" "$DIR"