Compare commits

...

2 Commits

  1. 44
      tools/osx/cp_and_fix_dependency_paths.sh
  2. 12
      tools/osx/zrythm.rb

44
tools/osx/cp_and_fix_dependency_paths.sh

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
#!/bin/bash
exe="$1"
prefix_before="$2"
prefix_after="$3"
mode="$4"
recurse="$5"
#set -x
if [[ "$mode" == "fix-in-dir" ]]; then
dir_name="$prefix_after"
for file in `ls "$dir_name"`; do
bash $0 "$dir_name/$file" $2 $3 "fix" "false"
done
else
echo "processing executable $exe..."
changes=""
libs=`otool -L "$exe" | sed '1d' | egrep "($prefix_before|$prefix_after)" | awk '{print $1}'`
if [[ "$mode" == "copy" ]] && [[ "$exe" == *".dylib" ]]; then
libs="$(echo "$libs" | grep -v $(basename $exe))"
fi
echo "libs: $libs"
for lib in $libs; do
base=`basename $lib`
mkdir -p "$prefix_after"
if [[ "$mode" == "copy" ]]; then
echo "copying $base from $(dirname $lib) to $prefix_after"
cp "$lib" "$prefix_after"/
chmod +rw "$prefix_after"/"$base"
fi
changes="$changes -change $lib $prefix_after/$base"
if [[ "$recurse" == "true" ]]; then
bash $0 "$prefix_after/$base" $2 $3 $4 $5
fi
done
if [[ "$mode" == "fix" ]] && test "x$changes" != "x" ; then
echo "install_name_tool $changes $exe"
install_name_tool $changes $exe
fi
fi
echo "done"

12
tools/osx/zrythm.rb

@ -1,4 +1,8 @@ @@ -1,4 +1,8 @@
class Zrythm < Formula
resource("fix_paths_script") do
url "https://git.zrythm.org/cgit/zrythm-installer/plain/tools/osx/cp_and_fix_dependency_paths.sh"
sha256 "385d934730e48516261f7f8fd927cc7a232b5c86ab63e3a4e40dda8e0bff7d57"
end
desc "Digital audio workstation"
homepage "https://www.zrythm.org"
url "https://git.zrythm.org/cgit/zrythm/snapshot/@TARBALL_FILENAME@"
@ -38,6 +42,14 @@ class Zrythm < Formula @@ -38,6 +42,14 @@ class Zrythm < Formula
system "ninja", "-v"
system "ninja", "install", "-v"
system "cp", "-r", "/tmp/breeze-dark", "#{share}/icons/breeze-dark"
# copy all libs
resource("fix_paths_script").stage do
system "mkdir", "-p", "#{lib}/zrythm"
system "ls", "-la"
system "bash", "cp_and_fix_dependency_paths.sh", "#{bin}/zrythm", "/usr/local/opt", "#{lib}/zrythm", "copy", "true"
system "bash", "cp_and_fix_dependency_paths.sh", "#{bin}/zrythm", "/usr/local/opt", "#{lib}/zrythm", "fix-in-dir", "false"
system "bash", "cp_and_fix_dependency_paths.sh", "#{bin}/zrythm", "/usr/local/opt", "#{lib}/zrythm", "fix", "false"
end
end
end

Loading…
Cancel
Save