Browse Source

add AppImage build

use_builds_script
Alexandros Theodotou 2 years ago
parent
commit
cc2d130774
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 128
      appimage/appimage-builder.yml.in
  2. 73
      appimage/make_appimage.sh.in
  3. 71
      appimage/meson.build
  4. 19
      meson.build
  5. 3
      scripts/get_pkg_filename.sh.in
  6. 3
      scripts/get_pkg_filename_from_distro.sh.in

128
appimage/appimage-builder.yml.in

@ -0,0 +1,128 @@ @@ -0,0 +1,128 @@
version: 1
AppDir:
path: @APPDIR_PATH@
app_info:
id: org.zrythm.Zrythm
name: zrythm@DASH_TRIAL@
icon: zrythm
version: @ZRYTHM_PKG_VERSION@
exec: usr/bin/zrythm
exec_args: --appimage-runtime-path=$APPDIR $@
apt:
arch: amd64
sources:
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal universe'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates main'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates universe'
include:
# can also add paths to deb files here
- libglib2.0-0
- libgtk-3-0
- libgdk-pixbuf2.0-common
#- liblilv-0-0
- libpulse0
- libxcb-shm0
- libxcb1
- coreutils
- bash
- librsvg2-common
- gettext
- guile-2.2-libs
- libcurl3-gnutls
- libsndfile1
- libxcb-render0
- libasound2
- libgtksourceview-3.0-common
- libgtksourceview-3.0-1
- graphviz
- librubberband2
- libx11-6
- libfftw3-3
- libsamplerate0
- libyaml-0-2
- libxxhash0
- shared-mime-info
- breeze-icon-theme
exclude:
- dpkg
files:
include:
- /etc/mime.types
- /usr/lib/zrythm/carla/libcarla_host-plugin.so
exclude:
- usr/bin/gio*
- usr/bin/glib-compile-schemas
- usr/bin/glib-compile-resources
- usr/bin/gsettings
- usr/bin/gapplication
- usr/bin/gresource
- usr/bin/gobject-query
- usr/bin/gtester
- usr/share/icons/breeze
- usr/share/icons/ubuntu-*
- usr/share/icons/Humanity*
- usr/share/doc/lib*
- usr/share/doc/coreutils
- usr/share/doc/gettext-base
- usr/share/doc/adwaita-icon-theme
- bin/systemctl
- bin/cp
- bin/mv
- bin/vdir
- bin/ls
- bin/dir
- bin/date
- bin/touch
- usr/lib/x86_64-linux-gnu/guile/2.2/ccache
after_bundle:
# this is executed after the packages and files are added
- echo $APPDIR
- mv $APPDIR/usr/lib/zrythm/carla/libcarla_host-plugin.so $APPDIR/usr/lib/x86_64-linux-gnu/
- patchelf --remove-rpath $APPDIR/usr/bin/zrythm
- patchelf --replace-needed /usr/lib/zrythm/carla/libcarla_host-plugin.so libcarla_host-plugin.so $APPDIR/usr/bin/zrythm
after_runtime:
# workaround for missing libcrypt.so.1 (version 2) on arch based system
- echo $APPDIR
- mkdir -p $APPDIR/lib/x86_64-linux-gnu
- rm -f $APPDIR/lib/x86_64-linux-gnu/libcrypt.so.1 || true
- ln -s /usr/lib/libcrypt.so.2 $APPDIR/lib/x86_64-linux-gnu/libcrypt.so.1
test:
fedora:
image: fedora:32
command: "./AppRun --version"
use_host_x: True
archlinux:
image: archlinux
command: "./AppRun --version"
use_host_x: True
debian-sid:
image: debian:sid
command: "./AppRun --version"
use_host_x: True
runtime:
path_mappings:
- /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0
- /usr/lib/gdk-pixbuf-2.0:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0
#- /usr/lib/zrythm:$APPDIR/usr/lib/zrythm
env:
GDK_PIXBUF_MODULEDIR: '${APPDIR}/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders'
GDK_PIXBUF_MODULE_FILE: '${APPDIR}/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache'
GTK_DATA_PREFIX: '${APPDIR}/usr'
GTK_EXE_PREFIX: '${APPDIR}/usr'
GTK_PATH: '${APPDIR}/usr'
AppImage:
update-information: None
sign-key: None
arch: x86_64

