comparison scripts/win32/deploy_build.sh @ 249:6b2441c776dd

*: merge
author Paper <mrpapersonic@gmail.com>
date Wed, 24 Jan 2024 20:18:59 -0500
parents 3a4aa9b4814c
children 699a20c57dc8
comparison
equal deleted inserted replaced
248:cf47a8f687c0 249:6b2441c776dd
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 ldd "$1" | while IFS="" read -r dependency; do
14 lib="$(cut -d' ' -f3 <<< $dependency)"
15 if [[ "$lib" == /"${MSYSTEM,,}"/* ]]; then
16 echo "$lib"
17 fi
18 done
19 }
20
21
22 if [ -d "$DIR" ]; then
23 rm -r "$DIR"
24 fi
25
26 mkdir "$DIR"
27
28 for lib in $(GetNeededLibraries ".libs/minori.exe"); do
29 cp "$lib" "$DIR/"
30 done
31
32 cp ".libs/minori.exe" "$DIR/"
33
34 windeployqt "$DIR/minori.exe"
35
36 zip -r "$DIR.zip" "$DIR"