Add 32-bit AppImage build target

merge-requests/519/merge
Adam Honse 3 years ago
parent f05df3768b
commit b3a7b7be81

@ -21,9 +21,25 @@ before_script:
- echo "started by ${GITLAB_USER_NAME}"
#-----------------------------------------------------------------------#
# Linux (AppImage) Build Target #
# Linux (AppImage) 32-bit Build Target #
#-----------------------------------------------------------------------#
build_linux:
build_linux_32:
image: i386/ubuntu:bionic
stage: build
script:
- apt update
- apt install -y build-essential qtcreator qt5-default libusb-1.0-0-dev libhidapi-dev pkgconf wget git
- ./scripts/build-appimage-32.sh
artifacts:
paths:
- OpenRGB-i386.AppImage
expire_in: 1337 years
#-----------------------------------------------------------------------#
# Linux (AppImage) 64-bit Build Target #
#-----------------------------------------------------------------------#
build_linux_64:
image: ubuntu:bionic
stage: build
script:
@ -35,7 +51,7 @@ build_linux:
paths:
- OpenRGB-x86_64.AppImage
expire_in: 1337 years
#-----------------------------------------------------------------------#
# Windows (32-bit) Build Target #
#-----------------------------------------------------------------------#

@ -0,0 +1,82 @@
#!/bin/bash
#-----------------------------------------------------------------------#
# OpenRGB AppImage 32-bit Build Script #
#-----------------------------------------------------------------------#
set -x
set -e
#-----------------------------------------------------------------------#
# Build in a temporary directory to keep the system clean #
# Use RAM disk if possible (if available and not building on a CI #
# system like Travis) #
#-----------------------------------------------------------------------#
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" appimage-build-XXXXXX)
#-----------------------------------------------------------------------#
# Make sure to clean up build dir, even if errors occur #
#-----------------------------------------------------------------------#
cleanup () {
if [ -d "$BUILD_DIR" ]; then
rm -rf "$BUILD_DIR"
fi
}
trap cleanup EXIT
#-----------------------------------------------------------------------#
# Store repo root as variable #
#-----------------------------------------------------------------------#
REPO_ROOT=$(readlink -f $(dirname $(dirname $0)))
OLD_CWD=$(readlink -f .)
#-----------------------------------------------------------------------#
# Switch to build dir #
#-----------------------------------------------------------------------#
pushd "$BUILD_DIR"
#-----------------------------------------------------------------------#
# Configure build files with qmake #
# we need to explicitly set the install prefix, as qmake's default is #
# /usr/local for some reason... #
#-----------------------------------------------------------------------#
qmake "$REPO_ROOT"
#-----------------------------------------------------------------------#
# Build project and install files into AppDir #
#-----------------------------------------------------------------------#
make -j$(nproc)
make install INSTALL_ROOT=AppDir
#-----------------------------------------------------------------------#
# Now, build AppImage using linuxdeploy and linuxdeploy-plugin-qt #
# Download linuxdeploy and its Qt plugin #
#-----------------------------------------------------------------------#
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-i386.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-i386.AppImage
#-----------------------------------------------------------------------#
# Make them executable #
#-----------------------------------------------------------------------#
chmod +x linuxdeploy*.AppImage
#-----------------------------------------------------------------------#
# Make sure Qt plugin finds QML sources so it can deploy the imported #
# files #
export QML_SOURCES_PATHS="$REPO_ROOT"/src
./linuxdeploy-i386.AppImage --appimage-extract-and-run --appdir AppDir -e OpenRGB -i "$REPO_ROOT"/qt/OpenRGB.png -d "$REPO_ROOT"/qt/OpenRGB.desktop
./linuxdeploy-plugin-qt-i386.AppImage --appimage-extract-and-run --appdir AppDir
./linuxdeploy-i386.AppImage --appimage-extract-and-run --appdir AppDir --output appimage
#-----------------------------------------------------------------------#
# Move built AppImage back into original CWD #
#-----------------------------------------------------------------------#
mv OpenRGB*.AppImage "$OLD_CWD"
Loading…
Cancel
Save