X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=library-bundler;h=dccef52df8a5476441897496ae778ad90d578daa;hb=4cd8e40a8492955b65f6278e597a9b10f4ae7119;hp=b776c53297cea51163d358cc5511975b7287ceb3;hpb=de06ea449dfca5a3f0a5ad1f5bd91be0225d9d3e;p=xonotic%2Fnetradiant.git diff --git a/library-bundler b/library-bundler index b776c532..dccef52d 100644 --- a/library-bundler +++ b/library-bundler @@ -8,13 +8,42 @@ case "${system_name}" in 'windows') bundle_dir="$(cygpath --unix "${bundle_dir}")" exe_file="$(cygpath --unix "${exe_file}")" - ldd "${exe_file}" \ - | egrep -i '\.dll => /mingw64/' \ + ntldd --recursive "${exe_file}" \ + | egrep -i '\.dll => [A-Z]:\\msys64\\' \ | sed -e 's/ (0x[0-9a-f]*)$//;s/^.* => //' \ + | cygpath --unix --file - \ | while read dll_file do dll_basename="$(basename "${dll_file}")" - cp -n --preserve=timestamps "${dll_file}" "${bundle_dir}/${dll_basename}" + + if [ -f "${bundle_dir}/${dll_basename}" ] + then + continue + fi + + cp --preserve=timestamps "${dll_file}" "${bundle_dir}/${dll_basename}" + + if [ "${dll_basename}" = 'libgtk-win32-2.0-0.dll' ] + then + mingw="$(which 'libgtk-win32-2.0-0.dll' | cut -f2 -d'/')" + + for component_dir in \ + 'share/themes/MS-Windows' \ + 'lib/gdk-pixbuf-2.0' \ + 'lib/gtk-2.0' + do + if ! [ -d "${bundle_dir}/${component_dir}" ] + then + mkdir --parents "${bundle_dir}/$(dirname "${component_dir}")" + cp -r --preserve=timestamps "/${mingw}/${component_dir}" \ + "${bundle_dir}/${component_dir}" + fi + done + + find "${bundle_dir}/lib" -type f -name '*.a' -exec rm {} \; + find "${bundle_dir}/lib" -type f -name '*.h' -exec rm {} \; + find "${bundle_dir}/lib" -type d -exec rmdir --ignore-fail-on-non-empty {} \; + fi done ;; *)