14 changed files with 83 additions and 216 deletions
@ -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 |
@ -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 |
Loading…
Reference in new issue