73
appimage/make_appimage.sh.in

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
#!@BASH@
set -xe
# args:
# 1: output package (.AppImage) path
# 2: appimage-builder.yml path
# 3: zrythm source tarball path
# 4: private dir
out_pkg="$1"
appimage_builder_yml="$2"
zrythm_src_tarball="$3"
private_dir="$4"
appdir_root="@APPDIR_PATH@"
inner_dir="@ZRYTHM_INNER_DIR_NAME@"
zrythm_src_tarball_filename="@ZRYTHM_SOURCE_TARBALL_FILENAME@"
appimage_filename=`basename "$out_pkg"`
rm -rf "$appdir_root"
rm -rf "$private_dir"
mkdir -p "$private_dir"
cp "$appimage_builder_yml" "$private_dir"/
cp "$zrythm_src_tarball" "$private_dir"/
tar xf "$zrythm_src_tarball" -C "$private_dir"
pushd "$private_dir"
pushd "$inner_dir"
# configure
PATH="$PATH:/home/build/.local/bin" \
@MESON_BIN@ build --prefix=/usr \
-Dpkg_config_path=@LIBRARY_PKG_CONFIG_PATH@:@CARLA_PKG_CONFIG_PATH@ \
-Dtests=true -Ddseg_font=true -Dmanpage=true \
-Dbuildtype=debugoptimized -Dlsp_dsp=enabled \
-Dstatic_lsp_dsp=true -Dsdl=enabled \
-Dfallback_version=@ZRYTHM_PKG_VERSION@ \
-Drtaudio=auto -Drtmidi=auto -Dguile=enabled \
-Dcarla=enabled -Dgraphviz=enabled \
-Dtrial_ver=@TRIAL_TRUE_FALSE@ \
-Dextra_debug_info=true \
-Dphone_home=enabled \
-Dinstaller_ver=true \
-Dappimage=true \
-Dcarla_binaries_dir=@CARLA_FULL_BINS_PATH@
# build
ninja -C build
# install in AppDir
DESTDIR="$appdir_root" ninja -C build install
# also copy required lib
cp "@CARLA_FULL_BINS_PATH@/libcarla_host-plugin.so" \
"$appdir_root"/usr/lib/zrythm/carla/
popd # zrythm tarball inner dir
# create appimage from AppDir
appimage-builder --recipe ./appimage-builder.yml --skip-test
# test that appimage works
./"$appimage_filename" --version
# run lint
appimagelint "$appimage_filename"
popd # private dir
# copy AppImage from private dir to dest
cp "$private_dir"/"$appimage_filename" "$out_pkg"

71
appimage/meson.build

@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
# Copyright (C) 2021 Alexandros Theodotou <alex at zrythm dot org>
#
# This file is part of Zrythm
#
# Zrythm is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Zrythm is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
appimage_conf = configuration_data ()
appimage_conf.merge_from (global_conf)
appimage_conf.set (
'BUILT_ZPLUGINS_DIR', zplugins_installation.full_path ())
appimage_conf.set (
'CARLA_DESTDIR', carla_installation.full_path ())
appimage_conf.set (
'CARLA_PKG_CONFIG_PATH', carla_pkgconfig_path)
appimage_conf.set (
'CARLA_FULL_BINS_PATH',
carla_installation.full_path () + carla_prefix / 'carla')
appimage_conf.set (
'APPDIR_PATH', '/tmp/AppDir')
find_program ('appimage-builder')
make_appimage_pkg = configure_file (
output: 'make_appimage.sh',
input: 'make_appimage.sh.in',
configuration: appimage_conf,
)
appimage_builder_yml = configure_file (
output: 'appimage-builder.yml',
input: 'appimage-builder.yml.in',
configuration: appimage_conf,
)
appimage_pkg_filename = run_command (
get_pkg_filename, 'APPIMAGE', dash_trial).stdout ().strip ()
appimage_pkg = custom_target (
'appimage-pkg',
output: appimage_pkg_filename,
input: [
appimage_builder_yml, zrythm_src_tarball,
],
command: [
make_appimage_pkg, '@OUTPUT@', '@INPUT0@', '@INPUT1@',
'@PRIVATE_DIR@',
],
depends: [
carla_installation,
lsp_dsp_lib_installation,
zplugins_installation,
],
console: true,
install: true,
install_dir: get_option ('prefix'),
)
run_target (
'appimage',
command: [ 'echo', 'done' ],
depends: appimage_pkg)

19
meson.build

@ -67,6 +67,7 @@ is_rpm = distro.contains ('fedora') @@ -67,6 +67,7 @@ is_rpm = distro.contains ('fedora')
is_windows_msys = distro.contains ('windows10-msys')
is_osx_brew = distro.contains ('osx-brew')
is_gnu_linux = distro.contains ('gnu-linux')
is_appimage = distro.contains ('appimage')
global_conf = configuration_data ()
global_conf.set ('PREFIX', prefix)
@ -194,31 +195,35 @@ lsp_dsp_lib_installation = custom_target ( @@ -194,31 +195,35 @@ lsp_dsp_lib_installation = custom_target (
)
if is_arch
subdir ('arch')
subdir ('arch')
endif
if is_debian
subdir ('debian')
subdir ('debian')
endif
if is_nixos
subdir ('nixos')
subdir ('nixos')
endif
if is_rpm
subdir ('rpm')
subdir ('rpm')
endif
if is_windows_msys
subdir ('windows-msys')
subdir ('windows-msys')
endif
if is_osx_brew
subdir ('osx-brew')
subdir ('osx-brew')
endif
if is_gnu_linux
subdir ('gnu-linux')
subdir ('gnu-linux')
endif
if is_appimage
subdir ('appimage')
endif
summary ({

3
scripts/get_pkg_filename.sh.in

@ -18,6 +18,9 @@ case "$pkg_type" in @@ -18,6 +18,9 @@ case "$pkg_type" in
"FEDORA")
echo "zrythm${trial}-$zrythm_pkg_ver-1.x86_64.rpm"
;;
"APPIMAGE")
echo "zrythm${trial}-$zrythm_pkg_ver-x86_64.AppImage"
;;
"GNU_LINUX")
echo "zrythm${trial}-$zrythm_pkg_ver-installer.zip"
;;

3
scripts/get_pkg_filename_from_distro.sh.in

@ -36,6 +36,9 @@ distro_to_pkg_type () { @@ -36,6 +36,9 @@ distro_to_pkg_type () {
"gnu-linux")
echo "GNU_LINUX"
;;
"appimage")
echo "APPIMAGE"
;;
esac
}
pkg_type=$(distro_to_pkg_type $distro)

Loading…
Cancel
Save