Mercurial > minori
annotate scripts/win32/deploy_build.sh @ 366:886f66775f31
animone: add preliminary AT-SPI stuff
anime_list: finish the regular singular right click menu
author | Paper <paper@tflc.us> |
---|---|
date | Sun, 17 Nov 2024 19:56:01 -0500 |
parents | 1faa72660932 |
children |
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:]")" | |
343
1faa72660932
*: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents:
300
diff
changeset
|
20 "$LDD" --output-format ldd-like --dll-lookup-dirs "/$system/bin" "$PWD" -- "$1" | while IFS="" read -r dependency; do |
300
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)" |
343
1faa72660932
*: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents:
300
diff
changeset
|
23 if test "x$lib" != "xnot"; then |
1faa72660932
*: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents:
300
diff
changeset
|
24 printf -- "$lib\n" |
1faa72660932
*: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents:
300
diff
changeset
|
25 fi |
296 | 26 done |
27 } | |
28 | |
29 | |
300
8eb0cfe59992
CI/windows: attempt to fix the build
Paper <paper@paper.us.eu.org>
parents:
298
diff
changeset
|
30 if test -d "$DIR"; then |
296 | 31 rm -r "$DIR" |
32 fi | |
33 | |
34 mkdir "$DIR" | |
35 | |
343
1faa72660932
*: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents:
300
diff
changeset
|
36 for lib in $(GetNeededLibraries "minori.exe"); do |
298
dec4d3c9a909
scripts/win32/deploy_build: be more verbose with libs
Paper <paper@paper.us.eu.org>
parents:
296
diff
changeset
|
37 echo "copying '$lib' to $DIR" |
296 | 38 cp "$lib" "$DIR/" |
39 done | |
40 | |
343
1faa72660932
*: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents:
300
diff
changeset
|
41 cp "minori.exe" "$DIR/" |
296 | 42 |
43 windeployqt "$DIR/minori.exe" | |
44 | |
45 zip -r "$DIR.zip" "$DIR" |