From 9ce1d78a87fb6f5c4bbac13d757fbc3f4b97bc9c Mon Sep 17 00:00:00 2001 From: Dan Yeaw Date: Sat, 11 Jun 2022 11:15:07 -0400 Subject: [PATCH 01/25] Add Support for Typelib Packaging (#33) * Add support for installing girepository typelibs This allows for apps that use other language bindings to be packaged using linuxdeploy. For example, PyGObject uses the typelibs to introspect bindings for Python. * Add additional default pkg-config locations Use default locations for Ubuntu in case libgtk-3-dev and librsvg2-dev are not installed. A Python app wouldn't normally require these dependencies, so use default values as a fallback during packaging for linuxdeploy. * Fix failure if symbolic links already exist * Fix gobject-introspection-1.0 library not found The default typelib directory was incorrectly pointing to a location for rpm based distros which was causing CI to fail with a library not found error. * Add additional dependencies to test typelibs * Update dependencies for GTK4 to include typelibs --- .github/workflows/main.yml | 2 +- containers/gtk3/Dockerfile.debian | 3 ++- containers/gtk3/Dockerfile.fedora | 3 ++- containers/gtk3/Dockerfile.opensuse | 3 ++- containers/gtk3/Dockerfile.ubuntu | 3 ++- containers/gtk4/Dockerfile.debian | 2 +- containers/gtk4/Dockerfile.fedora | 3 ++- containers/gtk4/Dockerfile.opensuse | 3 ++- containers/gtk4/Dockerfile.ubuntu | 3 ++- linuxdeploy-plugin-gtk.sh | 37 +++++++++++++++++------------ 10 files changed, 38 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 122cdbd..5e1bf93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - name: Setup dependencies run: | sudo apt-get update -y -qq - sudo apt-get install -y -qq libgtk-3-0 libgtk-3-dev wget tree + sudo apt-get install -y -qq libgtk-3-0 libgtk-3-dev gir1.2-gtk-3.0 wget tree - name: Download external binairies run: | diff --git a/containers/gtk3/Dockerfile.debian b/containers/gtk3/Dockerfile.debian index 64b5e09..81221f0 100644 --- a/containers/gtk3/Dockerfile.debian +++ b/containers/gtk3/Dockerfile.debian @@ -6,7 +6,8 @@ ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ - apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 libgtk-3-dev gtk-3-examples + apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ + libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk3/Dockerfile.fedora b/containers/gtk3/Dockerfile.fedora index d15f4b0..e2366b2 100644 --- a/containers/gtk3/Dockerfile.fedora +++ b/containers/gtk3/Dockerfile.fedora @@ -2,7 +2,8 @@ FROM docker.io/fedora:latest AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ARG APPDIR=/AppDir -RUN dnf install -y wget librsvg2-devel file findutils pkgconfig gtk3 gtk3-devel +RUN dnf install -y wget librsvg2-devel file findutils pkgconfig gtk3 gtk3-devel \ + gobject-introspection-devel COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk3/Dockerfile.opensuse b/containers/gtk3/Dockerfile.opensuse index fdb1f43..79a99c1 100644 --- a/containers/gtk3/Dockerfile.opensuse +++ b/containers/gtk3/Dockerfile.opensuse @@ -2,7 +2,8 @@ FROM docker.io/opensuse/leap:15 AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ARG APPDIR=/AppDir -RUN zypper install -y wget librsvg2-devel file findutils pkg-config gtk3 gtk3-devel +RUN zypper install -y wget librsvg2-devel file findutils pkg-config gtk3 gtk3-devel \ + typelib-1_0-Gtk-3_0 gobject-introspection-devel COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk3/Dockerfile.ubuntu b/containers/gtk3/Dockerfile.ubuntu index 1fd145a..0e123ab 100644 --- a/containers/gtk3/Dockerfile.ubuntu +++ b/containers/gtk3/Dockerfile.ubuntu @@ -6,7 +6,8 @@ ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ - apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 libgtk-3-dev gtk-3-examples + apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ + libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk4/Dockerfile.debian b/containers/gtk4/Dockerfile.debian index 47e1dd9..26f1e42 100644 --- a/containers/gtk4/Dockerfile.debian +++ b/containers/gtk4/Dockerfile.debian @@ -8,7 +8,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config && \ - apt-get install -y -t experimental libgtk-4-1 libgtk-4-dev gtk-4-examples + apt-get install -y -t experimental libgtk-4-1 libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk4/Dockerfile.fedora b/containers/gtk4/Dockerfile.fedora index 7f5d506..023428d 100644 --- a/containers/gtk4/Dockerfile.fedora +++ b/containers/gtk4/Dockerfile.fedora @@ -2,7 +2,8 @@ FROM docker.io/fedora:latest AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ARG APPDIR=/AppDir -RUN dnf install -y wget librsvg2-devel file findutils pkgconfig gtk4 gtk4-devel gtk4-devel-tools +RUN dnf install -y wget librsvg2-devel file findutils pkgconfig gtk4 gtk4-devel gtk4-devel-tools \ + gobject-introspection-devel COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk4/Dockerfile.opensuse b/containers/gtk4/Dockerfile.opensuse index c49a890..9f92b90 100644 --- a/containers/gtk4/Dockerfile.opensuse +++ b/containers/gtk4/Dockerfile.opensuse @@ -3,7 +3,8 @@ FROM docker.io/opensuse/tumbleweed:latest AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ARG APPDIR=/AppDir -RUN zypper install -y wget librsvg2-devel file findutils pkg-config gtk4 gtk4-devel +RUN zypper install -y wget librsvg2-devel file findutils pkg-config gtk4 gtk4-devel \ + typelib-1_0-Gtk-4_0 gobject-introspection-devel COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk4/Dockerfile.ubuntu b/containers/gtk4/Dockerfile.ubuntu index abac85a..8ffe977 100644 --- a/containers/gtk4/Dockerfile.ubuntu +++ b/containers/gtk4/Dockerfile.ubuntu @@ -6,7 +6,8 @@ ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ - apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-4-1 libgtk-4-dev gtk-4-examples + apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-4-1 \ + libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 2d5a2a2..6683642 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -194,6 +194,13 @@ cat >> "$HOOKFILE" <> "$HOOKFILE" < Date: Sat, 11 Jun 2022 11:21:42 -0400 Subject: [PATCH 02/25] Add a how it works section to the README (#34) * Add a how it works section to the README * Fix formatting --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index f7aaa8c..400fd22 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,24 @@ This plugin requires the following dependencies in order to work properly: # call through linuxdeploy > ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --output appimage --icon-file mypackage.png --desktop-file mypackage.desktop ``` + + +## How it Works + +This plugin is written in bash and goes through a series of steps to make sure +that all the libraries and other files are pulled in for GTK apps to work +properly once in the AppImage. The steps include: + +1. Detects the GTK version to use +1. Installs itself as a hook in `$APPDIR/apprun-hooks` +1. Uses `gsettings` to set a light or dark adwaita theme +1. Installs the GLib schemas and then runs `glib-compile-schemas` on them +1. Installs the GIRepository typelibs for gobject-introspection +1. Copies the GTK libs and sets GTK path related environmental variables to +1 locations in the APPDIR +1. Updates the input method module registration (immodules) cache +1. Installs the GDK Pixbuf libraries and cache, and then updates the cache +1 using gdk-pixbuf-query-loaders +1. Installs additional libraries including Gdk, GObject, Gio, librsvg, Pango, +1 PangoCairo, and PangoFT2 +1. Manually sets the RPATH for the GTK modules From 55105be242389a904d5bbeb3f0b4d24cd95e79e6 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Thu, 1 Sep 2022 20:37:44 +0200 Subject: [PATCH 03/25] Instruct users to make the plugin executable --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 400fd22..a4f2cc0 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ This plugin requires the following dependencies in order to work properly: # get linuxdeploy and linuxdeploy-plugin-gtk > wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" > wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" +# make them executable so that we can call them (and also, plugins called from linuxdeploy are called like binaries) +> chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-gtk.sh # get list of variables > ./linuxdeploy-plugin-gtk.sh --help From d39bea455969783d8ca70f67d65617c14f4f2e38 Mon Sep 17 00:00:00 2001 From: iTrooz_ Date: Sun, 2 Oct 2022 21:50:32 +0200 Subject: [PATCH 04/25] Update Ubuntu gtk4 image --- containers/gtk4/Dockerfile.ubuntu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/gtk4/Dockerfile.ubuntu b/containers/gtk4/Dockerfile.ubuntu index 8ffe977..530bb67 100644 --- a/containers/gtk4/Dockerfile.ubuntu +++ b/containers/gtk4/Dockerfile.ubuntu @@ -1,4 +1,4 @@ -FROM docker.io/ubuntu:hirsute AS build-stage +FROM docker.io/ubuntu:jammy AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ENV DEBIAN_FRONTEND=noninteractive @@ -19,7 +19,7 @@ RUN ./linuxdeploy-x86_64.AppImage \ --desktop-file /usr/share/applications/org.gtk.WidgetFactory4.desktop \ --icon-file /usr/share/icons/hicolor/scalable/apps/org.gtk.WidgetFactory4.svg -FROM docker.io/ubuntu:hirsute +FROM docker.io/ubuntu:jammy VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 From e0d1f95519df53a1c5dca6abd278ac18a77a3d39 Mon Sep 17 00:00:00 2001 From: Xorg Date: Tue, 11 Oct 2022 12:54:36 +0200 Subject: [PATCH 05/25] Fix GTK_PATH This environment variable must not contains '/modules' at the end. Example: https://fr.mathworks.com/help/matlab/matlab_env/remove-canberra-gtk-module-and-pk-gtk-module-messages.html Related to tauri-apps/linuxdeploy-plugin-gtk#2 --- 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 6683642..6d89d4d 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -210,7 +210,7 @@ case "$DEPLOY_GTK_VERSION" in echo "Installing GTK 3.0 modules" gtk3_exec_prefix="$(get_pkgconf_variable "exec_prefix" "gtk+-3.0" "/usr")" gtk3_libdir="$(get_pkgconf_variable "libdir" "gtk+-3.0" "/usr/lib/x86_64-linux-gnu")/gtk-3.0" - gtk3_path="$gtk3_libdir/modules" + gtk3_path="$gtk3_libdir" gtk3_immodulesdir="$gtk3_libdir/$(get_pkgconf_variable "gtk_binary_version" "gtk+-3.0" "3.0.0")/immodules" gtk3_printbackendsdir="$gtk3_libdir/$(get_pkgconf_variable "gtk_binary_version" "gtk+-3.0" "3.0.0")/printbackends" gtk3_immodules_cache_file="$(dirname "$gtk3_immodulesdir")/immodules.cache" @@ -237,7 +237,7 @@ EOF echo "Installing GTK 4.0 modules" gtk4_exec_prefix="$(get_pkgconf_variable "exec_prefix" "gtk4" "/usr")" gtk4_libdir="$(get_pkgconf_variable "libdir" "gtk4")/gtk-4.0" - gtk4_path="$gtk4_libdir/modules" + gtk4_path="$gtk4_libdir" copy_tree "$gtk4_libdir" "$APPDIR/" cat >> "$HOOKFILE" < Date: Tue, 28 Feb 2023 20:03:43 +0100 Subject: [PATCH 06/25] Do not hardcode '/usr/lib/x86_64-linux-gnu' as fallback Fix #40 --------- Co-authored-by: TheAssassin --- .github/workflows/main.yml | 2 +- README.md | 1 + containers/gtk3/Dockerfile.ubuntu | 2 +- containers/gtk4/Dockerfile.ubuntu | 2 +- linuxdeploy-plugin-gtk.sh | 55 ++++++++++++++++++++----------- 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e1bf93..76b1641 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - name: Setup dependencies run: | sudo apt-get update -y -qq - sudo apt-get install -y -qq libgtk-3-0 libgtk-3-dev gir1.2-gtk-3.0 wget tree + sudo apt-get install -y -qq libgtk-3-0 libgtk-3-dev gir1.2-gtk-3.0 wget tree libgirepository1.0-dev libfuse2 - name: Download external binairies run: | diff --git a/README.md b/README.md index a4f2cc0..11de2cd 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ This plugin requires the following dependencies in order to work properly: - `pkg-config` or `pkgconf` command - librsvg2 development files - GTK development files +- GObject Introspection development files ## Usage diff --git a/containers/gtk3/Dockerfile.ubuntu b/containers/gtk3/Dockerfile.ubuntu index 0e123ab..af23025 100644 --- a/containers/gtk3/Dockerfile.ubuntu +++ b/containers/gtk3/Dockerfile.ubuntu @@ -7,7 +7,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ - libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 + libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libfuse2 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk4/Dockerfile.ubuntu b/containers/gtk4/Dockerfile.ubuntu index 530bb67..14b9589 100644 --- a/containers/gtk4/Dockerfile.ubuntu +++ b/containers/gtk4/Dockerfile.ubuntu @@ -7,7 +7,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-4-1 \ - libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 + libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libfuse2 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 6d89d4d..6e0ac93 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -11,10 +11,10 @@ if [ "$DEBUG" != "" ]; then verbose="--verbose" fi -script=$(readlink -f "$0") +SCRIPT="$(basename "$(readlink -f "$0")")" show_usage() { - echo "Usage: $script --appdir " + echo "Usage: $SCRIPT --appdir " echo echo "Bundles resources for applications that use GTK into an AppDir" echo @@ -38,13 +38,13 @@ variable_is_true() { get_pkgconf_variable() { local variable="$1" local library="$2" - local default_path="$3" + local default_value="$3" - path="$("$PKG_CONFIG" --variable="$variable" "$library")" - if [ -n "$path" ]; then - echo "$path" - elif [ -n "$default_path" ]; then - echo "$default_path" + pkgconfig_ret="$("$PKG_CONFIG" --variable="$variable" "$library")" + if [ -n "$pkgconfig_ret" ]; then + echo "$pkgconfig_ret" + elif [ -n "$default_value" ]; then + echo "$default_value" else echo "$0: there is no '$variable' variable for '$library' library." > /dev/stderr echo "Please check the '$library.pc' file is present in \$PKG_CONFIG_PATH (you may need to install the appropriate -dev/-devel package)." > /dev/stderr @@ -62,6 +62,20 @@ copy_tree() { done } +search_library_path() { + PATH_ARRAY=( + "/usr/lib/$(uname -m)-linux-gnu" + "/usr/lib" + ) + + for path in "${PATH_ARRAY[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done +} + search_tool() { local tool="$1" local directory="$2" @@ -128,6 +142,7 @@ else echo "$0: pkg-config/pkgconf not found in PATH, aborting" exit 1 fi +LD_GTK_LIBRARY_PATH="${LD_GTK_LIBRARY_PATH:-$(search_library_path)}" if ! command -v find &>/dev/null && ! type find &>/dev/null; then echo -e "$0: find not found.\nInstall findutils then re-run the plugin." @@ -195,7 +210,7 @@ export GSETTINGS_SCHEMA_DIR="\$APPDIR/$glib_schemasdir" EOF echo "Installing GIRepository Typelibs" -gi_typelibsdir="$(get_pkgconf_variable "typelibdir" "gobject-introspection-1.0" "/usr/lib/x86_64-linux-gnu/girepository-1.0")" +gi_typelibsdir="$(get_pkgconf_variable "typelibdir" "gobject-introspection-1.0" "$LD_GTK_LIBRARY_PATH/girepository-1.0")" copy_tree "$gi_typelibsdir" "$APPDIR/" cat >> "$HOOKFILE" < Date: Sun, 12 Mar 2023 22:23:09 +0800 Subject: [PATCH 07/25] Add some search paths and module deployments needed for RHEL-based builds. --- linuxdeploy-plugin-gtk.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 6e0ac93..8578f83 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -65,6 +65,7 @@ copy_tree() { search_library_path() { PATH_ARRAY=( "/usr/lib/$(uname -m)-linux-gnu" + "/usr/lib64" "/usr/lib" ) @@ -86,6 +87,7 @@ search_tool() { PATH_ARRAY=( "/usr/lib/$(uname -m)-linux-gnu/$directory/$tool" + "/usr/lib64/$directory/$tool" "/usr/lib/$directory/$tool" "/usr/bin/$tool" "/usr/bin/$tool-64" @@ -235,8 +237,8 @@ case "$DEPLOY_GTK_VERSION" in export GTK_EXE_PREFIX="\$APPDIR/$gtk3_exec_prefix" export GTK_PATH="\$APPDIR/$gtk3_path" export GTK_IM_MODULE_FILE="\$APPDIR/$gtk3_immodules_cache_file" - EOF + if [ -x "$gtk3_immodules_query" ]; then echo "Updating immodules cache in $APPDIR/$gtk3_immodules_cache_file" "$gtk3_immodules_query" > "$APPDIR/$gtk3_immodules_cache_file" @@ -296,6 +298,7 @@ pangocairo_libdir="$(get_pkgconf_variable "libdir" "pangocairo" "$LD_GTK_LIBRARY pangoft2_libdir="$(get_pkgconf_variable "libdir" "pangoft2" "$LD_GTK_LIBRARY_PATH")" FIND_ARRAY=( "$gdk_libdir" "libgdk_pixbuf-*.so*" + "$gdk_libdir" "libgdk-*.so*" "$gobject_libdir" "libgobject-*.so*" "$gio_libdir" "libgio-*.so*" "$librsvg_libdir" "librsvg-*.so*" From 5ce0401d92e5b1d77c677ad93a1923852e8e35c8 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 1 Apr 2023 14:45:49 +0800 Subject: [PATCH 08/25] Allow for RHEL-style /usr/lib64 paths in build filesystem (#45) * Ensure /usr/lib64 isn't used inside final AppImage. * Correct some additional lib64 paths. * Ensure path is quoted in case of spaces in path. * Correct symlink path. * Include the trailing slash in the matching path for symlinks. --- linuxdeploy-plugin-gtk.sh | 60 ++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 8578f83..c506690 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -62,6 +62,21 @@ copy_tree() { done } +copy_lib_tree() { + # The source lib directory could be /usr/lib, /usr/lib64, or /usr/lib/x86_64-linux-gnu + # Therefore, when copying lib directories, we need to transform that target path + # to a consistent /usr/lib + local src=("${@:1:$#-1}") + local dst="${*:$#}" + + for elem in "${src[@]}"; do + mkdir -p "${dst::-1}${elem/$LD_GTK_LIBRARY_PATH//usr/lib}" + pushd "$LD_GTK_LIBRARY_PATH" + cp "$(realpath --relative-to="$LD_GTK_LIBRARY_PATH" "$elem")" --archive --parents --target-directory="$dst/usr/lib" $verbose + popd + done +} + search_library_path() { PATH_ARRAY=( "/usr/lib/$(uname -m)-linux-gnu" @@ -213,9 +228,9 @@ EOF echo "Installing GIRepository Typelibs" gi_typelibsdir="$(get_pkgconf_variable "typelibdir" "gobject-introspection-1.0" "$LD_GTK_LIBRARY_PATH/girepository-1.0")" -copy_tree "$gi_typelibsdir" "$APPDIR/" +copy_lib_tree "$gi_typelibsdir" "$APPDIR/" cat >> "$HOOKFILE" <> "$HOOKFILE" < "$APPDIR/$gtk3_immodules_cache_file" + echo "Updating immodules cache in $APPDIR/${gtk3_immodules_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" + "$gtk3_immodules_query" > "$APPDIR/${gtk3_immodules_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" else echo "WARNING: gtk-query-immodules-3.0 not found" fi - if [ ! -f "$APPDIR/$gtk3_immodules_cache_file" ]; then + if [ ! -f "$APPDIR/${gtk3_immodules_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" ]; then echo "WARNING: immodules.cache file is missing" fi - sed -i "s|$gtk3_libdir/3.0.0/immodules/||g" "$APPDIR/$gtk3_immodules_cache_file" + sed -i "s|$gtk3_libdir/3.0.0/immodules/||g" "$APPDIR/${gtk3_immodules_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" ;; 4) echo "Installing GTK 4.0 modules" gtk4_exec_prefix="$(get_pkgconf_variable "exec_prefix" "gtk4" "/usr")" gtk4_libdir="$(get_pkgconf_variable "libdir" "gtk4")/gtk-4.0" gtk4_path="$gtk4_libdir" - copy_tree "$gtk4_libdir" "$APPDIR/" + copy_lib_tree "$gtk4_libdir" "$APPDIR/" cat >> "$HOOKFILE" <> "$HOOKFILE" < "$APPDIR/$gdk_pixbuf_cache_file" + echo "Updating pixbuf cache in $APPDIR/${gdk_pixbuf_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" + "$gdk_pixbuf_query" > "$APPDIR/${gdk_pixbuf_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" else echo "WARNING: gdk-pixbuf-query-loaders not found" fi -if [ ! -f "$APPDIR/$gdk_pixbuf_cache_file" ]; then +if [ ! -f "$APPDIR/${gdk_pixbuf_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" ]; then echo "WARNING: loaders.cache file is missing" fi -sed -i "s|$gdk_pixbuf_moduledir/||g" "$APPDIR/$gdk_pixbuf_cache_file" +sed -i "s|$gdk_pixbuf_moduledir/||g" "$APPDIR/${gdk_pixbuf_cache_file/$LD_GTK_LIBRARY_PATH//usr/lib}" echo "Copying more libraries" gobject_libdir="$(get_pkgconf_variable "libdir" "gobject-2.0" "$LD_GTK_LIBRARY_PATH")" @@ -297,11 +312,10 @@ pango_libdir="$(get_pkgconf_variable "libdir" "pango" "$LD_GTK_LIBRARY_PATH")" pangocairo_libdir="$(get_pkgconf_variable "libdir" "pangocairo" "$LD_GTK_LIBRARY_PATH")" pangoft2_libdir="$(get_pkgconf_variable "libdir" "pangoft2" "$LD_GTK_LIBRARY_PATH")" FIND_ARRAY=( - "$gdk_libdir" "libgdk_pixbuf-*.so*" - "$gdk_libdir" "libgdk-*.so*" - "$gobject_libdir" "libgobject-*.so*" - "$gio_libdir" "libgio-*.so*" - "$librsvg_libdir" "librsvg-*.so*" + "$gdk_libdir" "libgdk_pixbuf-*.so*" + "$gobject_libdir" "libgobject-*.so*" + "$gio_libdir" "libgio-*.so*" + "$librsvg_libdir" "librsvg-*.so*" "$pango_libdir" "libpango-*.so*" "$pangocairo_libdir" "libpangocairo-*.so*" "$pangoft2_libdir" "libpangoft2-*.so*" @@ -327,6 +341,6 @@ PATCH_ARRAY=( ) for directory in "${PATCH_ARRAY[@]}"; do while IFS= read -r -d '' file; do - ln $verbose -sf "${file/\/usr\/lib\//}" "$APPDIR/usr/lib" + ln $verbose -sf "${file/$LD_GTK_LIBRARY_PATH\//}" "$APPDIR/usr/lib" done < <(find "$directory" -name '*.so' -print0) done From 474c039b1ed4343617a2fb21aa6f803d84971538 Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Sat, 1 Apr 2023 17:22:01 -0400 Subject: [PATCH 09/25] Normalize APPDIR to absolute path --- linuxdeploy-plugin-gtk.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index c506690..612f902 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -149,6 +149,7 @@ if [ "$APPDIR" == "" ]; then exit 1 fi +APPDIR="$(realpath "$APPDIR")" mkdir -p "$APPDIR" if command -v pkgconf > /dev/null; then From 858e909e316fc9dee291ed7051677b8c7b41009e Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Sat, 1 Apr 2023 08:50:13 +0200 Subject: [PATCH 10/25] CI: update actions to Node.js 16 It fixes following warning: Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/upload-artifact@v2. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. --- .github/workflows/containers.yml | 4 ++-- .github/workflows/main.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 8cabdd1..f73ef03 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build container run: | @@ -31,7 +31,7 @@ jobs: -f "containers/${GTK_VERSION}/Dockerfile.${LINUX_DISTRO}" \ . - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{ matrix.linux-distro }} with ${{ matrix.gtk-version }} path: ${{ env.ARTIFACT_DIR }}/ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76b1641..5d3319a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: DEPLOY_GTK_VERSION: 3 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup dependencies run: | From 1f054c88fd3f0d9ee46b5d5079b4a3b31d4c051e Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Sat, 1 Apr 2023 09:05:56 +0200 Subject: [PATCH 11/25] CI: extract AppImage from container --- .github/workflows/containers.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index f73ef03..1489767 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -15,7 +15,9 @@ jobs: env: GTK_VERSION: ${{ matrix.gtk-version }} LINUX_DISTRO: ${{ matrix.linux-distro }} - ARTIFACT_DIR: "${{ github.workspace }}/AppImages" + IMAGE_NAME: "linuxdeploy-plugin-${{ matrix.gtk-version }}:${{ matrix.linux-distro }}" + CONTAINER_NAME: "${{ matrix.linux-distro }}-${{ matrix.gtk-version }}" + ARTIFACT_DIR: "${{ github.workspace }}/AppImage" steps: - name: Checkout @@ -23,13 +25,14 @@ jobs: - name: Build container run: | - mkdir -pv "${ARTIFACT_DIR}" - buildah bud \ - --squash \ - -v "${ARTIFACT_DIR}:/AppImage:rw,z,shared" \ - -t "linuxdeploy-plugin-${GTK_VERSION}:${LINUX_DISTRO}" \ - -f "containers/${GTK_VERSION}/Dockerfile.${LINUX_DISTRO}" \ - . + buildah bud --tag "${IMAGE_NAME}" --file "containers/${GTK_VERSION}/Dockerfile.${LINUX_DISTRO}" . + + - name: Extract AppImage from container + run: | + mkdir --verbose --parents "${ARTIFACT_DIR}" + podman run --name "${CONTAINER_NAME}" --interactive --detach --rm --entrypoint /bin/bash "${IMAGE_NAME}" + podman cp "${CONTAINER_NAME}:/AppImage/Widget_Factory-x86_64.AppImage" "${ARTIFACT_DIR}" + podman stop "${CONTAINER_NAME}" --time 0 - uses: actions/upload-artifact@v3 with: From fb06e22cf5f3e03ccb5d5230b76d64275ec04c69 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Wed, 5 Apr 2023 19:49:08 +0200 Subject: [PATCH 12/25] Use color-scheme instead of gtk-theme to check for light/dark theme Fix #48 --- linuxdeploy-plugin-gtk.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 612f902..106ea3f 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -208,7 +208,11 @@ mkdir -p "$HOOKSDIR" cat > "$HOOKFILE" <<\EOF #! /usr/bin/env bash -gsettings get org.gnome.desktop.interface gtk-theme 2> /dev/null | grep -qi "dark" && GTK_THEME_VARIANT="dark" || GTK_THEME_VARIANT="light" +case "$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null)" in + "'prefer-dark'") GTK_THEME_VARIANT="dark";; + "'prefer-light'") GTK_THEME_VARIANT="light";; + *) GTK_THEME_VARIANT="light";; +esac APPIMAGE_GTK_THEME="${APPIMAGE_GTK_THEME:-"Adwaita:$GTK_THEME_VARIANT"}" # Allow user to override theme (discouraged) export APPDIR="${APPDIR:-"$(dirname "$(realpath "$0")")"}" # Workaround to run extracted AppImage From e3450bfef6328a602e3b43295216c0595b9c77f5 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Fri, 21 Jul 2023 17:45:35 +0200 Subject: [PATCH 13/25] Fix search_library_path() on Debian i386 Fix #50 --- linuxdeploy-plugin-gtk.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 106ea3f..f5a5a20 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -77,9 +77,15 @@ copy_lib_tree() { done } +get_triplet() { + if command -v dpkg-architecture > /dev/null; then + dpkg-architecture -qDEB_HOST_MULTIARCH + fi +} + search_library_path() { PATH_ARRAY=( - "/usr/lib/$(uname -m)-linux-gnu" + "/usr/lib/$(get_triplet)" "/usr/lib64" "/usr/lib" ) @@ -101,7 +107,7 @@ search_tool() { fi PATH_ARRAY=( - "/usr/lib/$(uname -m)-linux-gnu/$directory/$tool" + "/usr/lib/$(get_triplet)/$directory/$tool" "/usr/lib64/$directory/$tool" "/usr/lib/$directory/$tool" "/usr/bin/$tool" @@ -152,6 +158,14 @@ fi APPDIR="$(realpath "$APPDIR")" mkdir -p "$APPDIR" +. /etc/os-release +if [ "$ID" = "debian" ] || [ "$ID" = "ubuntu" ]; then + if ! command -v dpkg-architecture &>/dev/null; then + echo -e "$0: dpkg-architecture not found.\nInstall dpkg-dev then re-run the plugin." + exit 1 + fi +fi + if command -v pkgconf > /dev/null; then PKG_CONFIG="pkgconf" elif command -v pkg-config > /dev/null; then From edfaf7d47631e628354ae29b09f29385ea4b88a0 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Fri, 21 Jul 2023 19:56:00 +0200 Subject: [PATCH 14/25] Update Debian gtk4 image --- containers/gtk4/Dockerfile.debian | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/containers/gtk4/Dockerfile.debian b/containers/gtk4/Dockerfile.debian index 26f1e42..b9b8458 100644 --- a/containers/gtk4/Dockerfile.debian +++ b/containers/gtk4/Dockerfile.debian @@ -1,5 +1,4 @@ -# GTK4 is not yet supported on Debian Stable -FROM docker.io/debian:experimental AS build-stage +FROM docker.io/debian:bookworm AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ENV DEBIAN_FRONTEND=noninteractive @@ -8,7 +7,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config && \ - apt-get install -y -t experimental libgtk-4-1 libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 + apt-get install -y libgtk-4-1 libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage @@ -20,7 +19,7 @@ RUN ./linuxdeploy-x86_64.AppImage \ --desktop-file /usr/share/applications/org.gtk.WidgetFactory4.desktop \ --icon-file /usr/share/icons/hicolor/scalable/apps/org.gtk.WidgetFactory4.svg -FROM docker.io/debian:experimental +FROM docker.io/debian:bookworm VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 From 167e4080c8210084390e2fdd652ccf13d696095b Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Wed, 26 Jul 2023 17:09:35 +0200 Subject: [PATCH 15/25] CI: fix dependencies for containers --- containers/gtk3/Dockerfile.debian | 2 +- containers/gtk3/Dockerfile.ubuntu | 2 +- containers/gtk4/Dockerfile.debian | 2 +- containers/gtk4/Dockerfile.ubuntu | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/containers/gtk3/Dockerfile.debian b/containers/gtk3/Dockerfile.debian index 81221f0..75608a6 100644 --- a/containers/gtk3/Dockerfile.debian +++ b/containers/gtk3/Dockerfile.debian @@ -7,7 +7,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ - libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 + libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libgirepository1.0-dev COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk3/Dockerfile.ubuntu b/containers/gtk3/Dockerfile.ubuntu index af23025..a9e4644 100644 --- a/containers/gtk3/Dockerfile.ubuntu +++ b/containers/gtk3/Dockerfile.ubuntu @@ -7,7 +7,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ - libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libfuse2 + libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libgirepository1.0-dev libfuse2 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk4/Dockerfile.debian b/containers/gtk4/Dockerfile.debian index b9b8458..828740c 100644 --- a/containers/gtk4/Dockerfile.debian +++ b/containers/gtk4/Dockerfile.debian @@ -7,7 +7,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config && \ - apt-get install -y libgtk-4-1 libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 + apt-get install -y libgtk-4-1 libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libgirepository1.0-dev COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage diff --git a/containers/gtk4/Dockerfile.ubuntu b/containers/gtk4/Dockerfile.ubuntu index 14b9589..442fc0f 100644 --- a/containers/gtk4/Dockerfile.ubuntu +++ b/containers/gtk4/Dockerfile.ubuntu @@ -7,7 +7,7 @@ ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-4-1 \ - libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libfuse2 + libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libgirepository1.0-dev libfuse2 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . RUN chmod +x *.sh *.AppImage From b27f3396aed2006b550be46407cef3928a18e9b9 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Wed, 26 Jul 2023 18:28:38 +0200 Subject: [PATCH 16/25] CI: install dpkg-dev package for Debian and Ubuntu --- .github/workflows/main.yml | 2 +- containers/gtk3/Dockerfile.debian | 2 +- containers/gtk3/Dockerfile.ubuntu | 2 +- containers/gtk4/Dockerfile.debian | 2 +- containers/gtk4/Dockerfile.ubuntu | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d3319a..956def0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - name: Setup dependencies run: | sudo apt-get update -y -qq - sudo apt-get install -y -qq libgtk-3-0 libgtk-3-dev gir1.2-gtk-3.0 wget tree libgirepository1.0-dev libfuse2 + sudo apt-get install -y -qq dpkg-dev libgtk-3-0 libgtk-3-dev gir1.2-gtk-3.0 wget tree libgirepository1.0-dev libfuse2 - name: Download external binairies run: | diff --git a/containers/gtk3/Dockerfile.debian b/containers/gtk3/Dockerfile.debian index 75608a6..9d91b36 100644 --- a/containers/gtk3/Dockerfile.debian +++ b/containers/gtk3/Dockerfile.debian @@ -6,7 +6,7 @@ ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ - apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ + apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libgirepository1.0-dev COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . diff --git a/containers/gtk3/Dockerfile.ubuntu b/containers/gtk3/Dockerfile.ubuntu index a9e4644..a349020 100644 --- a/containers/gtk3/Dockerfile.ubuntu +++ b/containers/gtk3/Dockerfile.ubuntu @@ -6,7 +6,7 @@ ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ - apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ + apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libgirepository1.0-dev libfuse2 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . diff --git a/containers/gtk4/Dockerfile.debian b/containers/gtk4/Dockerfile.debian index 828740c..0b68d5d 100644 --- a/containers/gtk4/Dockerfile.debian +++ b/containers/gtk4/Dockerfile.debian @@ -6,7 +6,7 @@ ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ - apt-get install -y wget librsvg2-dev file findutils pkg-config && \ + apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config && \ apt-get install -y libgtk-4-1 libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libgirepository1.0-dev COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . diff --git a/containers/gtk4/Dockerfile.ubuntu b/containers/gtk4/Dockerfile.ubuntu index 442fc0f..936cea5 100644 --- a/containers/gtk4/Dockerfile.ubuntu +++ b/containers/gtk4/Dockerfile.ubuntu @@ -6,7 +6,7 @@ ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone RUN apt-get update && \ - apt-get install -y wget librsvg2-dev file findutils pkg-config libgtk-4-1 \ + apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config libgtk-4-1 \ libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libgirepository1.0-dev libfuse2 COPY . . ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . From 5050cbb7865d3d75518b3baa4a6184ccafe54947 Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Wed, 26 Jul 2023 14:15:27 -0400 Subject: [PATCH 17/25] GTK library path handling fixes - Do not prioritize /usr/lib or /usr/lib64 if dpkg-architecture isn't found in the build environment - Normalize LD_GTK_LIBRARY_PATH to avoid opaque parameter substitution issues with its use later --- linuxdeploy-plugin-gtk.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index f5a5a20..3b11932 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -77,15 +77,17 @@ copy_lib_tree() { done } -get_triplet() { +get_triplet_path() { if command -v dpkg-architecture > /dev/null; then - dpkg-architecture -qDEB_HOST_MULTIARCH + echo "/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" fi } + + search_library_path() { PATH_ARRAY=( - "/usr/lib/$(get_triplet)" + "$(get_triplet_path)" "/usr/lib64" "/usr/lib" ) @@ -174,7 +176,9 @@ else echo "$0: pkg-config/pkgconf not found in PATH, aborting" exit 1 fi -LD_GTK_LIBRARY_PATH="${LD_GTK_LIBRARY_PATH:-$(search_library_path)}" + +# GTK's library path *must not* have a trailing slash for later parameter substitution to work properly +LD_GTK_LIBRARY_PATH="$(realpath "${LD_GTK_LIBRARY_PATH:-$(search_library_path)}")" if ! command -v find &>/dev/null && ! type find &>/dev/null; then echo -e "$0: find not found.\nInstall findutils then re-run the plugin." From 97290a3e374381e9fa7983ba098729a37076f3ed Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Mon, 31 Jul 2023 08:48:24 -0400 Subject: [PATCH 18/25] Fix multiarch triplet library for `search_tool` --- 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 3b11932..8636e97 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -109,7 +109,7 @@ search_tool() { fi PATH_ARRAY=( - "/usr/lib/$(get_triplet)/$directory/$tool" + "$(get_triplet_path)/$directory/$tool" "/usr/lib64/$directory/$tool" "/usr/lib/$directory/$tool" "/usr/bin/$tool" From 221b680aeabb51d103fffc97f9d550373bd52fa0 Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Sun, 17 Sep 2023 19:50:05 +0800 Subject: [PATCH 19/25] Prefer color-scheme from org.freedesktop.portal.Desktop In some distros GNOME 42 or later versions are not available, thus querying color-scheme will return an error. --- linuxdeploy-plugin-gtk.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/linuxdeploy-plugin-gtk.sh b/linuxdeploy-plugin-gtk.sh index 8636e97..41d8c18 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -226,10 +226,14 @@ mkdir -p "$HOOKSDIR" cat > "$HOOKFILE" <<\EOF #! /usr/bin/env bash -case "$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null)" in - "'prefer-dark'") GTK_THEME_VARIANT="dark";; - "'prefer-light'") GTK_THEME_VARIANT="light";; - *) GTK_THEME_VARIANT="light";; +COLOR_SCHEME="$(dbus-send --session --dest=org.freedesktop.portal.Desktop --type=method_call --print-reply --reply-timeout=1000 /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read 'string:org.freedesktop.appearance' 'string:color-scheme' 2>/dev/null | tail -n1 | cut -b35- | cut -d' ' -f2)" +if [ -z "$COLOR_SCHEME" ]; then + COLOR_SCHEME="$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null)" +fi +case "$COLOR_SCHEME" in + "1"|"'prefer-dark'") GTK_THEME_VARIANT="dark";; + "2"|"'prefer-light'") GTK_THEME_VARIANT="light";; + *) GTK_THEME_VARIANT="light";; esac APPIMAGE_GTK_THEME="${APPIMAGE_GTK_THEME:-"Adwaita:$GTK_THEME_VARIANT"}" # Allow user to override theme (discouraged) From c08d598b5099486ec39c9b47c1d38053c19ddbc7 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Thu, 27 Jul 2023 11:46:51 +0200 Subject: [PATCH 20/25] CI: add support for more arch --- .github/workflows/containers.yml | 28 ++++++++++++++++++++++------ containers/gtk3/Dockerfile.debian | 12 +++++++----- containers/gtk3/Dockerfile.fedora | 12 +++++++----- containers/gtk3/Dockerfile.opensuse | 12 +++++++----- containers/gtk3/Dockerfile.ubuntu | 12 +++++++----- containers/gtk4/Dockerfile.debian | 12 +++++++----- containers/gtk4/Dockerfile.fedora | 12 +++++++----- containers/gtk4/Dockerfile.opensuse | 12 +++++++----- containers/gtk4/Dockerfile.ubuntu | 12 +++++++----- 9 files changed, 78 insertions(+), 46 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 1489767..4b769d0 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -8,13 +8,22 @@ jobs: matrix: gtk-version: [gtk3, gtk4] linux-distro: [debian, fedora, opensuse, ubuntu] - - name: ${{ matrix.linux-distro }} ${{ matrix.gtk-version }} + arch: [amd64] + include: + - gtk-version: gtk3 + linux-distro: debian + arch: 386 + - gtk-version: gtk4 + linux-distro: debian + arch: 386 + + name: ${{ matrix.linux-distro }} ${{ matrix.arch }} ${{ matrix.gtk-version }} runs-on: ubuntu-latest env: GTK_VERSION: ${{ matrix.gtk-version }} LINUX_DISTRO: ${{ matrix.linux-distro }} + ARCHITECTURE: ${{ matrix.arch }} IMAGE_NAME: "linuxdeploy-plugin-${{ matrix.gtk-version }}:${{ matrix.linux-distro }}" CONTAINER_NAME: "${{ matrix.linux-distro }}-${{ matrix.gtk-version }}" ARTIFACT_DIR: "${{ github.workspace }}/AppImage" @@ -23,19 +32,26 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Set extra environment variables + run: | + case "${ARCHITECTURE}" in + 386) echo MACHINE="i386" >> "$GITHUB_ENV";; + amd64) echo MACHINE="x86_64" >> "$GITHUB_ENV";; + esac + - name: Build container run: | - buildah bud --tag "${IMAGE_NAME}" --file "containers/${GTK_VERSION}/Dockerfile.${LINUX_DISTRO}" . + buildah bud --arch="${ARCHITECTURE}" --build-arg MACHINE="${MACHINE}" --tag "${IMAGE_NAME}" --file "containers/${GTK_VERSION}/Dockerfile.${LINUX_DISTRO}" . - name: Extract AppImage from container run: | mkdir --verbose --parents "${ARTIFACT_DIR}" - podman run --name "${CONTAINER_NAME}" --interactive --detach --rm --entrypoint /bin/bash "${IMAGE_NAME}" - podman cp "${CONTAINER_NAME}:/AppImage/Widget_Factory-x86_64.AppImage" "${ARTIFACT_DIR}" + podman run --arch="${ARCHITECTURE}" --name "${CONTAINER_NAME}" --interactive --detach --rm --entrypoint /bin/bash "${IMAGE_NAME}" + podman cp "${CONTAINER_NAME}:/AppImage/Widget_Factory.AppImage" "${ARTIFACT_DIR}" podman stop "${CONTAINER_NAME}" --time 0 - uses: actions/upload-artifact@v3 with: - name: ${{ matrix.linux-distro }} with ${{ matrix.gtk-version }} + name: ${{ matrix.gtk-version }}_${{ matrix.linux-distro }}_${{ env.MACHINE }} path: ${{ env.ARTIFACT_DIR }}/ retention-days: 30 diff --git a/containers/gtk3/Dockerfile.debian b/containers/gtk3/Dockerfile.debian index 9d91b36..66ea9f4 100644 --- a/containers/gtk3/Dockerfile.debian +++ b/containers/gtk3/Dockerfile.debian @@ -2,6 +2,7 @@ FROM docker.io/debian:buster AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ENV DEBIAN_FRONTEND=noninteractive +ARG MACHINE=x86_64 ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone @@ -9,9 +10,9 @@ RUN apt-get update && \ apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libgirepository1.0-dev COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage -RUN ./linuxdeploy-x86_64.AppImage \ +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" "linuxdeploy-${MACHINE}.AppImage" +RUN chmod --verbose +x *.sh *.AppImage +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -23,5 +24,6 @@ FROM docker.io/debian:buster VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] diff --git a/containers/gtk3/Dockerfile.fedora b/containers/gtk3/Dockerfile.fedora index e2366b2..0bc849a 100644 --- a/containers/gtk3/Dockerfile.fedora +++ b/containers/gtk3/Dockerfile.fedora @@ -1,14 +1,15 @@ FROM docker.io/fedora:latest AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 +ARG MACHINE=x86_64 ARG APPDIR=/AppDir RUN dnf install -y wget librsvg2-devel file findutils pkgconfig gtk3 gtk3-devel \ gobject-introspection-devel COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" . +RUN chmod --verbose +x *.sh *.AppImage RUN gtk-query-immodules-3.0-64 --update-cache -RUN ./linuxdeploy-x86_64.AppImage \ +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -20,5 +21,6 @@ FROM docker.io/fedora:latest VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] diff --git a/containers/gtk3/Dockerfile.opensuse b/containers/gtk3/Dockerfile.opensuse index 79a99c1..e34157e 100644 --- a/containers/gtk3/Dockerfile.opensuse +++ b/containers/gtk3/Dockerfile.opensuse @@ -1,13 +1,14 @@ FROM docker.io/opensuse/leap:15 AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 +ARG MACHINE=x86_64 ARG APPDIR=/AppDir RUN zypper install -y wget librsvg2-devel file findutils pkg-config gtk3 gtk3-devel \ typelib-1_0-Gtk-3_0 gobject-introspection-devel COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage -RUN ./linuxdeploy-x86_64.AppImage \ +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" . +RUN chmod --verbose +x *.sh *.AppImage +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -19,5 +20,6 @@ FROM docker.io/opensuse/leap:15 VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] diff --git a/containers/gtk3/Dockerfile.ubuntu b/containers/gtk3/Dockerfile.ubuntu index a349020..aba4fbf 100644 --- a/containers/gtk3/Dockerfile.ubuntu +++ b/containers/gtk3/Dockerfile.ubuntu @@ -2,6 +2,7 @@ FROM docker.io/ubuntu:focal AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ENV DEBIAN_FRONTEND=noninteractive +ARG MACHINE=x86_64 ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone @@ -9,9 +10,9 @@ RUN apt-get update && \ apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config libgtk-3-0 \ libgtk-3-dev gtk-3-examples gir1.2-gtk-3.0 libgirepository1.0-dev libfuse2 COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage -RUN ./linuxdeploy-x86_64.AppImage \ +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" . +RUN chmod --verbose +x *.sh *.AppImage +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -23,5 +24,6 @@ FROM docker.io/ubuntu:focal VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] diff --git a/containers/gtk4/Dockerfile.debian b/containers/gtk4/Dockerfile.debian index 0b68d5d..b2d981e 100644 --- a/containers/gtk4/Dockerfile.debian +++ b/containers/gtk4/Dockerfile.debian @@ -2,6 +2,7 @@ FROM docker.io/debian:bookworm AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ENV DEBIAN_FRONTEND=noninteractive +ARG MACHINE=x86_64 ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone @@ -9,9 +10,9 @@ RUN apt-get update && \ apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config && \ apt-get install -y libgtk-4-1 libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libgirepository1.0-dev COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage -RUN ./linuxdeploy-x86_64.AppImage \ +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" . +RUN chmod --verbose +x *.sh *.AppImage +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -23,5 +24,6 @@ FROM docker.io/debian:bookworm VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] diff --git a/containers/gtk4/Dockerfile.fedora b/containers/gtk4/Dockerfile.fedora index 023428d..ddb148e 100644 --- a/containers/gtk4/Dockerfile.fedora +++ b/containers/gtk4/Dockerfile.fedora @@ -1,13 +1,14 @@ FROM docker.io/fedora:latest AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 +ARG MACHINE=x86_64 ARG APPDIR=/AppDir RUN dnf install -y wget librsvg2-devel file findutils pkgconfig gtk4 gtk4-devel gtk4-devel-tools \ gobject-introspection-devel COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage -RUN ./linuxdeploy-x86_64.AppImage \ +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" . +RUN chmod --verbose +x *.sh *.AppImage +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -19,5 +20,6 @@ FROM docker.io/fedora:latest VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] diff --git a/containers/gtk4/Dockerfile.opensuse b/containers/gtk4/Dockerfile.opensuse index 9f92b90..f80af23 100644 --- a/containers/gtk4/Dockerfile.opensuse +++ b/containers/gtk4/Dockerfile.opensuse @@ -2,13 +2,14 @@ FROM docker.io/opensuse/tumbleweed:latest AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 +ARG MACHINE=x86_64 ARG APPDIR=/AppDir RUN zypper install -y wget librsvg2-devel file findutils pkg-config gtk4 gtk4-devel \ typelib-1_0-Gtk-4_0 gobject-introspection-devel COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage -RUN ./linuxdeploy-x86_64.AppImage \ +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" . +RUN chmod --verbose +x *.sh *.AppImage +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -20,5 +21,6 @@ FROM docker.io/opensuse/tumbleweed:latest VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] diff --git a/containers/gtk4/Dockerfile.ubuntu b/containers/gtk4/Dockerfile.ubuntu index 936cea5..a6debd1 100644 --- a/containers/gtk4/Dockerfile.ubuntu +++ b/containers/gtk4/Dockerfile.ubuntu @@ -2,6 +2,7 @@ FROM docker.io/ubuntu:jammy AS build-stage WORKDIR /linuxdeploy ENV APPIMAGE_EXTRACT_AND_RUN=1 ENV DEBIAN_FRONTEND=noninteractive +ARG MACHINE=x86_64 ARG APPDIR=/AppDir ARG TZ=UTC RUN ln -snf "/usr/share/zoneinfo/$TZ" "/etc/localtime" && echo "$TZ" > /etc/timezone @@ -9,9 +10,9 @@ RUN apt-get update && \ apt-get install -y dpkg-dev wget librsvg2-dev file findutils pkg-config libgtk-4-1 \ libgtk-4-dev gtk-4-examples gir1.2-gtk-4.0 libgirepository1.0-dev libfuse2 COPY . . -ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" . -RUN chmod +x *.sh *.AppImage -RUN ./linuxdeploy-x86_64.AppImage \ +ADD "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${MACHINE}.AppImage" . +RUN chmod --verbose +x *.sh *.AppImage +RUN ./linuxdeploy-${MACHINE}.AppImage \ --appdir ${APPDIR} \ --plugin gtk \ --output appimage \ @@ -23,5 +24,6 @@ FROM docker.io/ubuntu:jammy VOLUME ["/AppImage"] WORKDIR /AppImage ENV APPIMAGE_EXTRACT_AND_RUN=1 -COPY --from=build-stage "/linuxdeploy/Widget_Factory-x86_64.AppImage" . -ENTRYPOINT ["./Widget_Factory-x86_64.AppImage"] +ARG MACHINE=x86_64 +COPY --from=build-stage "/linuxdeploy/Widget_Factory-${MACHINE}.AppImage" "./Widget_Factory.AppImage" +ENTRYPOINT ["./Widget_Factory.AppImage"] From 0a983ad26d6856d43d769b1d34f19313d9d43f97 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Thu, 27 Jul 2023 13:37:05 +0200 Subject: [PATCH 21/25] CI: give a better name to pipelines --- .github/workflows/containers.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 4b769d0..601ba5a 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -1,4 +1,4 @@ -name: Containers +name: GTK Widget Factory from containers on: [push, pull_request] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 956def0..6077dff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: CI +name: Test plugin on: [push, pull_request] From 3b67a1d1c1b0c8268f57f2bce40fe2d33d409cea Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Sun, 1 Oct 2023 08:55:16 +0200 Subject: [PATCH 22/25] Fix COLOR_SCHEME when commands exit with error Fix #57 --- 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 41d8c18..78c5e0b 100755 --- a/linuxdeploy-plugin-gtk.sh +++ b/linuxdeploy-plugin-gtk.sh @@ -226,9 +226,9 @@ mkdir -p "$HOOKSDIR" cat > "$HOOKFILE" <<\EOF #! /usr/bin/env bash -COLOR_SCHEME="$(dbus-send --session --dest=org.freedesktop.portal.Desktop --type=method_call --print-reply --reply-timeout=1000 /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read 'string:org.freedesktop.appearance' 'string:color-scheme' 2>/dev/null | tail -n1 | cut -b35- | cut -d' ' -f2)" +COLOR_SCHEME="$(dbus-send --session --dest=org.freedesktop.portal.Desktop --type=method_call --print-reply --reply-timeout=1000 /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read 'string:org.freedesktop.appearance' 'string:color-scheme' 2> /dev/null | tail -n1 | cut -b35- | cut -d' ' -f2 || printf '')" if [ -z "$COLOR_SCHEME" ]; then - COLOR_SCHEME="$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null)" + COLOR_SCHEME="$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null || printf '')" fi case "$COLOR_SCHEME" in "1"|"'prefer-dark'") GTK_THEME_VARIANT="dark";; From 3d6da75a26e4a89f96a2149a8da0436ae1b3a494 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Thu, 2 Jul 2026 02:43:28 +0200 Subject: [PATCH 23/25] Use Dependabot to update GitHub actions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From 1ee2a937551bac53c6bf47f8123eb4af7c693b91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 00:44:15 +0000 Subject: [PATCH 24/25] Bump actions/checkout from 3 to 7 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/containers.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 601ba5a..abfb73f 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v7 - name: Set extra environment variables run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6077dff..fee292b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: DEPLOY_GTK_VERSION: 3 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - name: Setup dependencies run: | From 7a3fbc31a9e5075073ff8790f26effbac5f84453 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 00:44:12 +0000 Subject: [PATCH 25/25] Bump actions/upload-artifact from 3 to 7 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index abfb73f..c1c883e 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -50,7 +50,7 @@ jobs: podman cp "${CONTAINER_NAME}:/AppImage/Widget_Factory.AppImage" "${ARTIFACT_DIR}" podman stop "${CONTAINER_NAME}" --time 0 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v7 with: name: ${{ matrix.gtk-version }}_${{ matrix.linux-distro }}_${{ env.MACHINE }} path: ${{ env.ARTIFACT_DIR }}/