Browse Source

start moving to meson (WIP)

before_cleanup
Alexandros Theodotou 3 years ago
parent
commit
504f30ebc2
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 0
      debian/debian.changelog.in
  2. 0
      debian/debian.compat
  3. 0
      debian/debian.control
  4. 0
      debian/debian.copyright
  5. 0
      debian/debian.rules
  6. 131
      meson.build
  7. 98
      meson_options.txt
  8. 30
      scripts/get_pkg_filename.sh.in
  9. 22
      scripts/make_carla.sh.in
  10. 10
      scripts/make_debian_pkg.sh.in
  11. 25
      scripts/make_windows_chroot.sh.in
  12. 26
      scripts/make_zplugins.sh.in
  13. 58
      scripts/meson.build
  14. 71
      sources/meson.build

0
debian.changelog.in → debian/debian.changelog.in vendored

0
debian.compat → debian/debian.compat vendored

0
debian.control → debian/debian.control vendored

0
debian.copyright → debian/debian.copyright vendored

0
debian.rules → debian/debian.rules vendored

131
meson.build

@ -0,0 +1,131 @@ @@ -0,0 +1,131 @@
# 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/>.
project (
'zrythm-installer',
version: '0.1',
meson_version: '>=0.55.0',
license: 'AGPL-3-or-later',
)
bash = find_program ('bash')
meson_bin = find_program ('meson')
prefix = get_option ('prefix')
libdir = get_option ('libdir')
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')
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'
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_zplugins_prefix = meson.build_root () / 'tmp_zplugins_prefix'
temp_zplugins_suffix = 'lib/lv2'
temp_zplugins_dir = temp_zplugins_prefix / temp_zplugins_suffix
temp_library_prefix = meson.build_root () / 'tmp_lib_prefix'
temp_library_pkgconfig_path = temp_library_prefix / libdir / 'pkgconfig'
global_conf = configuration_data ()
global_conf.set ('PREFIX', prefix)
global_conf.set (
'MESON_BIN', meson_bin.full_path ())
global_conf.set (
'MESON_BUILD_ROOT', meson.build_root ())
global_conf.set (
'MESON_SOURCE_ROOT', meson.source_root ())
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 (
'DASH_TRIAL', build_trial ? '-trial' : '')
global_conf.set (
'MINGW_ZRYTHM_PKG_FILENAME', mingw_zrythm_pkg_filename)
global_conf.set (
'MINGW_ZRYTHM_TRIAL_PKG_FILENAME', mingw_zrythm_trial_pkg_filename)
global_conf.set (
'LV2_VERSION', get_option ('lv2-ver'))
global_conf.set (
'SERD_VERSION', get_option ('serd-ver'))
global_conf.set (
'SORD_VERSION', get_option ('sord-ver'))
global_conf.set (
'SRATOM_VERSION', get_option ('sratom-ver'))
global_conf.set (
'LILV_VERSION', get_option ('lilv-ver'))
global_conf.set (
'JACK_VERSION', get_option ('jack-ver'))
subdir ('scripts')
subdir ('sources')
carla_installation = custom_target (
'carla-installation',
output: 'carla-native-plugin.pc',
input: carla_src_zip,
command: [
make_carla, temp_lib_zrythm_dir, '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: [
make_zplugins, zplugins_src_tarball,
temp_zplugins_prefix, temp_zplugins_suffix, '&&',
'mv', temp_zplugins_prefix / temp_zplugins_suffix,
'@OUTPUT@'
],
install: false,
)
debian_pkg_filename = run_command (
get_pkg_filename, 'DEBIAN').stdout ().strip ()
debian_pkg = custom_target (
'debian-pkg',
output: debian_pkg_filename,
command: [
make_debian_pkg, '-o', '@OUTPUT@',
],
depends: [
debian_zrythm_src_tarball_gzipped,
#carla_installation,
zrythm_src_tarball,
zplugins_installation,
],
install: true,
install_dir: get_option ('prefix'),
)
run_target (
'debian',
command: [ 'echo', 'done' ],
depends: debian_pkg)

98
meson_options.txt

