Browse Source

move debian script to meson

before_cleanup
Alexandros Theodotou 2 years ago
parent
commit
9e6153afa1
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 2
      debian/changelog.in
  2. 0
      debian/compat
  3. 8
      debian/control.in
  4. 0
      debian/copyright
  5. 20
      debian/debian.rules
  6. 63
      debian/meson.build
  7. 32
      debian/rules.in
  8. 53
      meson.build
  9. 2
      scripts/make_carla.sh.in
  10. 33
      scripts/make_debian_pkg.sh.in
  11. 16
      scripts/make_lsp_dsp_lib.sh.in
  12. 3
      scripts/make_zplugins.sh.in
  13. 6
      scripts/meson.build
  14. 10
      sources/meson.build

2
debian/debian.changelog.in → debian/changelog.in vendored

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
zrythm (@VERSION@-1) unstable; urgency=medium
zrythm@DASH_TRIAL@ (@ZRYTHM_PKG_VERSION@-1) unstable; urgency=medium
* Move from OBS

0
debian/debian.compat → debian/compat vendored

8
debian/debian.control → debian/control.in vendored

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
Source: zrythm
Source: zrythm@DASH_TRIAL@
Maintainer: Alexandros Theodotou <alex@zrythm.org>
Section: sound
Build-Depends: debhelper (>=9),
Build-Depends: debhelper (>=9),
desktop-file-utils,
gettext,
guile-2.2-dev,
@ -31,9 +31,9 @@ Build-Depends: debhelper (>=9), @@ -31,9 +31,9 @@ Build-Depends: debhelper (>=9),
Standards-Version: 3.9.8
Homepage: https://www.zrythm.org/
Package: zrythm
Package: zrythm@DASH_TRIAL@
Architecture: any
Depends: ${shlibs:Depends},
Depends: ${shlibs:Depends},
${misc:Depends},
fonts-dseg, xdg-utils, breeze-icon-theme
Description: a highly automated and intuitive digital audio workstation

0
debian/debian.copyright → debian/copyright vendored

20
debian/debian.rules vendored

@ -1,20 +0,0 @@ @@ -1,20 +0,0 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_configure:
mkdir -p debian/build
cd debian/build && PKG_CONFIG_PATH=/usr/lib/zrythm/lib/pkgconfig PATH=$$PATH:/home/build/.local/bin ../../../../meson/meson.py --prefix=/usr ../.. -Dtests=true -Ddseg_font=false -Dmanpage=true -Dbuildtype=debugoptimized -Dlsp_dsp=enabled -Dstatic_lsp_dsp=true -Dsdl=enabled -Dfallback_version=@VERSION@ -Drtaudio=auto -Drtmidi=auto -Dguile=enabled -Dcarla=enabled -Dgraphviz=enabled
override_dh_auto_build:
cd debian/build && ninja -v
override_dh_auto_test:
echo test # cd debian/build && ninja test
override_dh_auto_install:
cd debian/build && DESTDIR=${CURDIR}/debian/zrythm ninja install
mkdir -p ${CURDIR}/debian/zrythm/usr/lib/zrythm/lib
cp -RLv /usr/lib/zrythm/lib/carla ${CURDIR}/debian/zrythm/usr/lib/zrythm/lib/
if [ ! -f ${CURDIR}/debian/zrythm/usr/lib/zrythm/lib/carla/libcarla_native-plugin.so ] ; then exit -1 ; fi

63
debian/meson.build vendored

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
# Copyright (C) 2020 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/>.
debian_changelog = configure_file (
output: 'changelog.in',
input: 'changelog',
configuration: global_conf,
)
debian_control = configure_file (
output: 'control.in',
input: 'control',
configuration: global_conf,
)
debian_rules = configure_file (
output: 'rules.in',
input: 'rules',
configuration: global_conf,
)
debian_pkg_filename = run_command (
get_pkg_filename, 'DEBIAN').stdout ().strip ()
debian_pkg = custom_target (
'debian-pkg',
output: debian_pkg_filename,
input: [
debian_changelog, debian_rules,
'compat', debian_control, 'copyright',
],
command: [
make_debian_pkg, '@OUTPUT@', '@INPUT0@', '@INPUT1@',
'@INPUT2@', '@INPUT3@', '@INPUT4@',
],
depends: [
debian_zrythm_src_tarball_gzipped,
carla_installation,
lsp_dsp_lib_installation,
zrythm_src_tarball,
zplugins_installation,
],
install: true,
install_dir: get_option ('prefix'),
)
run_target (
'debian',
command: [ 'echo', 'done' ],
depends: debian_pkg)

