_sed () {
case "${system_name}" in
- 'macos')
+ 'macos'|'freebsd')
gsed "${@}"
;;
*)
esac
}
-_cpr () {
+_cp () {
case "${system_name}" in
- 'macos')
- cp -R ${@}
+ 'macos'|'freebsd')
+ gcp -R --preserve=timestamps -H -L "${1}" "${2}"
;;
*)
- cp -R --preserve=timestamps ${@}
+ cp -R --preserve=timestamps -H -L "${1}" "${2}"
;;
esac
}
Multi::excludeLdd () {
case "${system_name}" in
- 'linux')
+ 'linux'|'freebsd')
# - always bundle built-in libraries
# - 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
| egrep -q '/libatk|/libgdk|/libgtk|/libgio|/libglib|/libgmodule|/libgobject|/libcairo|/libpango|/libfontconfig|/libfreetype'
then
Common::noOp
+ # FreeBSD specific
+ elif echo "${ldd_line}" \
+ | egrep -q '/libc++|/libgxxrt'
+ then
+ Common::noOp
else
echo "${ldd_line}"
fi
local exe_file="${1}"
case "${system_name}" in
- 'linux')
+ 'linux'|'freebsd')
ldd "${exe_file}"
;;
'windows')
Multi::getGtkThemeName () {
case "${system_name}" in
- 'linux')
+ 'linux'|'freebsd')
echo 'Adwaita'
;;
'windows')
Multi::getGtkLibName () {
case "${system_name}" in
- 'linux')
+ 'linux'|'freebsd')
echo 'libgtk-x11-2.0.so.0'
;;
'windows')
local lib_file="${1}"
case "${system_name}" in
- 'linux')
+ 'linux'|'freebsd')
echo "${lib_file}" \
| cut -f2 -d'/'
;;
local lib_file="${1}"
case "${system_name}" in
- 'linux')
+ 'linux'|'freebsd')
dirname "${lib_file}" \
| cut -f3- -d'/'
;;
local gtk_theme_name="${2}"
case "${system_name}" in
- 'linux'|'windows')
+ 'linux'|'freebsd'|'windows')
cat <<-EOF
share/themes/${gtk_theme_name}/gtk-2.0
share/icons/hicolor
esac
case "${system_name}" in
- 'linux')
+ 'linux'|'freebsd')
cat <<-EOF
${lib_prefix}/libatk-bridge-2.0.so.0
${lib_prefix}/libcanberra-0.30
mkdir -p "${bundle_dir}/$(dirname "${bundle_component_dir}")"
- _cpr -H -L \
+ _cp \
"${real_component_dir}" \
"${bundle_dir}/${bundle_component_dir}"
- touch -r \
- "/${real_component_dir}" \
- "${bundle_dir}/${bundle_component_dir}"
-
Multi::rewriteLoadersCache "${bundle_dir}/${bundle_component_dir}"
fi
done
continue
fi
- cp -H \
- "${lib_file}" \
- "${lib_dir}/${lib_basename}"
-
- touch -r \
+ _cp \
"${lib_file}" \
"${lib_dir}/${lib_basename}"
}
Multi::cleanUp () {
+ # Remove from bundle things that useless to be distributed,
+ # like headers or static libraries, also remove
+ # empty directories.
find "${bundle_dir}/lib" \
-type f \
-name '*.a' \
find "${bundle_dir}/lib" \
-depth \
-type d \
- -exec rmdir {} \; \
- || true
+ -empty \
+ -exec rmdir {} \;
}
Linux::getRpath () {
local exe_file="${1}"
local linux_rpath_string=$"$(Linux::getRpath "${exe_file}")"
+ chmod u+w,go-w "${exe_file}"
patchelf --set-rpath "${linux_rpath_string}" "${exe_file}"
}
| while read exe_file
do
Linux::patchExe "${exe_file}"
+ chmod ugo-x "${exe_file}"
done
}
Common::getPath "${exe_file}" > "${registry_dir}/$(uuidgen)"
exit
;;
- 'linux')
+ 'linux'|'freebsd')
exe_action='Linux::patchExe'
lib_action='Linux::patchLib'
;;