@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
# 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/>.
option (
'zrythm-git-ver', type: 'string',
value: 'master',
description: 'Git tag/commit')
option (
'zrythm-pkg-ver', type: 'string',
value: '1',
description: 'Version to use in packages')
option (
'build-trial', type: 'boolean',
value: false,
description: 'Whether to build trial packages')
option (
'zplugins-ver', type: 'string',
value: '0.1.3',
description: 'Zplugins version')
option (
'carla-git-ver', type: 'string',
value: '6a783076e89b878339190aeb60477d21a9596068',
description: 'Carla version')
option (
'lsp-dsp-lib-ver', type: 'string',
value: '0.5.8',
description: 'LSP DSP lib version')
option (
'rcedit-ver', type: 'string',
value: '1.1.1',
description: 'RCEdit version')
option (
'carla-bottle-ver', type: 'string',
value: '0.1.2',
description: 'RCEdit version')
option (
'locales', type: 'array',
choices : [
'en', 'de', 'fr', 'it', 'ja', 'pt',
],
description: 'Locales for the manual')
option (
'distro', type: 'string',
value: 'debian10',
description: 'Distro to build')
option (
'lv2-ver', type: 'string',
value: '1.18.0',
description: 'LV2 version')
option (
'serd-ver', type: 'string',
value: '0.30.4',
description: 'Serd version')
option (
'sord-ver', type: 'string',
value: '0.16.4',
description: 'Sord version')
option (
'sratom-ver', type: 'string',
value: '0.6.4',
description: 'Sratom version')
option (
'lilv-ver', type: 'string',
value: '0.24.8',
description: 'Lilv version')
option (
'jack-ver', type: 'string',
value: '1.9.14.r1',
description: 'JACK version')

30
scripts/get_pkg_filename.sh.in

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
#!@BASH@
# package type (DEBIAN, FEDORA, etc.)
pkg_type="$1"
# "-trial" if trial
trial="@DASH_TRIAL@"
zrythm_pkg_ver=@ZRYTHM_PKG_VERSION@
case "$pkg_type" in
"ARCH")
echo "zrythm${trial}-$zrythm_pkg_ver-1-x86_64.pkg.tar.zst"
;;
"DEBIAN")
echo "zrythm${trial}_$zrythm_pkg_ver-1_amd64.deb"
;;
"FEDORA")
echo "zrythm${trial}-$zrythm_pkg_ver-1.x86_64.rpm"
;;
"GNU_LINUX")
echo "zrythm${trial}-$zrythm_pkg_ver-installer.zip"
;;
"OSX_BREW")
echo "zrythm${trial}-$zrythm_pkg_ver-osx-installer.zip"
;;
"WINDOWS_MSYS")
echo "zrythm${trial}-$zrythm_pkg_ver-ms-setup.exe"
;;
esac

22
scripts/make_carla.sh.in

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
#!@BASH@
# prefix to install in
prefix="$1"
# sudo or empty
sudo_or_empty="$2"
# full path to carla source zip
carla_source_zip="$3"
# carla git version
carla_git_ver="$4"
export PKG_CONFIG_PATH=$prefix/lib/pkgconfig
if pkg-config --atleast-version=2.1 carla-native-plugin ; then
echo "latest carla installed" ;
fi
tempdir=`mktemp -d`
unzip -o "$carla_source_zip" -d "$tempdir"
cd "$tempdir/Carla-$carla_git_ver"
make -j4 && $sudo_or_empty make install PREFIX="$prefix"

10
scripts/make_debian_pkg.sh.in

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!@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

25
scripts/make_windows_chroot.sh.in

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
#!@BASH@
# chroot dir
chroot_dir="$1"
# full paths to each package (pkg.tar.zst) to install
packages="${@:2}"
rm -rf $chroot_dir
mkdir -p $chroot_dir/var/lib/pacman
mkdir -p $chroot_dir/var/log
mkdir -p $chroot_dir/tmp
pacman -Syu --root $chroot_dir
pacman -S \
filesystem bash pacman \
mingw-w64-x86_64-gtksourceview4 \
--noconfirm --needed --root $chroot_dir
for pkg in "$packages"; do
pacman -U "$pkg" --noconfirm --needed --root $chroot_dir
done
pacman -U $zrythm_pkg_tar \
--noconfirm --needed --root $chroot_dir
cp -R /mingw64/lib/carla "$chroot_dir/mingw64/lib/"
glib-compile-schemas.exe \
"$chroot_dir/mingw64/share/glib-2.0/schemas"

