]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - library-bundler
bundle: also bundle hicolor icons with libgtk
[xonotic/netradiant.git] / library-bundler
index ca95ae00863d86b2e42141b310979fee8a46bb24..7741e63e8e6ccce1780fd982e77302c4a4145452 100644 (file)
@@ -15,7 +15,36 @@ case "${system_name}" in
                | 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' \
+                                       'share/icons/hicolor' \
+                                       '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
                ;;
        *)