Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: bump all appimage deployment dependencies to latest for ARM #20363

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/ci/linux/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
48 changes: 5 additions & 43 deletions build/ci/linux/setup-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 /
Expand All @@ -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
Expand Down Expand Up @@ -304,45 +306,6 @@ 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
Expand All @@ -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

Expand Down
20 changes: 16 additions & 4 deletions build/ci/linux/tools/make_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}"
}

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down