annotate scripts/win32/deploy_build.sh @ 296:b2a4358da16c

scripts/win32: CRLF -> LF this breaks win32 build scripts
author Paper <paper@paper.us.eu.org>
date Mon, 13 May 2024 02:48:39 -0400
parents 699a20c57dc8
children dec4d3c9a909
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
296
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
1 #!/bin/sh
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
2 #
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
3 # deploys needed libraries for minori on win32
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
4 #
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
5 # this also runs windeployqt to deploy qt crap
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
6 # as well
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
7
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
8 DIR="${DIR:-minori}"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
9
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
10 GetNeededLibraries() {
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
11 # do not run this on untrusted executables.
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
12 # see: ldd(1)
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
13 system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
14 ldd "$1" | while IFS="" read -r dependency; do
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
15 lib="$(printf -- "$dependency" | cut -d' ' -f3)"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
16 case $lib in
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
17 "/$system/"*)
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
18 printf -- "$lib\n"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
19 ;;
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
20 *)
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
21 ;;
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
22 esac
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
23 done
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
24 }
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
25
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
26
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
27 if [ -d "$DIR" ]; then
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
28 rm -r "$DIR"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
29 fi
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
30
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
31 mkdir "$DIR"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
32
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
33 for lib in $(GetNeededLibraries ".libs/minori.exe"); do
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
34 cp "$lib" "$DIR/"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
35 done
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
36
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
37 cp ".libs/minori.exe" "$DIR/"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
38
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
39 windeployqt "$DIR/minori.exe"
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
40
b2a4358da16c scripts/win32: CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 257
diff changeset
41 zip -r "$DIR.zip" "$DIR"