Multi::excludeLdd () {
case "${system_name}" in
+ 'linux')
+ egrep -v '/libc\./|/libX|/libxcb|/libGL' \
+ | egrep -v '/libbsd\.|/libICE\.|/libselinux\.|/libSM.\.'
+ ;;
'windows')
egrep -i '\.dll => [A-Z]:\\msys64\\' \
;;
local exe_file="${1}"
case "${system_name}" in
+ 'linux')
+ ldd "${exe_file}"
+ ;;
'windows')
ntldd --recursive "${exe_file}"
;;
Multi::getGtkThemeName () {
case "${system_name}" in
+ 'linux')
+ echo 'Adwaita'
+ ;;
'windows')
echo 'MS-Windows'
;;
Multi::getGtkLibName () {
case "${system_name}" in
+ 'linux')
+ echo 'libgtk-x11-2.0.so.0'
+ ;;
'windows')
echo 'libgtk-win32-2.0-0.dll'
;;
local lib_file="${1}"
case "${system_name}" in
+ 'linux')
+ echo "${lib_file}" \
+ | cut -f2 -d'/'
+ ;;
'windows')
basename "${lib_file}" \
| xargs -n1 -P 1 which \
local lib_file="${1}"
case "${system_name}" in
+ 'linux')
+ dirname "${lib_file}" \
+ | cut -f3- -d'/'
+ ;;
'windows')
echo 'lib'
;;
-exec rmdir --ignore-fail-on-non-empty {} \;
}
+Linux::patchExe () {
+ local exe_file="${1}"
+
+ patchelf --set-rpath "${rpath_string}" "${exe_file}"
+}
+
+Linux::patchLib () {
+ local lib_dir="${1}"
+
+ find "${lib_dir}" \
+ -type f \
+ -name '*.so*' \
+ -exec patchelf --set-rpath "${rpath_string}" {} \;
+}
+
Windows::listLibForManifest () {
local lib_dir="${1}"
registry_dir="${bundle_dir}/registry"
lib_dir="${bundle_dir}/lib"
+manifest_file="${lib_dir}/lib.manifest"
+
rpath_string='@executable_path:lib'
+exe_action='Common::noOp'
lib_action='Common::noOp'
case "${system_name}" in
Common::getPath "${exe_file}" > "${registry_dir}/$(uuidgen)"
exit
;;
+ 'linux')
+ exe_action='Linux::patchExe'
+ lib_action='Linux::patchLib'
+ ;;
'windows')
lib_action='Windows::writeManifest'
;;
"${exe_action}" "${exe_file}"
rm "${registry_entry}"
+
+ "${exe_action}" "${exe_file}"
done
rmdir "${registry_dir}"