From 742e2084af1a1aed79763491997060c91aecf14d Mon Sep 17 00:00:00 2001 From: klayoutmatthias Date: Mon, 7 Aug 2017 01:57:07 +0200 Subject: [PATCH] Fixed deployment script (DLL dependency computation). --- scripts/deploy-win-mingw.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/scripts/deploy-win-mingw.sh b/scripts/deploy-win-mingw.sh index 43ba7d031..bd830b628 100644 --- a/scripts/deploy-win-mingw.sh +++ b/scripts/deploy-win-mingw.sh @@ -94,14 +94,10 @@ if ! [ -e $target/klayout.exe ]; then fi # ---------------------------------------------------------- -# Binary dependencies +# Image formats -libs=$(ldd $target/klayout.exe | grep $mingw_inst | sed 's/ *=>.*//' | sort) - -for l in $libs; do - echo "Copying binary installation partial $mingw_inst/$l -> $target/$l .." - cp $mingw_inst/bin/$l $target/$l -done +echo "Installing image format plugins .." +cp -R $mingw_inst/share/qt5/plugins/imageformats $target # ---------------------------------------------------------- # Ruby dependencies @@ -136,12 +132,6 @@ done echo '' >>$target/.ruby-paths.txt echo ']' >>$target/.ruby-paths.txt -# ---------------------------------------------------------- -# Image formats - -echo "Installing image format plugins .." -cp -R $mingw_inst/share/qt5/plugins/imageformats $target - # ---------------------------------------------------------- # Python dependencies @@ -175,6 +165,19 @@ done echo '' >>$target/.python-paths.txt echo ']' >>$target/.python-paths.txt +# ---------------------------------------------------------- +# Binary dependencies + +# Analyze the dependencies of our components and add the corresponding libraries from $mingw_inst/bin +libs=$(find $target \( -name "*.dll" -or -name "*.so" \) -exec objdump -p "{}" ";" | grep "DLL Name:" | sort -u | sed 's/.*DLL Name: *//') + +for l in $libs; do + if [ -e $mingw_inst/bin/$l ]; then + echo "Copying binary installation partial $mingw_inst/bin/$l -> $target/$l .." + cp $mingw_inst/bin/$l $target/$l + fi +done + # ---------------------------------------------------------- # Run NSIS