-
Notifications
You must be signed in to change notification settings - Fork 13
Fix libwebkit deployment #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4000d02
f516e40
6d84bf3
ae6f542
147323e
9c37485
01ae4f2
2975baf
1f3269b
66c99f6
f0cbf63
7ebaa48
1b87f10
f8cb22b
c273eb7
3f3a18d
c017fa2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,9 @@ show_usage() { | |
echo | ||
echo "Required variables:" | ||
echo " LINUXDEPLOY=\".../linuxdeploy\" path to linuxdeploy (e.g., AppImage); set automatically when plugin is run directly by linuxdeploy" | ||
echo | ||
echo "Optional variables:" | ||
echo " DEPLOY_GTK_VERSION (major version of GTK to deploy, e.g. '2', '3' or '4'; auto-detect by default)" | ||
#echo | ||
#echo "Optional variables:" | ||
#echo " DEPLOY_GTK_VERSION (major version of GTK to deploy, e.g. '2', '3' or '4'; auto-detect by default)" | ||
} | ||
|
||
variable_is_true() { | ||
|
@@ -86,7 +86,8 @@ search_tool() { | |
done | ||
} | ||
|
||
DEPLOY_GTK_VERSION="${DEPLOY_GTK_VERSION:-0}" # When not set by user, this variable use the integer '0' as a sentinel value | ||
#DEPLOY_GTK_VERSION="${DEPLOY_GTK_VERSION:-0}" # When not set by user, this variable use the integer '0' as a sentinel value | ||
DEPLOY_GTK_VERSION=3 # Force GTK3 for tauri apps | ||
APPDIR= | ||
|
||
while [ "$1" != "" ]; do | ||
|
@@ -119,6 +120,8 @@ if [ "$APPDIR" == "" ]; then | |
fi | ||
|
||
mkdir -p "$APPDIR" | ||
# make lib64 writable again. | ||
chmod +w "$APPDIR"/usr/lib64 || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not get it. As this point, |
||
|
||
if command -v pkgconf > /dev/null; then | ||
PKG_CONFIG="pkgconf" | ||
|
@@ -203,15 +206,15 @@ case "$DEPLOY_GTK_VERSION" in | |
echo "Installing GTK 3.0 modules" | ||
gtk3_exec_prefix="$(get_pkgconf_variable "exec_prefix" "gtk+-3.0")" | ||
gtk3_libdir="$(get_pkgconf_variable "libdir" "gtk+-3.0")/gtk-3.0" | ||
gtk3_path="$gtk3_libdir/modules" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand, the issue is |
||
#gtk3_path="$gtk3_libdir/modules" export GTK_PATH="\$APPDIR/$gtk3_path" | ||
gtk3_immodulesdir="$gtk3_libdir/$(get_pkgconf_variable "gtk_binary_version" "gtk+-3.0")/immodules" | ||
gtk3_printbackendsdir="$gtk3_libdir/$(get_pkgconf_variable "gtk_binary_version" "gtk+-3.0")/printbackends" | ||
gtk3_immodules_cache_file="$(dirname "$gtk3_immodulesdir")/immodules.cache" | ||
gtk3_immodules_query="$(search_tool "gtk-query-immodules-3.0" "libgtk-3-0")" | ||
copy_tree "$gtk3_libdir" "$APPDIR/" | ||
cat >> "$HOOKFILE" <<EOF | ||
export GTK_EXE_PREFIX="\$APPDIR/$gtk3_exec_prefix" | ||
export GTK_PATH="\$APPDIR/$gtk3_path" | ||
export GTK_PATH="\$APPDIR/$gtk3_libdir:/usr/lib64/gtk-3.0:/usr/lib/x86_64-linux-gnu/gtk-3.0" | ||
export GTK_IM_MODULE_FILE="\$APPDIR/$gtk3_immodules_cache_file" | ||
|
||
EOF | ||
|
@@ -305,3 +308,19 @@ for directory in "${PATCH_ARRAY[@]}"; do | |
ln $verbose -s "${file/\/usr\/lib\//}" "$APPDIR/usr/lib" | ||
done < <(find "$directory" -name '*.so' -print0) | ||
done | ||
|
||
# set write permission on lib64 again to make it deletable. | ||
chmod +w "$APPDIR"/usr/lib64 || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
# We have to copy the files first to not get permission errors when we assign gio_extras_dir | ||
find /usr/lib* -name libgiognutls.so -exec mkdir -p "$APPDIR"/"$(dirname '{}')" \; -exec cp --parents '{}' "$APPDIR/" \; || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like you are trying to perform a |
||
# related files that we seemingly don't need: | ||
# libgiolibproxy.so - libgiognomeproxy.so - glib-pacrunner | ||
|
||
gio_extras_dir=$(find "$APPDIR"/usr/lib* -name libgiognutls.so -exec dirname '{}' \; 2>/dev/null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not safe, it can returns multiples directories, like:
Use |
||
cat >> "$HOOKFILE" <<EOF | ||
export GIO_EXTRA_MODULES="\$APPDIR/${gio_extras_dir#"$APPDIR"/}" | ||
EOF | ||
|
||
#binary patch absolute paths in libwebkit files | ||
find "$APPDIR"/usr/lib* -name 'libwebkit*' -exec sed -i -e "s|/usr|././|g" '{}' \; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From where libwebkit pops up? I do not see any copy of this library before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you hardcoded
DEPLOY_GTK_VERSION
? You can setDEPLOY_GTK_VERSION=3
as an environment variable.