Skip to content

Instantly share code, notes, and snippets.

@metacollin
Last active March 25, 2018 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metacollin/61502c0c97843e7c63f2f92beb5b62b1 to your computer and use it in GitHub Desktop.
Save metacollin/61502c0c97843e7c63f2f92beb5b62b1 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd kicad.app/Contents/Frameworks
for file in *.dylib; do fixup_libs=($(otool -L $file | grep -o "@executable_path.*.dylib")); libs=($(echo ${fixup_libs[@]} | grep -o "[^/]*dylib")); for ((i=0;i<${#fixup_libs[@]};++i)); do install_name_tool -change "${fixup_libs[i]}" "@rpath/${libs[i]}" $file; done; done;
for file in *.dylib; do install_name_tool -add_rpath @loader_path/../.. -add_rpath @executable_path/../Frameworks $file; done
cd python/site-packages
fixup_libs=($(otool -L _pcbnew.so | grep -o "@loader_path.*.dylib")); libs=($(echo ${fixup_libs[@]} | grep -o "[^/]*dylib")); for ((i=0;i<${#fixup_libs[@]};++i)); do install_name_tool -change "${fixup_libs[i]}" "@loader_path/../../${libs[i]}" _pcbnew.so; done;
install_name_tool -add_rpath @loader_path/../.. -add_rpath @executable_path/../Frameworks _pcbnew.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment