annotate scripts/win32/deploy_build.sh @ 269:3efac0541151

chore: merge
author Paper <paper@paper.us.eu.org>
date Fri, 12 Apr 2024 05:23:45 -0400
parents 699a20c57dc8
children b2a4358da16c
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)
257
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
13 system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")"
243
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
14 ldd "$1" | while IFS="" read -r dependency; do
257
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
15 lib="$(printf -- "$dependency" | cut -d' ' -f3)"
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
16 case $lib in
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
17 "/$system/"*)
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
18 printf -- "$lib\n"
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
19 ;;
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
20 *)
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
21 ;;
699a20c57dc8 scripts: Bourne shell compatibility
Paper <paper@paper.us.eu.org>
parents: 244
diff changeset
22 esac
243
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
23 done
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
24 }
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
25
244
3a4aa9b4814c scripts: convert to use posix shell
Paper <paper@paper.us.eu.org>
parents: 243
diff changeset
26
243
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
27 if [ -d "$DIR" ]; then
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
28 rm -r "$DIR"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
29 fi
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
30
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
31 mkdir "$DIR"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
32
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
33 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
34 cp "$lib" "$DIR/"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
35 done
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
36
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
37 cp ".libs/minori.exe" "$DIR/"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
38
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
39 windeployqt "$DIR/minori.exe"
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
40
ed5ab3896666 autotools: add `-mwindows` and windows deploy script
Paper <paper@paper.us.eu.org>
parents:
diff changeset
41 zip -r "$DIR.zip" "$DIR"