32
debian/rules.in vendored

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_configure:
mkdir -p debian/build
cd debian/build && \
PATH=$$PATH:/home/build/.local/bin \
@MESON_BIN@ --prefix=/usr ../.. \
-Dpkg_config_path=@TEMP_LIBRARY_PKG_CONFIG_PATH@:@TEMP_CARLA_PKG_CONFIG_PATH@ \
-Dtests=true -Ddseg_font=false -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@
override_dh_auto_build:
cd debian/build && ninja -v
override_dh_auto_test:
echo test # cd debian/build && ninja test
override_dh_auto_install:
cd debian/build && \
DESTDIR=${CURDIR}/debian/zrythm@DASH_TRIAL@ ninja install
mkdir -p ${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/lib
cp -RLv @TEMP_CARLA_PREFIX@/lib/carla \
${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/lib/
if [ ! -f ${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/lib/carla/libcarla_native-plugin.so ] ; then exit -1 ; fi

53
meson.build

@ -22,6 +22,8 @@ project ( @@ -22,6 +22,8 @@ project (
license: 'AGPL-3-or-later',
)
cc = meson.get_compiler ('c')
bash = find_program ('bash')
meson_bin = find_program ('meson')
@ -32,6 +34,7 @@ zrythm_git_ver = get_option ('zrythm-git-ver') @@ -32,6 +34,7 @@ zrythm_git_ver = get_option ('zrythm-git-ver')
zrythm_pkg_ver = get_option ('zrythm-pkg-ver')
zplugins_ver = get_option ('zplugins-ver')
carla_git_ver = get_option ('carla-git-ver')
lsp_dsp_lib_ver = get_option ('lsp-dsp-lib-ver')
build_trial = get_option ('build-trial')
zrythm_src_tarball_filename = 'zrythm-' + zrythm_pkg_ver + '.tar.gz'
zplugins_src_tarball_filename = 'zplugins-' + zplugins_ver + '.tar.gz'
@ -39,7 +42,8 @@ mingw_prefix = 'mingw-w64-x86_64-' @@ -39,7 +42,8 @@ mingw_prefix = 'mingw-w64-x86_64-'
mingw_zrythm_pkg_filename = mingw_prefix + 'zrythm-' + zrythm_pkg_ver + '-1-any.pkg.tar.zst'
mingw_zrythm_trial_pkg_filename = mingw_prefix + 'zrythm-trial-' + zrythm_pkg_ver + '-1-any.pkg.tar.zst'
debian_src_tarball_filename = 'zrythm_' + zrythm_pkg_ver + '.orig.tar.gz'
temp_lib_zrythm_dir = meson.build_root () / 'tmp' / libdir / 'zrythm'
temp_carla_prefix = meson.build_root () / 'tmp_carla_prefix'
temp_carla_pkgconfig_path = meson.build_root () / 'tmp_carla_prefix'
temp_zplugins_prefix = meson.build_root () / 'tmp_zplugins_prefix'
temp_zplugins_suffix = 'lib/lv2'
temp_zplugins_dir = temp_zplugins_prefix / temp_zplugins_suffix
@ -54,14 +58,30 @@ global_conf.set ( @@ -54,14 +58,30 @@ global_conf.set (
'MESON_BUILD_ROOT', meson.build_root ())
global_conf.set (
'MESON_SOURCE_ROOT', meson.source_root ())
global_conf.set (
'CC', cc.get_id ())
global_conf.set (
'ZRYTHM_GIT_VERSION', zrythm_git_ver)
global_conf.set (
'ZRYTHM_PKG_VERSION', zrythm_pkg_ver)
global_conf.set (
'ZPLUGINS_VER', zplugins_ver)
global_conf.set (
'CARLA_GIT_VER', carla_git_ver)
global_conf.set (
'LSP_DSP_LIB_VER', lsp_dsp_lib_ver)
global_conf.set (
'TEMP_LIBRARY_PREFIX', temp_library_prefix)
global_conf.set (
'TEMP_LIBRARY_PKG_CONFIG_PATH', temp_library_pkgconfig_path)
global_conf.set (
'TEMP_CARLA_PREFIX', temp_carla_prefix)
global_conf.set (
'TEMP_CARLA_PKG_CONFIG_PATH', temp_carla_pkgconfig_path)
global_conf.set (
'DASH_TRIAL', build_trial ? '-trial' : '')
global_conf.set (
'TRIAL_TRUE_FALSE', build_trial ? 'true' : 'false')
global_conf.set (
'MINGW_ZRYTHM_PKG_FILENAME', mingw_zrythm_pkg_filename)
global_conf.set (
@ -87,18 +107,18 @@ carla_installation = custom_target ( @@ -87,18 +107,18 @@ carla_installation = custom_target (
output: 'carla-native-plugin.pc',
input: carla_src_zip,
command: [
make_carla, temp_lib_zrythm_dir, 'sudo', '@INPUT@', carla_git_ver, '&&',
make_carla, 'sudo', '@INPUT@', carla_git_ver, '&&',
'cp', temp_lib_zrythm_dir + '/lib/pkgconfig/carla-native-plugin.pc', '@OUTPUT@',
],
install: false,
)
# this is the parent dir
zplugins_installation = custom_target (
'zplugins-installation',
output: 'built_zplugins',
input: zplugins_src_tarball,
command: [
'rm', '-rf', '@OUTPUT@', '&&',
make_zplugins, zplugins_src_tarball,
temp_zplugins_prefix, temp_zplugins_suffix, '&&',
'mv', temp_zplugins_prefix / temp_zplugins_suffix,
@ -107,25 +127,16 @@ zplugins_installation = custom_target ( @@ -107,25 +127,16 @@ zplugins_installation = custom_target (
install: false,
)
debian_pkg_filename = run_command (
get_pkg_filename, 'DEBIAN').stdout ().strip ()
debian_pkg = custom_target (
'debian-pkg',
output: debian_pkg_filename,
lsp_dsp_lib_installation = custom_target (
'lsp-dsp-lib-installation',
output: 'lsp-dsp-lib.pc',
input: lsp_dsp_lib_src_tarball,
command: [
make_debian_pkg, '-o', '@OUTPUT@',
make_lsp_dsp_lib, '@INPUT@', '&&',
'cp', temp_library_pkgconfig_path / 'lsp-dsp-lib.pc',
'@OUTPUT@',
],
depends: [
debian_zrythm_src_tarball_gzipped,
#carla_installation,
zrythm_src_tarball,
zplugins_installation,
],
install: true,
install_dir: get_option ('prefix'),
install: false,
)
run_target (
'debian',
command: [ 'echo', 'done' ],
depends: debian_pkg)
subdir ('debian')

2
scripts/make_carla.sh.in

@ -12,6 +12,8 @@ carla_source_zip="$3" @@ -12,6 +12,8 @@ carla_source_zip="$3"
# carla git version
carla_git_ver="$4"
export CC=@CC@
export PKG_CONFIG_PATH=$prefix/lib/pkgconfig
if pkg-config --atleast-version=2.1 carla-native-plugin ; then
echo "latest carla installed" ;

33
scripts/make_debian_pkg.sh.in

@ -1,10 +1,27 @@ @@ -1,10 +1,27 @@
#!@BASH@
while getopts ":o:n:m:e:" arg; do
case $arg in
o) out_pkg=$OPTARG;;
n) Name=$OPTARG;;
m) Manufacturing_date=$OPTARG;;
e) Expire_date=$OPTARG;;
esac
done
out_pkg="$1"
deb_changelog=$2
deb_rules=$3
deb_compat=$4
deb_control=$5
deb_copyright=$6
tempdir=`mktemp -d`
deb_dir="$tempdir/debian"
deb_src_dir="$deb_dir/source"
mkdir -p $deb_src_dir
# prepare
cp $deb_changelog $deb_dir/changelog
cp $deb_compat $deb_dir/compat
cp $deb_control $deb_dir/control
cp $deb_copyright $deb_dir/copyright
cp $deb_rules $deb_dir/rules
echo "3.0 (quilt)" > $deb_src_dir/format
cd $tempdir
debuild -us -uc
rm -rf $tempdir

16
scripts/make_lsp_dsp_lib.sh.in

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
#!@BASH@
tarball=$1
lsp_dsp_lib_ver="@LSP_DSP_LIB_VER@"
temp_lib_prefix="@TEMP_LIBRARY_PREFIX@"
export CC=@CC@
tempdir=`mktemp -d`
tar xf $tarball -C $tempdir
ls -l "$tempdir"
cd "$tempdir/lsp-dsp-lib"
make config PREFIX=$temp_lib_prefix
make -j4 && make install
rm -rf $tempdir

3
scripts/make_zplugins.sh.in

@ -1,7 +1,5 @@ @@ -1,7 +1,5 @@
#!@BASH@
set -x
# tarball
tarball="$1"
@ -24,3 +22,4 @@ $meson_bin build --buildtype=debugoptimized \ @@ -24,3 +22,4 @@ $meson_bin build --buildtype=debugoptimized \
--prefix=$prefix
ninja -C build
ninja -C build install
rm -rf $tempdir

6
scripts/meson.build

@ -43,6 +43,12 @@ make_carla = configure_file ( @@ -43,6 +43,12 @@ make_carla = configure_file (
configuration: scripts_conf,
)
make_lsp_dsp_lib = configure_file (
output: 'make_lsp_dsp_lib.sh',
input: 'make_lsp_dsp_lib.sh.in',
configuration: scripts_conf,
)
get_pkg_filename = configure_file (
output: 'get_pkg_filename.sh',
input: 'get_pkg_filename.sh.in',

10
sources/meson.build

@ -69,3 +69,13 @@ zplugins_src_tarball = custom_target ( @@ -69,3 +69,13 @@ zplugins_src_tarball = custom_target (
],
install: false,
)
url = 'https://github.com/sadko4u/lsp-dsp-lib/releases/download/lsp-dsp-lib-' + lsp_dsp_lib_ver + '/lsp-dsp-lib-' + lsp_dsp_lib_ver + '-src.tar.gz'
lsp_dsp_lib_src_tarball = custom_target (
'lsp-dsp-lib-source-tarball',
output: 'lsp-dsp-lib-' + lsp_dsp_lib_ver + '.tar.gz',
command: [
'wget', url, '-O', '@OUTPUT@',
],
install: false,
)

Loading…
Cancel
Save