view scripts/win32/deploy_build.sh @ 299:246017a7907a

dep/animone: clean up OS X code GetProcessName() really belongs in fd.cc after removing the stupid unnecessary LaunchServices code that was stolen from... some library :)
author Paper <paper@paper.us.eu.org>
date Mon, 13 May 2024 14:15:47 -0400
parents dec4d3c9a909
children 8eb0cfe59992
line wrap: on
line source

#!/bin/sh
#
# deploys needed libraries for minori on win32
#
# this also runs windeployqt to deploy qt crap
# as well

DIR="${DIR:-minori}"

GetNeededLibraries() {
	# do not run this on untrusted executables.
	# see: ldd(1)
	system="$(echo "$MSYSTEM" | tr "[:upper:]" "[:lower:]")"
	ldd "$1" | while IFS="" read -r dependency; do
		lib="$(printf -- "$dependency" | cut -d' ' -f3)"
		case $lib in
			"/$system/"*)
				printf -- "$lib\n"
				;;
			*)
				;;
		esac
	done
}


if [ -d "$DIR" ]; then
	rm -r "$DIR"
fi

mkdir "$DIR"

for lib in $(GetNeededLibraries ".libs/minori.exe"); do
	echo "copying '$lib' to $DIR"
	cp "$lib" "$DIR/"
done

cp ".libs/minori.exe" "$DIR/"

windeployqt "$DIR/minori.exe"

zip -r "$DIR.zip" "$DIR"