Jenkins: Switch Linux builds to AppImage
This commit is contained in:
67
.ci/AppImageBuilder.yml
Normal file
67
.ci/AppImageBuilder.yml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
#
|
||||||
|
# 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||||
|
# running old operating systems and software designed for IBM
|
||||||
|
# PC systems and compatibles from 1981 through fairly recent
|
||||||
|
# system designs based on the PCI bus.
|
||||||
|
#
|
||||||
|
# This file is part of the 86Box distribution.
|
||||||
|
#
|
||||||
|
# Recipe file for appimage-builder.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Authors: RichardG, <richardg867@gmail.com>
|
||||||
|
#
|
||||||
|
# Copyright 2022 RichardG.
|
||||||
|
#
|
||||||
|
|
||||||
|
version: 1
|
||||||
|
AppDir:
|
||||||
|
path: ./archive_tmp
|
||||||
|
app_info:
|
||||||
|
id: !ENV 'net.${project_lower}.${project_lower}'
|
||||||
|
name: !ENV '${project}'
|
||||||
|
icon: !ENV '${project_lower}'
|
||||||
|
version: '3.2'
|
||||||
|
exec: !ENV 'usr/local/bin/${project}'
|
||||||
|
exec_args: $@
|
||||||
|
apt:
|
||||||
|
arch: !ENV '${arch_deb}'
|
||||||
|
sources:
|
||||||
|
- sourceline: 'deb http://deb.debian.org/debian bullseye main'
|
||||||
|
key_url: 'https://ftp-master.debian.org/keys/archive-key-11.asc'
|
||||||
|
- sourceline: 'deb http://security.debian.org/debian-security bullseye-security main'
|
||||||
|
key_url: 'https://ftp-master.debian.org/keys/archive-key-11.asc'
|
||||||
|
- sourceline: 'deb http://deb.debian.org/debian bullseye-updates main'
|
||||||
|
key_url: 'https://ftp-master.debian.org/keys/archive-key-11-security.asc'
|
||||||
|
include:
|
||||||
|
- libevdev2
|
||||||
|
- libopenal1
|
||||||
|
- libpng16-16
|
||||||
|
- libqt5core5a
|
||||||
|
- libqt5gui5
|
||||||
|
- libqt5widgets5
|
||||||
|
- librtmidi5
|
||||||
|
- libsdl2-2.0-0
|
||||||
|
- libslirp0
|
||||||
|
- libwayland-client0
|
||||||
|
- libx11-6
|
||||||
|
files:
|
||||||
|
exclude:
|
||||||
|
- etc
|
||||||
|
- lib/udev
|
||||||
|
- usr/bin
|
||||||
|
- usr/sbin
|
||||||
|
- usr/share/alsa
|
||||||
|
- usr/share/apport
|
||||||
|
- usr/share/doc
|
||||||
|
- usr/share/doc-base
|
||||||
|
- usr/share/glib-2.0
|
||||||
|
- usr/share/libwacom
|
||||||
|
- usr/share/lintian
|
||||||
|
- usr/share/locale
|
||||||
|
- usr/share/man
|
||||||
|
- usr/share/openal
|
||||||
|
- usr/share/pkgconfig
|
||||||
|
- usr/share/X11
|
||||||
|
AppImage:
|
||||||
|
arch: !ENV '${arch_appimage}'
|
53
.ci/build.sh
53
.ci/build.sh
@@ -85,6 +85,7 @@ make_tar() {
|
|||||||
|
|
||||||
# Set common variables.
|
# Set common variables.
|
||||||
project=86Box
|
project=86Box
|
||||||
|
project_lower=86box
|
||||||
cwd=$(pwd)
|
cwd=$(pwd)
|
||||||
|
|
||||||
# Parse arguments.
|
# Parse arguments.
|
||||||
@@ -226,7 +227,7 @@ else
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Establish general dependencies.
|
# Establish general dependencies.
|
||||||
pkgs="cmake pkg-config git tar xz-utils wayland-protocols"
|
pkgs="cmake pkg-config git imagemagick wayland-protocols"
|
||||||
if [ "$(dpkg --print-architecture)" = "$arch_deb" ]
|
if [ "$(dpkg --print-architecture)" = "$arch_deb" ]
|
||||||
then
|
then
|
||||||
pkgs="$pkgs build-essential"
|
pkgs="$pkgs build-essential"
|
||||||
@@ -412,24 +413,20 @@ then
|
|||||||
# TBD
|
# TBD
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
# Archive readme with library package versions.
|
# Archive icon, while also shrinking it to 512x512 if necessary.
|
||||||
echo Libraries used to compile this $arch build of $project: > archive_tmp/README
|
convert src/win/assets/$project_lower.png -resize '512x512>' icon.png
|
||||||
dpkg-query -f '${Package} ${Version}\n' -W $libpkgs | sed "s/-dev / /" | sed "s/qtdeclarative/qt/" | while IFS=" " read pkg version
|
icon_base="$(identify -format 'archive_tmp/usr/share/icons/%wx%h' icon.png)"
|
||||||
do
|
mkdir -p "$icon_base"
|
||||||
for i in $(seq $(expr $longest_libpkg - $(echo -n $pkg | wc -c)))
|
mv icon.png "$icon_base/$project_lower.png"
|
||||||
do
|
|
||||||
echo -n " " >> archive_tmp/README
|
|
||||||
done
|
|
||||||
echo $pkg $version >> archive_tmp/README
|
|
||||||
done
|
|
||||||
|
|
||||||
# Archive executable, while also stripping it if requested.
|
# Archive executable, while also stripping it if requested.
|
||||||
|
mkdir -p archive_tmp/usr/local/bin
|
||||||
if [ $strip -ne 0 ]
|
if [ $strip -ne 0 ]
|
||||||
then
|
then
|
||||||
"$strip_binary" -o "archive_tmp/$project" "build/src/$project"
|
"$strip_binary" -o "archive_tmp/usr/local/bin/$project" "build/src/$project"
|
||||||
status=$?
|
status=$?
|
||||||
else
|
else
|
||||||
mv "build/src/$project" "archive_tmp/$project"
|
mv "build/src/$project" "archive_tmp/usr/local/bin/$project"
|
||||||
status=$?
|
status=$?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -443,10 +440,10 @@ fi
|
|||||||
|
|
||||||
# Produce artifact archive.
|
# Produce artifact archive.
|
||||||
echo [-] Creating artifact archive
|
echo [-] Creating artifact archive
|
||||||
cd archive_tmp
|
|
||||||
if is_windows
|
if is_windows
|
||||||
then
|
then
|
||||||
# Create zip.
|
# Create zip.
|
||||||
|
cd archive_tmp
|
||||||
"$sevenzip" a -y "$(cygpath -w "$cwd")\\$package_name.zip" *
|
"$sevenzip" a -y "$(cygpath -w "$cwd")\\$package_name.zip" *
|
||||||
status=$?
|
status=$?
|
||||||
elif is_mac
|
elif is_mac
|
||||||
@@ -454,9 +451,33 @@ then
|
|||||||
# TBD
|
# TBD
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
# Create binary tarball.
|
# Determine AppImage runtime architecture.
|
||||||
VERBOSE=1 make_tar "$cwd/$package_name.tar"
|
case $arch in
|
||||||
|
x86) arch_appimage="i686";;
|
||||||
|
arm32) arch_appimage="armhf";;
|
||||||
|
arm64) arch_appimage="aarch64";;
|
||||||
|
*) arch_appimage="$arch";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Download appimage-builder if necessary.
|
||||||
|
[ ! -e "appimage-builder.AppImage" ] && wget -qO appimage-builder.AppImage \
|
||||||
|
https://github.com/AppImageCrafters/appimage-builder/releases/download/v0.9.2/appimage-builder-0.9.2-35e3eab-x86_64.AppImage
|
||||||
|
chmod u+x appimage-builder.AppImage
|
||||||
|
|
||||||
|
# Remove any dangling AppImages which may interfere with the renaming process.
|
||||||
|
rm -rf "$project-"*".AppImage"
|
||||||
|
|
||||||
|
# Run appimage-builder in extract-and-run mode for Docker compatibility.
|
||||||
|
project="$project" project_lower="$project_lower" arch_deb="$arch_deb" arch_appimage="$arch_appimage" \
|
||||||
|
APPIMAGE_EXTRACT_AND_RUN=1 ./appimage-builder.AppImage --recipe .ci/AppImageBuilder.yml
|
||||||
status=$?
|
status=$?
|
||||||
|
|
||||||
|
# Rename AppImage to the final name if the build succeeded.
|
||||||
|
if [ $status -eq 0 ]
|
||||||
|
then
|
||||||
|
mv "$project-"*".AppImage" "$cwd/$package_name.AppImage"
|
||||||
|
status=$?
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user