Mercurial > minori
annotate scripts/win32/deploy_build.sh @ 326:10096c5489e3
anime/db: refactor anime_season_db out
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Thu, 13 Jun 2024 00:42:00 -0400 |
| parents | 8eb0cfe59992 |
| children | 1faa72660932 |
| rev | line source |
|---|---|
| 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 | |
|
300
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
7 # |
|
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
8 # note: ldd is NOT a standard ldd; it's mingw-ldd |
|
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
9 # from pypi which works much well when cross |
|
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
10 # compiling using something like quasi-msys2 |
| 296 | 11 |
|
300
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
12 # you can override the paths to these at runtime |
| 296 | 13 DIR="${DIR:-minori}" |
|
300
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
14 LDD="${LDD:-mingw-ldd}" |
| 296 | 15 |
| 16 GetNeededLibraries() { | |
| 17 # do not run this on untrusted executables. | |
| 18 # see: ldd(1) | |
| 19 system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")" | |
|
300
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
20 "$LDD" --output-format ldd-like --dll-lookup-dirs "/$system/bin" -- "$1" | while IFS="" read -r dependency; do |
|
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
21 # trim whitespace, then get the value; mingw-ldd's "ldd-like" output doesn't use tabs like regular ldd |
|
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
22 lib="$(printf -- "%s" "$dependency" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | cut -d' ' -f3)" |
| 296 | 23 case $lib in |
| 24 "/$system/"*) | |
| 25 printf -- "$lib\n" | |
| 26 ;; | |
| 27 *) | |
| 28 ;; | |
| 29 esac | |
| 30 done | |
| 31 } | |
| 32 | |
| 33 | |
|
300
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
34 if test -d "$DIR"; then |
| 296 | 35 rm -r "$DIR" |
| 36 fi | |
| 37 | |
| 38 mkdir "$DIR" | |
| 39 | |
| 40 for lib in $(GetNeededLibraries ".libs/minori.exe"); do | |
|
298
dec4d3c9a909
scripts/win32/deploy_build: be more verbose with libs
Paper <paper@paper.us.eu.org>
parents:
296
diff
changeset
|
41 echo "copying '$lib' to $DIR" |
| 296 | 42 cp "$lib" "$DIR/" |
| 43 done | |
| 44 | |
| 45 cp ".libs/minori.exe" "$DIR/" | |
| 46 | |
| 47 windeployqt "$DIR/minori.exe" | |
| 48 | |
| 49 zip -r "$DIR.zip" "$DIR" |
