From aa71ba8cfd9682651fb435bdda6987d7e0ba0df6 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 19 Aug 2024 06:04:45 +0200 Subject: [PATCH 1/8] make_appimage.sh: fail fast --- buildscripts/ci/linux/tools/make_appimage.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index 61f61980f5c13..1561d5931ca1d 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +trap 'echo Making AppImage failed; exit 1' ERR + INSTALL_DIR="$1" # MuseScore was installed here APPIMAGE_NAME="$2" # name for AppImage file (created outside $INSTALL_DIR) PACKARCH="$3" # architecture (x86_64, aarch64, armv7l) From 1f6cf1ecf8ceee1f27fdc77d95055698f6ddcc73 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:09:31 +0200 Subject: [PATCH 2/8] make_appimage.sh: Remove chmod code that seems useless and causes problems --- buildscripts/ci/linux/tools/make_appimage.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index 1561d5931ca1d..a978305ecba97 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -365,14 +365,4 @@ fi # create AppImage appimagetool "${appimagetool_args[@]}" "${appdir}" "${appimage}" -# We are running as root in the Docker image so all created files belong to -# root. Allow non-root users outside the Docker image to access these files. -chmod a+rwx "${created_files[@]}" -parent_dir="${PWD}" -while [[ "$(dirname "${parent_dir}")" != "${parent_dir}" ]]; do - [[ "$parent_dir" == "/" ]] && break - chmod a+rwx "$parent_dir" - parent_dir="$(dirname "$parent_dir")" -done - echo "Making AppImage finished" From a1e125b748b8f86377c6737f3ace4a4136c6f52b Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:46:46 +0200 Subject: [PATCH 3/8] make_appimage.sh: fix capitalization of libOpenGL.so.0 --- buildscripts/ci/linux/tools/make_appimage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index a978305ecba97..27c4f978af5c8 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -245,7 +245,7 @@ additional_libraries=( # Report new additions at https://github.com/linuxdeploy/linuxdeploy/issues fallback_libraries=( libjack.so.0 # https://github.com/LMMS/lmms/pull/3958 - libopengl.so.0 # https://bugreports.qt.io/browse/QTBUG-89754 + libOpenGL.so.0 # https://bugreports.qt.io/browse/QTBUG-89754 # https://github.com/musescore/MuseScore/issues/24068#issuecomment-2297823192 libwayland-client.so.0 From 8a27ea9fa5591acf1b5149938ad5e81606491319 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:38:15 +0200 Subject: [PATCH 4/8] make_appimage.sh: Don't fail on moving qsql stuff out of the way if it doesn't exist --- buildscripts/ci/linux/tools/make_appimage.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index 27c4f978af5c8..9c336a6375833 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -146,8 +146,8 @@ mv "${appdir}/bin/findlib" "${appdir}/../findlib" qt_sql_drivers_path="${QT_PATH}/plugins/sqldrivers" qt_sql_drivers_tmp="/tmp/qtsqldrivers" mkdir -p "$qt_sql_drivers_tmp" -mv "${qt_sql_drivers_path}/libqsqlmysql.so" "${qt_sql_drivers_tmp}/libqsqlmysql.so" -mv "${qt_sql_drivers_path}/libqsqlpsql.so" "${qt_sql_drivers_tmp}/libqsqlpsql.so" +[ -f "${qt_sql_drivers_path}/libqsqlmysql.so" ] && mv "${qt_sql_drivers_path}/libqsqlmysql.so" "${qt_sql_drivers_tmp}/libqsqlmysql.so" +[ -f "${qt_sql_drivers_path}/libqsqlpsql.so" ] && mv "${qt_sql_drivers_path}/libqsqlpsql.so" "${qt_sql_drivers_tmp}/libqsqlpsql.so" # Semicolon-separated list of platforms to deploy in addition to `libqxcb.so`. # Used by linuxdeploy-plugin-qt. @@ -173,9 +173,9 @@ fi unset QML_SOURCES_PATHS EXTRA_PLATFORM_PLUGINS -# In case this container is reused multiple times, return the moved libraries back -mv "${qt_sql_drivers_tmp}/libqsqlmysql.so" "${qt_sql_drivers_path}/libqsqlmysql.so" -mv "${qt_sql_drivers_tmp}/libqsqlpsql.so" "${qt_sql_drivers_path}/libqsqlpsql.so" +# Return the moved libraries back +[ -f "${qt_sql_drivers_tmp}/libqsqlmysql.so" ] && mv "${qt_sql_drivers_tmp}/libqsqlmysql.so" "${qt_sql_drivers_path}/libqsqlmysql.so" +[ -f "${qt_sql_drivers_tmp}/libqsqlpsql.so" ] && mv "${qt_sql_drivers_tmp}/libqsqlpsql.so" "${qt_sql_drivers_path}/libqsqlpsql.so" # Put the non-RUNPATH binaries back mv "${appdir}/../findlib" "${appdir}/bin/findlib" From 5906de187f1530d7a5b19a0cd8cdc7efc97ff413 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Sat, 14 Sep 2024 23:41:12 +0200 Subject: [PATCH 5/8] Prevent error while manually deploying `libqgtk3.so` --- buildscripts/ci/linux/tools/make_appimage.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index 9c336a6375833..f548945ade77c 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -163,6 +163,7 @@ linuxdeploy-plugin-qt --appdir "${appdir}" # adds all Qt dependencies # At an unknown point in time, the libqgtk3 plugin stopped being deployed if [ ! -f ${appdir}/plugins/platformthemes/libqgtk3.so ]; then + mkdir -p ${appdir}/plugins/platformthemes cp ${QT_PATH}/plugins/platformthemes/libqgtk3.so ${appdir}/plugins/platformthemes/libqgtk3.so fi From 1200585d32c16e918340c5c8d7feb0c1b70fe365 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:36:29 +0200 Subject: [PATCH 6/8] make_appimage.sh: OpenSSL 1.1 is not necessary (nor existent) on ARM --- buildscripts/ci/linux/tools/make_appimage.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index f548945ade77c..a3989ae7f8d82 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -231,10 +231,14 @@ additional_qt_components=( # ADDITIONAL LIBRARIES # linuxdeploy may have missed some libraries that we need # Report new additions at https://github.com/linuxdeploy/linuxdeploy/issues -additional_libraries=( - libssl.so.1.1 # OpenSSL (for Save Online) - libcrypto.so.1.1 # OpenSSL (for Save Online) -) +if [[ "$PACKARCH" == "x86_64" ]]; then + additional_libraries=( + libssl.so.1.1 # OpenSSL (for Save Online) + libcrypto.so.1.1 # OpenSSL (for Save Online) + ) +else + additional_libraries=() +fi # FALLBACK LIBRARIES # These get bundled in the AppImage, but are only loaded if the user does not From 885012968138c11b51dba38b3b8d727b7be11af0 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 16 Sep 2024 03:14:40 +0200 Subject: [PATCH 7/8] Linux CI/packaging: Fix QT_PATH on armhf linux --- buildscripts/ci/linux/setup-arm.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/buildscripts/ci/linux/setup-arm.sh b/buildscripts/ci/linux/setup-arm.sh index 7d40c7a953381..06e257ae42653 100755 --- a/buildscripts/ci/linux/setup-arm.sh +++ b/buildscripts/ci/linux/setup-arm.sh @@ -174,8 +174,23 @@ apt_packages_qt6=( apt-get install -y \ "${apt_packages_qt6[@]}" -qt_version="624" -qt_dir="/usr/lib/aarch64-linux-gnu/qt6" +case $PACKARCH in + arm64) + qt_dir="/usr/lib/aarch64-linux-gnu/qt6" + ;; + armv7l) + qt_dir="/usr/lib/arm-linux-gnueabihf/qt6" + ;; + *) + echo "Unknown architecture: $PACKARCH" + exit 1 + ;; +esac + +if [[ ! -d "${qt_dir}" ]]; then + echo "Qt directory not found: ${qt_dir}" + exit 1 +fi ########################################################################## # GET TOOLS From cb2fd969667b3df9b46f264be794fe76992063c5 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Mon, 16 Sep 2024 03:21:30 +0200 Subject: [PATCH 8/8] make_appimage.sh: package libqgtk3 via `additional_qt_components` --- buildscripts/ci/linux/setup-arm.sh | 2 +- buildscripts/ci/linux/tools/make_appimage.sh | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/buildscripts/ci/linux/setup-arm.sh b/buildscripts/ci/linux/setup-arm.sh index 06e257ae42653..a44612a6d010b 100755 --- a/buildscripts/ci/linux/setup-arm.sh +++ b/buildscripts/ci/linux/setup-arm.sh @@ -175,7 +175,7 @@ apt-get install -y \ "${apt_packages_qt6[@]}" case $PACKARCH in - arm64) + aarch64) qt_dir="/usr/lib/aarch64-linux-gnu/qt6" ;; armv7l) diff --git a/buildscripts/ci/linux/tools/make_appimage.sh b/buildscripts/ci/linux/tools/make_appimage.sh index a3989ae7f8d82..bf921f61299f5 100644 --- a/buildscripts/ci/linux/tools/make_appimage.sh +++ b/buildscripts/ci/linux/tools/make_appimage.sh @@ -161,12 +161,6 @@ export QML_SOURCES_PATHS=./ linuxdeploy --appdir "${appdir}" # adds all shared library dependencies linuxdeploy-plugin-qt --appdir "${appdir}" # adds all Qt dependencies -# At an unknown point in time, the libqgtk3 plugin stopped being deployed -if [ ! -f ${appdir}/plugins/platformthemes/libqgtk3.so ]; then - mkdir -p ${appdir}/plugins/platformthemes - cp ${QT_PATH}/plugins/platformthemes/libqgtk3.so ${appdir}/plugins/platformthemes/libqgtk3.so -fi - # The system must be used if [ -f ${appdir}/lib/libglib-2.0.so.0 ]; then rm -f ${appdir}/lib/libglib-2.0.so.0 @@ -222,6 +216,9 @@ unwanted_files=( additional_qt_components=( plugins/printsupport/libcupsprintersupport.so + # At an unknown point in time, the libqgtk3 plugin stopped being deployed + plugins/platformthemes/libqgtk3.so + # Wayland support (run with QT_QPA_PLATFORM=wayland to use) plugins/wayland-decoration-client plugins/wayland-graphics-integration-client @@ -274,11 +271,19 @@ for file in "${unwanted_files[@]}"; do done for file in "${additional_qt_components[@]}"; do + if [ -f "${appdir}/${file}" ]; then + echo "Warning: ${file} was already deployed. Skipping." + continue + fi mkdir -p "${appdir}/$(dirname "${file}")" cp -Lr "${QT_PATH}/${file}" "${appdir}/${file}" done for lib in "${additional_libraries[@]}"; do + if [ -f "${appdir}/lib/${lib}" ]; then + echo "Warning: ${file} was already deployed. Skipping." + continue + fi full_path="$(find_library "${lib}")" cp -L "${full_path}" "${appdir}/lib/${lib}" done