26
scripts/make_zplugins.sh.in

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
#!@BASH@
set -x
# tarball
tarball="$1"
# prefix to install at, eg '/usr'
prefix="$2"
# lv2 dir suffix after the prefix, eg 'lib/lv2'
lv2_dir="$3"
meson_bin="@MESON_BIN@"
zplugins_ver="@ZPLUGINS_VER@"
echo `pwd`
rm -rf "$prefix/$lv2_dir"
tempdir=`mktemp -d`
tar xf $tarball -C $tempdir
cd $tempdir/zplugins-$zplugins_ver
$meson_bin build --buildtype=debugoptimized \
--prefix=$prefix
ninja -C build
ninja -C build install

58
scripts/meson.build

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
# 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/>.
_scripts_conf = {
'SCRIPTS_DIR': meson.current_build_dir (),
'BASH': bash.full_path (),
}
scripts_conf = configuration_data ()
scripts_conf.merge_from (global_conf)
scripts_conf.set ('SCRIPTS_DIR', meson.current_build_dir ())
scripts_conf.set ('BASH', bash.full_path ())
# configure each script
make_windows_chroot = configure_file (
output: 'make_windows_chroot.sh',
input: 'make_windows_chroot.sh.in',
configuration: scripts_conf,
)
make_debian_pkg = configure_file (
output: 'make_debian_pkg.sh',
input: 'make_debian_pkg.sh.in',
configuration: scripts_conf,
)
make_carla = configure_file (
output: 'make_carla.sh',
input: 'make_carla.sh.in',
configuration: scripts_conf,
)
get_pkg_filename = configure_file (
output: 'get_pkg_filename.sh',
input: 'get_pkg_filename.sh.in',
configuration: scripts_conf,
)
make_zplugins = configure_file (
output: 'make_zplugins.sh',
input: 'make_zplugins.sh.in',
configuration: scripts_conf,
)
built_scripts_dir = meson.current_build_dir ()

71
sources/meson.build

@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
# 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/>.
url = 'https://git.zrythm.org/cgit/zrythm/snapshot/zrythm-' + zrythm_git_ver + '.tar.gz'
zrythm_src_tarball = custom_target (
'zrythm-source-tarball',
output: zrythm_src_tarball_filename,
command: [
'wget', url, '-O', '@OUTPUT@',
],
install: false,
)
debian_zrythm_src_tarball = custom_target (
'debian-zrythm-source-tarball',
output: debian_src_tarball_filename.split ('.gz')[0],
input: zrythm_src_tarball,
command: [
'rm', '-rf', '@OUTPUT@', '&&',
# rezip because gzip says not valid gzip format
'tar', 'xf', '@INPUT@', '&&',
'tar', 'cf', '@OUTPUT@', 'zrythm-' + zrythm_git_ver, '&&',
'rm', '-rf', 'zrythm-' + zrythm_pkg_ver,
],
install: false,
)
debian_zrythm_src_tarball_gzipped = custom_target (
'debian-zrythm-source-tarball-gzipped',
output: debian_src_tarball_filename,
input: debian_zrythm_src_tarball,
command: [
'rm', '-rf', '@OUTPUT@', '&&',
'gzip', '@INPUT@',
],
install: false,
)
url = 'https://github.com/falkTX/Carla/archive/' + carla_git_ver + '.zip'
carla_src_zip = custom_target (
'carla-source-tarball',
output: 'Carla-' + carla_git_ver + '.zip',
command: [
'wget', url, '-O', '@OUTPUT@',
],
install: false,
)
url = 'https://git.zrythm.org/cgit/zplugins/snapshot/zplugins-' + zplugins_ver + '.tar.gz'
zplugins_src_tarball = custom_target (
'zplugins-source-tarball',
output: zplugins_src_tarball_filename,
command: [
'wget', url, '-O', '@OUTPUT@',
],
install: false,
)
Loading…
Cancel
Save