+Common::getPath () {
+ local file_path="${1}"
+
+ if command -v cygpath >/dev/null
+ then
+ if [ "${file_path}" = '-' ]
+ then
+ tr '\n' '\0' \
+ | xargs -0 -n1 -P1 -I{} \
+ cygpath --unix '{}'
+ else
+ cygpath --unix "${file_path}"
+ fi
+ else
+ if [ "${file_path}" = '-' ]
+ then
+ cat
+ else
+ printf '%s\n' "${file_path}"
+ fi
+ fi \
+ | sed -e 's|/*$||'
+}
+
+Common::grepLdd () {
+ egrep ' => '
+}
+
+Common::stripLdd () {
+ sed -e 's/ (0x[0-9a-f]*)$//;s/^.* => //'
+}
+
+Multi::excludeLdd () {
+ case "${system_name}" in
+ 'linux')
+ # - always rely on up-to-date x11 and gl libraries, bundling them will break on future distros
+ # - gtk is not easily bundlable on linux because it looks for harcoded system path to optional
+ # shared libraries like image codecs, theme engines, sound notification system, etc.
+ # so expect user to install gtk first
+ # - since we ask user to instal gtk, we can also ask them to install gtkglext,
+ # which is likely to pull gtk itself, x11 and gl dependencies
+ # - old fontconfig does not work correctly if newer fontconfig configuration is installed
+ # - if gtk and fontconfig is installed, pango and freetype are
+ egrep -v '/libc\.|/libstdc\+\+\.|/libdl\.|/libm\.|/libX|/libxcb|/libGL|/libICE\.|/libSM\.|/libpthread\.' \
+ | egrep -v '/libatk|/libgdk|/libgtk|/libgio|/libglib|/libgmodule|/libgobject|/libcairo|/libpango|/libfontconfig|/libfreetype'
+ ;;
+ 'windows')
+ egrep -i '\.dll => [A-Z]:\\msys64\\' \
+ ;;
+ esac
+}
+
+Multi::filterLib () {
+ Common::grepLdd \
+ | Multi::excludeLdd \
+ | Common::stripLdd \
+ | Common::getPath -
+}
+
+Multi::printLdd () {
+ local exe_file="${1}"
+
+ case "${system_name}" in
+ 'linux')
+ ldd "${exe_file}"
+ ;;
+ 'windows')
+ ntldd --recursive "${exe_file}"
+ ;;
+ esac
+}
+
+Multi::getGtkThemeName () {
+ case "${system_name}" in
+ 'linux')
+ echo 'Adwaita'
+ ;;
+ 'windows')
+ echo 'MS-Windows'
+ ;;
+ esac
+}
+
+Multi::getGtkLibName () {
+ case "${system_name}" in
+ 'linux')
+ echo 'libgtk-x11-2.0.so.0'
+ ;;
+ 'windows')
+ echo 'libgtk-win32-2.0-0.dll'
+ ;;
+ esac
+}
+
+Multi::getRootPrefix () {
+ local lib_file="${1}"
+
+ case "${system_name}" in
+ 'linux')
+ echo "${lib_file}" \
+ | cut -f2 -d'/'
+ ;;
+ 'windows')
+ basename "${lib_file}" \
+ | xargs -n1 -P1 which \
+ | cut -f2 -d'/'
+ ;;
+ esac
+}
+
+Multi::getLibPrefix () {
+ local lib_file="${1}"
+
+ case "${system_name}" in
+ 'linux')
+ dirname "${lib_file}" \
+ | cut -f3- -d'/'
+ ;;
+ 'windows')
+ echo 'lib'
+ ;;
+ esac
+}
+
+Multi::getGtkDeps () {
+ local lib_prefix="${1}"
+ local gtk_theme_name="${2}"