comparison scripts/win32/deploy_build.sh @ 300:8eb0cfe59992

CI/windows: attempt to fix the build
author Paper <paper@paper.us.eu.org>
date Mon, 13 May 2024 14:56:37 -0400
parents dec4d3c9a909
children 1faa72660932
comparison
equal deleted inserted replaced
299:246017a7907a 300:8eb0cfe59992
2 # 2 #
3 # deploys needed libraries for minori on win32 3 # deploys needed libraries for minori on win32
4 # 4 #
5 # this also runs windeployqt to deploy qt crap 5 # this also runs windeployqt to deploy qt crap
6 # as well 6 # as well
7 #
8 # note: ldd is NOT a standard ldd; it's mingw-ldd
9 # from pypi which works much well when cross
10 # compiling using something like quasi-msys2
7 11
12 # you can override the paths to these at runtime
8 DIR="${DIR:-minori}" 13 DIR="${DIR:-minori}"
14 LDD="${LDD:-mingw-ldd}"
9 15
10 GetNeededLibraries() { 16 GetNeededLibraries() {
11 # do not run this on untrusted executables. 17 # do not run this on untrusted executables.
12 # see: ldd(1) 18 # see: ldd(1)
13 system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")" 19 system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")"
14 ldd "$1" | while IFS="" read -r dependency; do 20 "$LDD" --output-format ldd-like --dll-lookup-dirs "/$system/bin" -- "$1" | while IFS="" read -r dependency; do
15 lib="$(printf -- "$dependency" | cut -d' ' -f3)" 21 # trim whitespace, then get the value; mingw-ldd's "ldd-like" output doesn't use tabs like regular ldd
22 lib="$(printf -- "%s" "$dependency" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | cut -d' ' -f3)"
16 case $lib in 23 case $lib in
17 "/$system/"*) 24 "/$system/"*)
18 printf -- "$lib\n" 25 printf -- "$lib\n"
19 ;; 26 ;;
20 *) 27 *)
22 esac 29 esac
23 done 30 done
24 } 31 }
25 32
26 33
27 if [ -d "$DIR" ]; then 34 if test -d "$DIR"; then
28 rm -r "$DIR" 35 rm -r "$DIR"
29 fi 36 fi
30 37
31 mkdir "$DIR" 38 mkdir "$DIR"
32 39