296
|
1 #!/bin/sh
|
|
2 #
|
|
3 # deploys needed libraries for minori on win32
|
|
4 #
|
|
5 # this also runs windeployqt to deploy qt crap
|
|
6 # as well
|
|
7
|
|
8 DIR="${DIR:-minori}"
|
|
9
|
|
10 GetNeededLibraries() {
|
|
11 # do not run this on untrusted executables.
|
|
12 # see: ldd(1)
|
|
13 system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")"
|
|
14 ldd "$1" | while IFS="" read -r dependency; do
|
|
15 lib="$(printf -- "$dependency" | cut -d' ' -f3)"
|
|
16 case $lib in
|
|
17 "/$system/"*)
|
|
18 printf -- "$lib\n"
|
|
19 ;;
|
|
20 *)
|
|
21 ;;
|
|
22 esac
|
|
23 done
|
|
24 }
|
|
25
|
|
26
|
|
27 if [ -d "$DIR" ]; then
|
|
28 rm -r "$DIR"
|
|
29 fi
|
|
30
|
|
31 mkdir "$DIR"
|
|
32
|
|
33 for lib in $(GetNeededLibraries ".libs/minori.exe"); do
|
|
34 cp "$lib" "$DIR/"
|
|
35 done
|
|
36
|
|
37 cp ".libs/minori.exe" "$DIR/"
|
|
38
|
|
39 windeployqt "$DIR/minori.exe"
|
|
40
|
|
41 zip -r "$DIR.zip" "$DIR"
|