Browse Source

only install specific carla libs/binaries, add Zrythm- prefix to lv2 plugins

use_builds_script
Alexandros Theodotou 2 years ago
parent
commit
6770e73ef1
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 11
      arch/PKGBUILD.in
  2. 16
      debian/rules.in
  3. 136
      osx-brew/installer.sh.in
  4. 17
      osx-brew/make_pkg.sh.in
  5. 41
      osx-brew/make_zip.sh.in
  6. 11
      osx-brew/meson.build
  7. 4
      osx-brew/postinstall.in
  8. 5
      osx-brew/zrythm.rb.in
  9. 0
      rpm/make_rpm_pkg.sh.in
  10. 6
      rpm/meson.build
  11. 24
      rpm/zrythm.spec.in
  12. 19
      scripts/make_carla.sh.in
  13. 6
      scripts/meson.build
  14. 3
      windows-msys/make_dist_dir.sh.in

11
arch/PKGBUILD.in

@ -51,8 +51,13 @@ package() { @@ -51,8 +51,13 @@ package() {
-t "${pkgdir}/usr/share/doc/zrythm/"
DESTDIR="${pkgdir}/" ninja -C build install
mkdir -p "${pkgdir}/usr/lib/zrythm/lib/lv2"
cp -RLv @CARLA_FULL_BINS_PATH@ \
${pkgdir}/usr/lib/zrythm/lib/
for file in carla-discovery-native carla-bridge-lv2-gtk2 carla-bridge-lv2-gtk3 carla-bridge-lv2-qt5 carla-bridge-lv2-x11 carla-bridge-native libcarla_host-pllugin.so; do
cp -Lv "@CARLA_FULL_BINS_PATH@/$file" \
${pkgdir}/usr/lib/zrythm/carla/
done
cp -RLv @BUILT_ZPLUGINS_DIR@/* \
${pkgdir}/usr/lib/zrythm/lib/lv2/
${pkdir}/usr/lib/lv2/
for f in `ls %{buildroot}/usr/lib/lv2`; do
mv $f "%{buildroot}/usr/lib/lv2/Zrythm-$f"
done
}

16
debian/rules.in vendored

@ -30,9 +30,15 @@ override_dh_auto_test: @@ -30,9 +30,15 @@ override_dh_auto_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/lv2
cp -RLv @CARLA_FULL_BINS_PATH@ \
${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/lib/
mkdir -p ${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/lv2
mkdir -p ${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/carla
for file in carla-discovery-native carla-bridge-lv2-gtk2 carla-bridge-lv2-gtk3 carla-bridge-lv2-qt5 carla-bridge-lv2-x11 carla-bridge-native libcarla_host-pllugin.so; do
cp -Lv "@CARLA_FULL_BINS_PATH@/${file}" \
%{buildroot}/usr/lib/zrythm/carla/
done
cp -RLv @BUILT_ZPLUGINS_DIR@/* \
${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/lib/lv2/
if [ ! -f ${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/lib/carla/libcarla_host-plugin.so ] ; then exit 1 ; fi
${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/lv2/
for f in `ls ${CURDIR}/usr/lib/lv2`; do
mv $f "${CURDIR}/usr/lib/lv2/Zrythm-$f"
done
if [ ! -f ${CURDIR}/debian/zrythm@DASH_TRIAL@/usr/lib/zrythm/carla/libcarla_host-plugin.so ] ; then exit 1 ; fi

136
osx-brew/installer.sh.in

@ -1,136 +0,0 @@ @@ -1,136 +0,0 @@
#!/bin/bash
#
# 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/>.
set -e
zrythm_ver="@ZRYTHM_PKG_VERSION@"
carla_ver="@CARLA_BOTTLE_VER@"
show_error () {
echo "$1" >&2
exit 1
}
show_info () {
echo "$1"
}
if ! [ -x "$(command -v brew)" ]; then
echo 'Error: brew is not installed. install it?'
read -p "$proceed_txt (type Y or y): " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
else
show_error "Homebrew is necessary to install zrythm"
fi
fi
print_install_success()
{
show_info "Install successful! Type 'zrythm --version' to verify"
}
proceed=0
proceed_txt="Proceed with the installation of Zrythm v$zrythm_ver?"
read -p "$proceed_txt (type Y or y): " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
proceed=1
fi
# install packages
if [ $proceed -ne 0 ]; then
echo "Unpacking..."
tar xf bin/carla-git*.catalina.bottle.tar.gz -C /usr/local/Cellar
brew unlink carla-git || true
brew unlink zrythm || true
brew unlink zrythm-trial || true
# link
echo "Linking..."
brew switch carla-git $carla_ver || true
brew unlink carla-git && \
brew link --overwrite carla-git && \
brew switch carla-git $carla_ver
# install deps
echo "Installing deps..."
carla_deps="$(brew info carla-git | grep Required | sed -e "s/Required: //" | sed -e "s/, / /g")"
brew upgrade
brew install $carla_deps || true
# fix paths
echo "Fixing paths..."
for exe in $(ls /usr/local/opt/carla-git/bin); do
exe=/usr/local/opt/carla-git/bin/$exe
echo "processing executable $exe"
chmod +w $exe
if [[ "$exe" == *".dylib" ]]; then
new_id="$(otool -L $exe | sed "1d" | head -n 1 | awk '{print $1}' | sed -e "s,@@HOMEBREW_CELLAR@@,/usr/local/Cellar,g")"
install_name_tool -id "$exe" "$new_id"
fi
changes=""
for lib in `otool -L $exe | grep '@@HOMEBREW_PREFIX@@\|@@HOMEBREW_CELLAR@@' | grep -v "/usr/lib" | awk '{print $1}'` ; do
replaced=`echo "$lib" | sed -e "s,@@HOMEBREW_PREFIX@@,/usr/local,g" | sed -e "s,@@HOMEBREW_CELLAR@@,/usr/local/Cellar,g"`
changes="$changes -change $lib $replaced"
done
if test "x$changes" != "x" ; then
install_name_tool $changes $exe
fi
chmod -w $exe
done
for pc_file in $(ls /usr/local/opt/carla-git/lib/pkgconfig); do
pc_file=/usr/local/opt/carla-git/lib/pkgconfig/$pc_file
echo "processing pc file $pc_file"
sed -i -e "s,@@HOMEBREW_PREFIX@@,/usr/local,g" $pc_file
sed -i -e "s,@@HOMEBREW_CELLAR@@,/usr/local/Cellar,g" $pc_file
done
# install zrythm from source
rm -rf /tmp/breeze-dark || true
cp -r icons/breeze-dark /tmp/
formula_dir=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
cp formulae/zrythm.rb $formula_dir/
brew install --build-from-source zrythm || true
brew link --overwrite zrythm || true
# recompile schemas
echo "Recompiling schemas..."
/usr/local/bin/glib-compile-schemas /usr/local/share/glib-2.0/schemas
if zrythm --version; then
print_install_success
else
echo "installation failed"
exit 1
fi
fi
exit 0
proceed=0
proceed_txt="Proceed with the installation of ZPlugins v$zplugins_ver?"
read -p "$proceed_txt (type Y or y): " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
proceed=1
fi
# install plugins
if [ $proceed -ne 0 ]; then
print_install_success
fi

17
osx-brew/make_pkg.sh.in

@ -1,4 +1,21 @@ @@ -1,4 +1,21 @@
#!@BASH@
#
# Copyright (C) 2020-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/>.
set -ex

41
osx-brew/make_zip.sh.in

@ -1,41 +0,0 @@ @@ -1,41 +0,0 @@
#!@BASH@
set -ex
out_file="$1"
zrythm_formula_file=$2
carla_bottle_file=$3
installer_sh_file=$4
readme_file=$5
private_dir=$6
dash_trial="@DASH_TRIAL@"
manuals_zip="@MANUALS_ZIP_FILE@"
breeze_dark="@BREEZE_DARK@"
inner_dir_name="${out_file%.*}"
inner_dir_name="`basename $inner_dir_name`"
inner_dir=$private_dir/$inner_dir_name
rm -rf $private_dir
mkdir -p $inner_dir/bin
mkdir -p $inner_dir/formulae
mkdir -p $inner_dir/icons
mkdir -p $inner_dir/src
cp $installer_sh_file $inner_dir/installer.sh
cp $readme_file $inner_dir/README
cp $carla_bottle_file $inner_dir/bin/carla-git.catalina.bottle.tar.gz
cp $zrythm_formula_file $inner_dir/formulae/
cp -r "$breeze_dark" $inner_dir/icons/
if [ "$dash_trial" != "-trial" ]; then
echo "adding user manuals" ;
unzip -o $manuals_zip -d $inner_dir/ ;
fi
pushd $private_dir
zip -r $inner_dir_name.zip $inner_dir_name
popd
cp $inner_dir.zip $out_file

11
osx-brew/meson.build

@ -66,23 +66,12 @@ make_bottle_sh = configure_file ( @@ -66,23 +66,12 @@ make_bottle_sh = configure_file (
input: 'make_bottle.sh.in',
configuration: osx_brew_conf,
)
make_zip_sh = configure_file (
output: 'make_zip.sh',
input: 'make_zip.sh.in',
configuration: osx_brew_conf,
)
make_pkg_sh = configure_file (
output: 'make_pkg.sh',
input: 'make_pkg.sh.in',
configuration: osx_brew_conf,
)
# configure installer script and README
installer_sh = configure_file (
output: 'installer.sh',
input: 'installer.sh.in',
configuration: osx_brew_conf,
)
readme = configure_file (
output: 'README',
input: 'README-osx.in',

4
osx-brew/postinstall.in

@ -36,9 +36,9 @@ echo "Move LV2 plugins" @@ -36,9 +36,9 @@ echo "Move LV2 plugins"
dest_lv2_dir="/Library/Audio/Plug-Ins/LV2"
dest_lv2_prefix="$dest_lv2_dir/Zrythm-$product_version"
mkdir -p $dest_lv2_dir
for plugin in `ls ${PRODUCT_HOME}/lib/zrythm/lib/lv2`; do
for plugin in `ls ${PRODUCT_HOME}/lib/lv2`; do
rm -rf $dest_lv2_prefix-$plugin
mv -vf ${PRODUCT_HOME}/lib/zrythm/lib/lv2/$plugin \
mv -vf ${PRODUCT_HOME}/lib/lv2/$plugin \
$dest_lv2_prefix-$plugin
done

5
osx-brew/zrythm.rb.in

@ -48,8 +48,9 @@ class Zrythm@TRIAL_INITIAL_UPPERCASE@ < Formula @@ -48,8 +48,9 @@ class Zrythm@TRIAL_INITIAL_UPPERCASE@ < Formula
system "ninja", "-v"
system "ninja", "install", "-v"
system "cp", "-r", "@BREEZE_DARK@", "#{share}/icons/breeze-dark"
system "mkdir", "-p", "#{lib}/zrythm/lib"
system "cp", "-RLv", "@BUILT_ZPLUGINS_DIR@/lib/lv2", "#{lib}/zrythm/lib/"
system "mkdir", "-p", "#{lib}/zrythm/carla"
system "mkdir", "-p", "#{lib}/lv2"
system "cp", "-RLv", "@BUILT_ZPLUGINS_DIR@/lib/lv2", "#{lib}/lv2/"
end
end

0
scripts/make_rpm_pkg.sh.in → rpm/make_rpm_pkg.sh.in

6
rpm/meson.build

@ -27,6 +27,12 @@ rpm_conf.set ( @@ -27,6 +27,12 @@ rpm_conf.set (
'CARLA_FULL_BINS_PATH',
carla_installation.full_path () + carla_prefix / 'lib/carla')
make_rpm_pkg = configure_file (
output: 'make_rpm_pkg.sh',
input: 'make_rpm_pkg.sh.in',
configuration: global_conf,
)
specfile = configure_file (
output: 'zrythm.spec',
input: 'zrythm.spec.in',

24
rpm/zrythm.spec.in

@ -109,20 +109,20 @@ ninja -C build @@ -109,20 +109,20 @@ ninja -C build
DESTDIR="%{buildroot}/" ninja -C build install
mkdir -p "%{buildroot}/usr/lib/zrythm/lib/lv2"
rm -rf "%{buildroot}/usr/lib64/libcm_reproc.a"
cp -RLv @CARLA_FULL_BINS_PATH@ \
%{buildroot}/usr/lib/zrythm/lib/
for file in carla-discovery-native carla-bridge-lv2-gtk2 carla-bridge-lv2-gtk3 carla-bridge-lv2-qt5 carla-bridge-lv2-x11 carla-bridge-native libcarla_host-pllugin.so; do
cp -Lv "@CARLA_FULL_BINS_PATH@/$file" \
%{buildroot}/usr/lib/zrythm/carla/
done
cp -RLv @BUILT_ZPLUGINS_DIR@/* \
%{buildroot}/usr/lib/zrythm/lib/lv2/
%{buildroot}/usr/lib/lv2/
for f in `ls %{buildroot}/usr/lib/lv2`; do
mv $f "%{buildroot}/usr/lib/lv2/Zrythm-$f"
done
%find_lang zrythm
%files -f zrythm.lang
%license COPYING
%doc README.md CONTRIBUTING.md INSTALL.md CHANGELOG.md
%{_bindir}/carla-discovery-native
%{_bindir}/carla-bridge-lv2-gtk2
%{_bindir}/carla-bridge-lv2-gtk3
%{_bindir}/carla-bridge-lv2-qt5
%{_bindir}/carla-bridge-native
%{_bindir}/zrythm
%{_bindir}/zrythm_launch
%{_bindir}/zrythm_gdb
@ -134,6 +134,14 @@ cp -RLv @BUILT_ZPLUGINS_DIR@/* \ @@ -134,6 +134,14 @@ cp -RLv @BUILT_ZPLUGINS_DIR@/* \
%{_datadir}/zrythm
%{_datadir}/man/man1/zrythm.*
%{_datadir}/mime/packages/org.zrythm.Zrythm-mime.xml
%{_prefix}/lib/lv2/Zrythm-*
%{_prefix}/lib/zrythm/carla/carla-discovery-native
%{_prefix}/lib/zrythm/carla/carla-bridge-lv2-gtk2
%{_prefix}/lib/zrythm/carla/carla-bridge-lv2-gtk3
%{_prefix}/lib/zrythm/carla/carla-bridge-lv2-qt5
%{_prefix}/lib/zrythm/carla/carla-bridge-lv2-x11
%{_prefix}/lib/zrythm/carla/carla-bridge-native
%{_prefix}/lib/zrythm/carla/libcarla_host-plugin.so
%{_sysconfdir}/bash_completion.d/zrythm
# _exec_prefix/lib64/**/*
%{_prefix}/lib/zrythm

19
scripts/make_carla.sh.in

@ -1,4 +1,21 @@ @@ -1,4 +1,21 @@
#!@BASH@
#
# Copyright (C) 2020-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/>.
set -ex
@ -23,7 +40,7 @@ unzip -o "$carla_source_zip" -d "$private_dir" @@ -23,7 +40,7 @@ unzip -o "$carla_source_zip" -d "$private_dir"
cd "$private_dir/Carla-$carla_git_ver"
make features
make -j4
make install DESTDIR="$out_dir" PREFIX="$prefix" LIBDIR=$prefix/lib
make install DESTDIR="$out_dir" PREFIX="$prefix" LIBDIR=$prefix
sudo mkdir -p "$prefix"
sudo cp -Rv "$out_dir/$prefix"/* "$prefix"/

6
scripts/meson.build

@ -17,12 +17,6 @@ @@ -17,12 +17,6 @@
# configure each script
make_rpm_pkg = configure_file (
output: 'make_rpm_pkg.sh',
input: 'make_rpm_pkg.sh.in',
configuration: global_conf,
)
make_arch_pkg = configure_file (
output: 'make_arch_pkg.sh',
input: 'make_arch_pkg.sh.in',

3
windows-msys/make_dist_dir.sh.in

@ -163,7 +163,8 @@ EOL @@ -163,7 +163,8 @@ EOL
zrythm_exe="$dist_bindir/zrythm.exe"
cp "$orig_zrythm_exe" "$zrythm_exe"
"$zrythm_exe" --version
cp $mingw_prefix/bin/carla*.exe "$dist_bindir/"
mkdir -p "$dist_libdir/zrythm/carla"
cp $mingw_prefix/bin/carla*.exe "$dist_libdir/zrythm/carla/"
if [ -f "$mingw_prefix/bin/gdbus.exe" ]; then
cp "$mingw_prefix/bin/gdbus.exe" "$dist_bindir/"
fi

Loading…
Cancel
Save