Skip to content
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
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ jobs:
include:
- ARCH: x86_64
RUNS_ON: ubuntu-24.04
- ARCH: i686
RUNS_ON: ubuntu-24.04
- ARCH: aarch64
RUNS_ON: ubuntu-24.04-arm
- ARCH: armhf
RUNS_ON: ubuntu-24.04-arm

name: AppImage ${{ matrix.ARCH }}
runs-on: ${{ matrix.RUNS_ON }}
Expand Down
71 changes: 23 additions & 48 deletions ci/build-appimages.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#! /bin/bash
#!/bin/sh

set -x
set -e
set -o pipefail
set -ex

export APPIMAGE_EXTRACT_AND_RUN=1

# use RAM disk if possible
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
TEMP_BASE=/tmp

BUILD_DIR="$(mktemp -d -p "$TEMP_BASE" AppImageUpdate-build-XXXXXX)"

Expand All @@ -25,25 +21,20 @@ trap cleanup EXIT
REPO_ROOT="$(readlink -f "$(dirname "$(dirname "$0")")")"
OLD_CWD="$(readlink -f .)"

pushd "$BUILD_DIR"
cd "$BUILD_DIR"

export ARCH=${ARCH:-"$(uname -m)"}

if [ "$ARCH" == "i386" ] && [ "$DOCKER" == "" ]; then
EXTRA_CMAKE_ARGS=("-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT/cmake/toolchains/i386-linux-gnu.cmake")
fi

cmake "$REPO_ROOT" \
-DBUILD_QT_UI=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
"${EXTRA_CMAKE_ARGS[@]}"
-DCMAKE_BUILD_TYPE=MinSizeRel

# next step is to build the binaries
make -j"$(nproc)"

# set up the AppDirs initially
for appdir in {appimageupdatetool,AppImageUpdate,validate}.AppDir; do
for appdir in appimageupdatetool.AppDir validate.AppDir; do
make install DESTDIR="$appdir"
mkdir -p "$appdir"/resources
cp -v "$REPO_ROOT"/resources/*.xpm "$appdir"/resources/
Expand All @@ -61,8 +52,6 @@ fi


# remove unnecessary binaries from AppDirs
rm AppImageUpdate.AppDir/usr/bin/appimageupdatetool
rm AppImageUpdate.AppDir/usr/bin/validate
rm appimageupdatetool.AppDir/usr/bin/AppImageUpdate
rm appimageupdatetool.AppDir/usr/bin/validate
rm appimageupdatetool.AppDir/usr/lib/*/libappimageupdate-qt*.so*
Expand All @@ -71,8 +60,8 @@ rm validate.AppDir/usr/lib/*/libappimageupdate*.so*


# remove other unnecessary data
find {appimageupdatetool,AppImageUpdate,validate}.AppDir -type f -iname '*.a' -delete
rm -rf {appimageupdatetool,AppImageUpdate}.AppDir/usr/include
find {appimageupdatetool,validate}.AppDir -type f -iname '*.a' -delete
rm -rf appimageupdatetool.AppDir/usr/include


# get linuxdeploy and its qt plugin
Expand All @@ -81,34 +70,20 @@ wget https://github.com/TheAssassin/linuxdeploy-plugin-qt/releases/download/cont
wget https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh
chmod +x linuxdeploy*.AppImage linuxdeploy-plugin-checkrt.sh

patch_appimage() {
while [[ "$1" != "" ]]; do
dd if=/dev/zero of="$1" conv=notrunc bs=1 count=3 seek=8
shift
done
}
patch_appimage linuxdeploy*.AppImage

for app in appimageupdatetool AppImageUpdate validate; do
find "$app".AppDir/

export UPD_INFO="gh-releases-zsync|pkgforge-dev|AppImageUpdate|continuous|$app-*$ARCH.AppImage.zsync"

# note that we need to overwrite this in every iteration, otherwise the value will leak into the following iterationso
extra_flags=()
if [ "$app" == "AppImageUpdate" ]; then
extra_flags=("--plugin" "qt");
fi

# overwrite AppImage filename to get static filenames
# see https://github.com/AppImage/AppImageUpdate/issues/89
export OUTPUT="$app"-"$ARCH".AppImage

# bundle application
./linuxdeploy-"$CMAKE_ARCH".AppImage --appdir "$app".AppDir --output appimage "${extra_flags[@]}" -d "$REPO_ROOT"/resources/"$app".desktop -i "$REPO_ROOT"/resources/appimage.png --plugin checkrt
for app in appimageupdatetool validate; do
find "$app".AppDir/
export UPD_INFO="gh-releases-zsync|pkgforge-dev|AppImageUpdate|continuous|$app-*$ARCH.AppImage.zsync"

# overwrite AppImage filename to get static filenames
# see https://github.com/AppImage/AppImageUpdate/issues/89
export OUTPUT="$app"-"$ARCH".AppImage

# bundle application
./linuxdeploy-"$CMAKE_ARCH".AppImage --appdir "$app".AppDir --output appimage -d "$REPO_ROOT"/resources/"$app".desktop -i "$REPO_ROOT"/resources/appimage.png --plugin checkrt
done

# move AppImages to old cwd
mv {appimageupdatetool,AppImageUpdate,validate}*.AppImage* "$OLD_CWD"/
mv appimageupdatetool*.AppImage* "$OLD_CWD"/
mv validate*.AppImage* "$OLD_CWD"/

popd
cd -
Loading