From 4000d029b0b56bdf4fd872540b5f00328a4866af Mon Sep 17 00:00:00 2001 From: FabianLars Date: Mon, 22 Nov 2021 23:26:16 +0100 Subject: [PATCH 01/11] try to fix webkit --- linuxdeploy-plugin-gtk.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index f9e5bd3..2bf3b88 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -53,6 +53,7 @@ search_tool() { PATH_ARRAY=( "/usr/lib/$(uname -m)-linux-gnu/$directory/$tool" "/usr/lib/$directory/$tool" + "/usr/lib64/$directory/$tool"#fedora "/usr/bin/$tool" "/usr/bin/$tool-64" "/usr/bin/$tool-32" @@ -232,3 +233,8 @@ for directory in "${PATCH_ARRAY[@]}"; do patchelf --set-rpath '$ORIGIN/../../../..' "$APPDIR/$file" done < <(find "$directory" -name '*.so' -print0) done + +#binary patch absolute paths +#find usr/lib/ -type f -exec sed -i -e "s|/usr|././|g" {} \; +#binary patch absolute paths in libwebkit files +find usr/lib* -name libwebkit* -exec sed -i -e "s|/usr|././|g" '{}' \; From f516e400fbe167ff3a10fc4fc4c352472d7d6190 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Mon, 22 Nov 2021 23:29:10 +0100 Subject: [PATCH 02/11] where are we lol --- linuxdeploy-plugin-gtk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 2bf3b88..0fd11bb 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -235,6 +235,6 @@ for directory in "${PATCH_ARRAY[@]}"; do done #binary patch absolute paths -#find usr/lib/ -type f -exec sed -i -e "s|/usr|././|g" {} \; +#find $APPDIR/usr/lib/ -type f -exec sed -i -e "s|/usr|././|g" {} \; #binary patch absolute paths in libwebkit files -find usr/lib* -name libwebkit* -exec sed -i -e "s|/usr|././|g" '{}' \; +find $APPDIR/usr/lib* -name libwebkit* -exec sed -i -e "s|/usr|././|g" '{}' \; From 6d84bf355fed0850f77897f525f805d60f0f6f85 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 23 Nov 2021 21:02:35 +0100 Subject: [PATCH 03/11] remove lib64 from search_tool again --- linuxdeploy-plugin-gtk.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 0fd11bb..dda5a04 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -53,7 +53,6 @@ search_tool() { PATH_ARRAY=( "/usr/lib/$(uname -m)-linux-gnu/$directory/$tool" "/usr/lib/$directory/$tool" - "/usr/lib64/$directory/$tool"#fedora "/usr/bin/$tool" "/usr/bin/$tool-64" "/usr/bin/$tool-32" From ae6f542bbe69a257794ea8e73e1f56c45beb2776 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 23 Nov 2021 22:43:20 +0100 Subject: [PATCH 04/11] fix permission errors on fedora --- linuxdeploy-plugin-gtk.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index dda5a04..ebfe42b 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -98,6 +98,8 @@ if [ "$APPDIR" == "" ]; then fi mkdir -p "$APPDIR" +# make lib64 writable again. +chmod +w "$APPDIR"/usr/lib64 if command -v pkgconf > /dev/null; then PKG_CONFIG="pkgconf" @@ -233,7 +235,7 @@ for directory in "${PATCH_ARRAY[@]}"; do done < <(find "$directory" -name '*.so' -print0) done -#binary patch absolute paths -#find $APPDIR/usr/lib/ -type f -exec sed -i -e "s|/usr|././|g" {} \; +# set write permission on lib64 again to make it deletable. +chmod +w "$APPDIR"/usr/lib64 #binary patch absolute paths in libwebkit files find $APPDIR/usr/lib* -name libwebkit* -exec sed -i -e "s|/usr|././|g" '{}' \; From 147323eeed7d3fb6db6070d5969f7b01ba5806f6 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 23 Nov 2021 23:01:06 +0100 Subject: [PATCH 05/11] ignore chmod error (if dir doesnt exist) --- linuxdeploy-plugin-gtk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index ebfe42b..742c32d 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -99,7 +99,7 @@ fi mkdir -p "$APPDIR" # make lib64 writable again. -chmod +w "$APPDIR"/usr/lib64 +chmod +w "$APPDIR"/usr/lib64 2>/dev/null if command -v pkgconf > /dev/null; then PKG_CONFIG="pkgconf" @@ -236,6 +236,6 @@ for directory in "${PATCH_ARRAY[@]}"; do done # set write permission on lib64 again to make it deletable. -chmod +w "$APPDIR"/usr/lib64 +chmod +w "$APPDIR"/usr/lib64 2>/dev/null #binary patch absolute paths in libwebkit files find $APPDIR/usr/lib* -name libwebkit* -exec sed -i -e "s|/usr|././|g" '{}' \; From 9c374854776c37af0b82f32083bc0764d3f19261 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 23 Nov 2021 23:03:39 +0100 Subject: [PATCH 06/11] actually ignore chmod error without crashing the script --- linuxdeploy-plugin-gtk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 742c32d..30b46e9 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -99,7 +99,7 @@ fi mkdir -p "$APPDIR" # make lib64 writable again. -chmod +w "$APPDIR"/usr/lib64 2>/dev/null +chmod +w "$APPDIR"/usr/lib64 || true if command -v pkgconf > /dev/null; then PKG_CONFIG="pkgconf" @@ -236,6 +236,6 @@ for directory in "${PATCH_ARRAY[@]}"; do done # set write permission on lib64 again to make it deletable. -chmod +w "$APPDIR"/usr/lib64 2>/dev/null +chmod +w "$APPDIR"/usr/lib64 || true #binary patch absolute paths in libwebkit files find $APPDIR/usr/lib* -name libwebkit* -exec sed -i -e "s|/usr|././|g" '{}' \; From 01ae4f235585202e1514c7d91d7e0dbb8914fe9d Mon Sep 17 00:00:00 2001 From: FabianLars Date: Fri, 10 Dec 2021 21:45:47 +0100 Subject: [PATCH 07/11] add missing tls backend. overwrite gio modules dir --- linuxdeploy-plugin-gtk.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 30b46e9..8338fa4 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -237,5 +237,16 @@ done # set write permission on lib64 again to make it deletable. chmod +w "$APPDIR"/usr/lib64 || true + +# 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 +# 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) +cat >> "$HOOKFILE" < Date: Mon, 3 Jan 2022 12:40:07 +0100 Subject: [PATCH 08/11] always use gtk3. disable env var. --- linuxdeploy-plugin-gtk.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 14542f6..b1a0bd0 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -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() { @@ -85,7 +85,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 From f0cbf6313aa9a18ba68a609908188ed6f75852c5 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Mon, 3 Jan 2022 13:17:17 +0100 Subject: [PATCH 09/11] fix lint warnings --- linuxdeploy-plugin-gtk.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index b1a0bd0..73fbf9f 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -317,14 +317,14 @@ done chmod +w "$APPDIR"/usr/lib64 || true # 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 +find /usr/lib* -name libgiognutls.so -exec mkdir -p "$APPDIR"/"$(dirname '{}')" \; -exec cp --parents '{}' "$APPDIR/" \; || true # 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) cat >> "$HOOKFILE" < Date: Tue, 22 Mar 2022 13:01:15 +0100 Subject: [PATCH 10/11] fix GTK_PATH env var --- linuxdeploy-plugin-gtk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index f1f5e6a..0226fa7 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -205,7 +205,7 @@ 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" + #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" @@ -213,7 +213,7 @@ case "$DEPLOY_GTK_VERSION" in copy_tree "$gtk3_libdir" "$APPDIR/" cat >> "$HOOKFILE" < Date: Tue, 22 Mar 2022 14:20:24 +0100 Subject: [PATCH 11/11] add absolute paths to GTK_PATH --- linuxdeploy-plugin-gtk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 0226fa7..6cf35d2 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -213,7 +213,7 @@ case "$DEPLOY_GTK_VERSION" in copy_tree "$gtk3_libdir" "$APPDIR/" cat >> "$HOOKFILE" <