Browse Source

osx: install zrythm from source

before_cleanup
Alexandros Theodotou 3 years ago
parent
commit
0188a909e4
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 36
      installer-osx.sh.in
  2. 4
      tools/gen_osx_installer_brew.sh
  3. 2
      tools/osx/zrythm.rb

36
installer-osx.sh.in

@ -61,43 +61,53 @@ if [ $proceed -ne 0 ]; then @@ -61,43 +61,53 @@ if [ $proceed -ne 0 ]; then
brew unlink carla-git || true
brew unlink zrythm || true
brew unlink zrythm-trial || true
tar xf bin/zrythm*.catalina.bottle.tar.gz -C /usr/local/Cellar
# link
echo "Linking..."
brew switch carla-git $carla_ver || true
brew switch zrythm@TRIAL@ $zrythm_ver || true
brew unlink carla-git && \
brew link --overwrite carla-git && \
brew switch carla-git $carla_ver
brew unlink zrythm@TRIAL@ && \
brew link --overwrite zrythm@TRIAL@ && \
brew switch zrythm@TRIAL@ $zrythm_ver
# install deps
echo "Installing deps..."
zrythm_deps="$(brew info zrythm@TRIAL@ | grep Required | sed -e "s/Required: //" | sed -e "s/, / /g" | sed -e "s/carla-git//")"
carla_deps="$(brew info carla-git | grep Required | sed -e "s/Required: //" | sed -e "s/, / /g")"
brew upgrade
brew install $carla_deps || true
brew install $zrythm_deps || true
# fix paths
echo "Fixing paths..."
exe_path="$(dirname /usr/local/bin/zrythm)/$(readlink /usr/local/bin/zrythm)"
chmod +w $exe_path
for exe in $exe_path; do
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 | egrep "@@HOMEBREW_PREFIX@@" | awk '{print $1}'` ; do
replaced=`echo "$lib" | sed -e "s,@@HOMEBREW_PREFIX@@,/usr/local,g"`
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
chmod -w $exe_path
# install zrythm from source
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
brew link --overwrite zrythm || true
# recompile schemas
echo "Recompiling schemas..."

4
tools/gen_osx_installer_brew.sh

@ -12,7 +12,7 @@ if [ "$bottle_or_zip" = "bottle" ]; then @@ -12,7 +12,7 @@ if [ "$bottle_or_zip" = "bottle" ]; then
bottle_filename="$(basename $bottle_file)"
formula_file=$3
tarball=$4
tarball_filename="$(basename $tarball)"
tarball_filename="$(git ls-remote https://git.zrythm.org/git/zrythm | grep HEAD | awk '{print $1}').tar.gz"
zrythm_version=$5
carla_version=$6
@ -87,7 +87,7 @@ elif [ "$bottle_or_zip" = "zip" ]; then @@ -87,7 +87,7 @@ elif [ "$bottle_or_zip" = "zip" ]; then
mkdir -p $tmp/formulae
mkdir -p $tmp/icons
mkdir -p $tmp/src
cp $bottle_file $tmp/bin/zrythm-$zrythm_version.catalina.bottle.tar.gz
#cp $bottle_file $tmp/bin/zrythm-$zrythm_version.catalina.bottle.tar.gz
cp $carla_bottle_file $tmp/bin/carla-git.catalina.bottle.tar.gz
cp $formula_dir/zrythm*.rb $tmp/formulae/
cp -r /tmp/breeze-dark $tmp/icons/

2
tools/osx/zrythm.rb

@ -34,6 +34,8 @@ class Zrythm < Formula @@ -34,6 +34,8 @@ class Zrythm < Formula
"-Dcarla=enabled", "-Dffmpeg=enabled",
"-Drtmidi=auto", "-Drtaudio=auto",
"-Dfallback_version=@VERSION@",
# manpage fails
"-Dmanpage=false",
".."
system "ninja", "-v"
system "ninja", "install", "-v"

Loading…
Cancel
Save