Skip to content

Commit

Permalink
Merge pull request #24825 from musescore/fix_nightly
Browse files Browse the repository at this point in the history
Fix nightly builds on Linux
  • Loading branch information
RomanPudashkin authored Sep 20, 2024
2 parents 1aec102 + 3997e2f commit c40e1cb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 17 deletions.
19 changes: 17 additions & 2 deletions buildscripts/ci/linux/setup-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
aarch64)
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
Expand Down
43 changes: 28 additions & 15 deletions buildscripts/ci/linux/tools/make_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ if [[ ! -d $BUILD_TOOLS/appimageupdatetool ]]; then
fi
if [[ "${UPDATE_INFORMATION}" ]]; then
export PATH="$BUILD_TOOLS/appimageupdatetool:$PATH"
appimageupdatetool --version

# `appimageupdatetool`'s `AppRun` script gets confused when called via a symlink.
# Resolve the symlink here to avoid this issue.
$(readlink -f "$(which appimageupdatetool)") --version
fi

##########################################################################
Expand All @@ -146,8 +149,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.
Expand All @@ -161,21 +164,16 @@ 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
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
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"
Expand Down Expand Up @@ -221,6 +219,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
Expand All @@ -230,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
Expand Down Expand Up @@ -266,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
Expand Down

0 comments on commit c40e1cb

Please sign in to comment.