From 1e63fab69dd2e61c6ca560a47a3daace4a4d30bb Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:19:39 -0500 Subject: [PATCH 1/4] CI: bump all appimage deployment dependencies to latest for ARM remove pkgconfig manual overrides for appimageupdatetool unnecessary on focal and newer distros --- build/ci/linux/setup-arm.sh | 50 +++++-------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/build/ci/linux/setup-arm.sh b/build/ci/linux/setup-arm.sh index e7cca44980674..e7baa95581bdb 100755 --- a/build/ci/linux/setup-arm.sh +++ b/build/ci/linux/setup-arm.sh @@ -91,6 +91,7 @@ apt_packages=( sed desktop-file-utils # installs `desktop-file-validate` for appimagetool zsync # installs `zsyncmake` for appimagetool + libgpgme-dev # install for appimagetool libglib2.0-dev librsvg2-dev argagg-dev @@ -225,7 +226,7 @@ cd / git clone https://github.com/linuxdeploy/linuxdeploy cd /linuxdeploy/ -git checkout --recurse-submodules 49f4f237762395c6a37 +git checkout --recurse-submodules 1-alpha-20231206-1 git submodule update --init --recursive # patch src/core/generate-excludelist.sh to use curl instead of wget which fails on armhf @@ -246,7 +247,7 @@ cd / git clone https://github.com/linuxdeploy/linuxdeploy-plugin-qt cd /linuxdeploy-plugin-qt/ -git checkout --recurse-submodules 59b6c1f90e21ba14 +git checkout --recurse-submodules 9a388d32b1e95d8b69e201356f050137eb6c0aa3 git submodule update --init --recursive # patch src/core/generate-excludelist.sh to use curl instead of wget which fails on armhf @@ -256,6 +257,7 @@ mkdir -p build cd build cmake -DBUILD_TESTING=OFF -DUSE_SYSTEM_BOOST=ON .. cmake --build . -j $(nproc) +mkdir -p $BUILD_TOOLS/linuxdeploy mv /linuxdeploy-plugin-qt/build/bin/linuxdeploy-plugin-qt $BUILD_TOOLS/linuxdeploy/linuxdeploy-plugin-qt $BUILD_TOOLS/linuxdeploy/linuxdeploy --list-plugins cd / @@ -266,7 +268,7 @@ cd / git clone https://github.com/linuxdeploy/linuxdeploy-plugin-appimage cd /linuxdeploy-plugin-appimage/ -git checkout --recurse-submodules 779bd58443e8cc +git checkout --recurse-submodules 1-alpha-20230713-1 git submodule update --init --recursive mkdir -p build cd build @@ -299,50 +301,11 @@ appimagetool --version git clone https://github.com/AppImageCommunity/AppImageUpdate.git cd AppImageUpdate -git checkout --recurse-submodules 2.0.0-alpha-1-20220512 +git checkout --recurse-submodules 2.0.0-alpha-1-20230526 git submodule update --init --recursive mkdir -p build cd build -if [ "$PACKARCH" == "armv7l" ]; then - cp ../ci/libgcrypt.pc /usr/lib/arm-linux-gnueabihf/pkgconfig/libgcrypt.pc - sed -i 's|x86_64-linux-gnu|arm-linux-gnueabihf|g' /usr/lib/arm-linux-gnueabihf/pkgconfig/libgcrypt.pc - sed -i 's|x86_64-pc-linux-gnu|arm-pc-linux-gnueabihf|g' /usr/lib/arm-linux-gnueabihf/pkgconfig/libgcrypt.pc - echo 'prefix=/usr -exec_prefix=${prefix} -includedir=${prefix}/include -libdir=${prefix}/lib/arm-linux-gnueabihf -host=arm-unknown-linux-gnueabihf -mtcflags= -mtlibs= - -Name: gpg-error -Description: GPG Runtime -Version: 1.27 -Cflags: -Libs: -L${libdir} -lgpg-error -Libs.private: -URL: https://www.gnupg.org/software/libgpg-error/index.html' > /usr/lib/arm-linux-gnueabihf/pkgconfig/gpg-error.pc -else - cp ../ci/libgcrypt.pc /usr/lib/aarch64-linux-gnu/pkgconfig/libgcrypt.pc - sed -i 's|x86_64|aarch64|g' /usr/lib/aarch64-linux-gnu/pkgconfig/libgcrypt.pc - echo 'prefix=/usr -exec_prefix=${prefix} -includedir=${prefix}/include -libdir=${prefix}/lib/aarch64-linux-gnu -host=aarch64-unknown-linux-gnu -mtcflags= -mtlibs= - -Name: gpg-error -Description: GPG Runtime -Version: 1.27 -Cflags: -Libs: -L${libdir} -lgpg-error -Libs.private: -URL: https://www.gnupg.org/software/libgpg-error/index.html' > /usr/lib/aarch64-linux-gnu/pkgconfig/gpg-error.pc -fi - cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux .. make -j"$(nproc)" # create the extracted appimage directory @@ -353,7 +316,6 @@ cp -v ../resources/*.xpm $BUILD_TOOLS/appimageupdatetool/appimageupdatetool-${PA $BUILD_TOOLS/linuxdeploy/linuxdeploy -v0 --appdir $BUILD_TOOLS/appimageupdatetool/appimageupdatetool-${PACKARCH}.AppDir --output appimage -d ../resources/appimageupdatetool.desktop -i ../resources/appimage.png cd $BUILD_TOOLS/appimageupdatetool ln -s "appimageupdatetool-${PACKARCH}.AppDir/AppRun" appimageupdatetool # symlink for convenience -rm -rf /usr/lib/arm-linux-gnueabihf/pkgconfig/libgcrypt.pc /usr/lib/aarch64-linux-gnu/pkgconfig/libgcrypt.pc cd / $BUILD_TOOLS/appimageupdatetool/appimageupdatetool --version From bcc9578bc373db703116a5bff9631a20a3ea1fa2 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:44:52 -0500 Subject: [PATCH 2/4] add architecture capability to make_appimage.sh between the time that the original armhf/arm64 PR was made and now upstream has started building some dependencies for armhf/arm64 in their own CI and publishing releases. unfortunately we cannot use these releases since appimages (even the extraction command) do not run inside of the armhf/arm64 docker container https://github.com/AppImage/AppImageKit/issues/1027 replace wget with curl (in make_appimage) due to armhf bug https://bugs.launchpad.net/ubuntu/+source/wget/+bug/2043636 --- build/ci/linux/package.sh | 2 +- build/ci/linux/tools/make_appimage.sh | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/build/ci/linux/package.sh b/build/ci/linux/package.sh index 20bca3c756acd..bb2dba517bd37 100755 --- a/build/ci/linux/package.sh +++ b/build/ci/linux/package.sh @@ -90,7 +90,7 @@ if [ "$PACKTYPE" == "appimage" ]; then *) unset UPDATE_INFORMATION;; # disable updates for other build modes esac - bash ./build/ci/linux/tools/make_appimage.sh "${INSTALL_DIR}" "${ARTIFACT_NAME}.AppImage" + bash ./build/ci/linux/tools/make_appimage.sh "${INSTALL_DIR}" "${ARTIFACT_NAME}.AppImage" "${PACKARCH}" mv "${INSTALL_DIR}/../${ARTIFACT_NAME}.AppImage" "${ARTIFACTS_DIR}/" bash ./build/ci/tools/make_artifact_name_env.sh $ARTIFACT_NAME.AppImage diff --git a/build/ci/linux/tools/make_appimage.sh b/build/ci/linux/tools/make_appimage.sh index dcc2d62986485..8699b9be7a3c9 100644 --- a/build/ci/linux/tools/make_appimage.sh +++ b/build/ci/linux/tools/make_appimage.sh @@ -2,9 +2,15 @@ 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) if [ -z "$INSTALL_DIR" ]; then echo "error: not set INSTALL_DIR"; exit 1; fi if [ -z "$APPIMAGE_NAME" ]; then echo "error: not set APPIMAGE_NAME"; exit 1; fi +if [ -z "$PACKARCH" ]; then + PACKARCH="x86_64" +elif [ "$PACKARCH" == "armv7l" ]; then + PACKARCH="armhf" +fi HERE="$(cd "$(dirname "$0")" && pwd)" ORIGIN_DIR=${PWD} @@ -24,7 +30,8 @@ function download_github_release() else local -r url="https://github.com/${repo_slug}/releases/download/${release_tag}/${file}" fi - wget -q --show-progress "${url}" + # use curl instead of wget which fails on armhf + curl "${url}" -O -L chmod +x "${file}" } @@ -42,7 +49,7 @@ function extract_appimage() function download_appimage_release() { local -r github_repo_slug="$1" binary_name="$2" tag="$3" - local -r appimage="${binary_name}-x86_64.AppImage" + local -r appimage="${binary_name}-${PACKARCH}.AppImage" download_github_release "${github_repo_slug}" "${tag}" "${appimage}" extract_appimage "${appimage}" "${binary_name}" # mv "${appimage}" "${binary_name}" # use this instead of the previous line for the static runtime AppImage @@ -73,10 +80,15 @@ function download_linuxdeploy_component() download_appimage_release "linuxdeploy/$1" "$1" continuous } -if [[ ! -d $BUILD_TOOLS/linuxdeploy ]]; then - mkdir $BUILD_TOOLS/linuxdeploy +if [[ ! -f $BUILD_TOOLS/linuxdeploy/linuxdeploy ]]; then + mkdir -p $BUILD_TOOLS/linuxdeploy cd $BUILD_TOOLS/linuxdeploy download_linuxdeploy_component linuxdeploy + cd $ORIGIN_DIR +fi +if [[ ! -f $BUILD_TOOLS/linuxdeploy/linuxdeploy-plugin-qt ]]; then + mkdir -p $BUILD_TOOLS/linuxdeploy + cd $BUILD_TOOLS/linuxdeploy download_linuxdeploy_component linuxdeploy-plugin-qt cd $ORIGIN_DIR fi From 25567eedf2de058235125ec0552a41161be71966 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:13:21 -0500 Subject: [PATCH 3/4] appimageupdatetool: ensure 32bit hosts still use 64bit offsets --- build/ci/linux/setup-arm.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/ci/linux/setup-arm.sh b/build/ci/linux/setup-arm.sh index e7baa95581bdb..1d63568dca40b 100755 --- a/build/ci/linux/setup-arm.sh +++ b/build/ci/linux/setup-arm.sh @@ -306,7 +306,11 @@ git submodule update --init --recursive mkdir -p build cd build -cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux .. +if [ "$PACKARCH" == "armv7l" ]; then + cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_CXX_FLAGS=-D_FILE_OFFSET_BITS=64 -DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64 .. +else + cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux .. +fi make -j"$(nproc)" # create the extracted appimage directory mkdir -p $BUILD_TOOLS/appimageupdatetool From 3f881d33a3faae3af825f6985e5a5f096fa1c887 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:13:02 -0500 Subject: [PATCH 4/4] appimageupdatetool: downgrade to older version avoids needing gpgme which, in order to build, requires _FILE_OFFSET_BITS=64 which causes issues with linking to system libz.so.1 /usr/bin/ld: libzsync2_standalone.a(zsclient.cpp.o): undefined reference to symbol 'gzopen64@@ZLIB_1.2.3.3' /usr/bin/ld: /lib/arm-linux-gnueabihf/libz.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status https://github.com/AppImageCommunity/AppImageUpdate/issues/230 --- build/ci/linux/setup-arm.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/build/ci/linux/setup-arm.sh b/build/ci/linux/setup-arm.sh index 1d63568dca40b..14a51860302bd 100755 --- a/build/ci/linux/setup-arm.sh +++ b/build/ci/linux/setup-arm.sh @@ -301,16 +301,12 @@ appimagetool --version git clone https://github.com/AppImageCommunity/AppImageUpdate.git cd AppImageUpdate -git checkout --recurse-submodules 2.0.0-alpha-1-20230526 +git checkout --recurse-submodules 2.0.0-alpha-1-20220512 git submodule update --init --recursive mkdir -p build cd build -if [ "$PACKARCH" == "armv7l" ]; then - cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_CXX_FLAGS=-D_FILE_OFFSET_BITS=64 -DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64 .. -else - cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux .. -fi +cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux .. make -j"$(nproc)" # create the extracted appimage directory mkdir -p $BUILD_TOOLS/appimageupdatetool