Browse Source

Move libRack.dylib to Resources folder in Mac bundle. Use rpath for plugin build.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
f627d1e729
5 changed files with 12 additions and 14 deletions
  1. +1
    -2
      .gitignore
  2. +7
    -7
      Makefile
  3. +2
    -1
      plugin.mk
  4. +1
    -1
      src/app/MenuBar.cpp
  5. +1
    -3
      src/plugin.cpp

+ 1
- 2
.gitignore View File

@@ -13,8 +13,7 @@
/presets /presets
/licenses /licenses
.DS_Store .DS_Store
/autosave.vcv
/autosave /autosave
/settings.json /settings.json
/screenshots /screenshots
/Fundamental.zip
/Fundamental.vcvplugin

+ 7
- 7
Makefile View File

@@ -163,19 +163,19 @@ endif
ifdef ARCH_MAC ifdef ARCH_MAC
mkdir -p dist/Rack.app mkdir -p dist/Rack.app
mkdir -p dist/Rack.app/Contents mkdir -p dist/Rack.app/Contents
cp Info.plist dist/Rack.app/Contents/
$(SED) 's/{VERSION}/$(VERSION)/g' dist/Rack.app/Contents/Info.plist
mkdir -p dist/Rack.app/Contents/Resources
mkdir -p dist/Rack.app/Contents/MacOS mkdir -p dist/Rack.app/Contents/MacOS
cp $(TARGET) dist/Rack.app/Contents/MacOS/
cp $(TARGET) dist/Rack.app/Contents/Resources/
cp $(STANDALONE_TARGET) dist/Rack.app/Contents/MacOS/ cp $(STANDALONE_TARGET) dist/Rack.app/Contents/MacOS/
$(STRIP) -S dist/Rack.app/Contents/MacOS/$(TARGET)
$(STRIP) -S dist/Rack.app/Contents/Resources/$(TARGET)
$(STRIP) -S dist/Rack.app/Contents/MacOS/$(STANDALONE_TARGET) $(STRIP) -S dist/Rack.app/Contents/MacOS/$(STANDALONE_TARGET)
install_name_tool -change $(TARGET) @executable_path/$(TARGET) dist/Rack.app/Contents/MacOS/$(STANDALONE_TARGET)
install_name_tool -change $(TARGET) @executable_path/../Resources/$(TARGET) dist/Rack.app/Contents/MacOS/$(STANDALONE_TARGET)
# Manually check that no nonstandard shared libraries are linked # Manually check that no nonstandard shared libraries are linked
otool -L dist/Rack.app/Contents/MacOS/$(TARGET)
otool -L dist/Rack.app/Contents/Resources/$(TARGET)
otool -L dist/Rack.app/Contents/MacOS/$(STANDALONE_TARGET) otool -L dist/Rack.app/Contents/MacOS/$(STANDALONE_TARGET)
# Copy resources # Copy resources
mkdir -p dist/Rack.app/Contents/Resources
cp Info.plist dist/Rack.app/Contents/
$(SED) 's/{VERSION}/$(VERSION)/g' dist/Rack.app/Contents/Info.plist
cp -R $(DIST_RES) dist/Rack.app/Contents/Resources/ cp -R $(DIST_RES) dist/Rack.app/Contents/Resources/
cp -R icon.icns dist/Rack.app/Contents/Resources/ cp -R icon.icns dist/Rack.app/Contents/Resources/
cp Fundamental.vcvplugin dist/Rack.app/Contents/Resources/ cp Fundamental.vcvplugin dist/Rack.app/Contents/Resources/


+ 2
- 1
plugin.mk View File

@@ -64,7 +64,8 @@ dist: all
cp $(TARGET) dist/$(SLUG)/ cp $(TARGET) dist/$(SLUG)/
ifdef ARCH_MAC ifdef ARCH_MAC
$(STRIP) -S dist/$(SLUG)/$(TARGET) $(STRIP) -S dist/$(SLUG)/$(TARGET)
install_name_tool -change libRack.dylib @executable_path/libRack.dylib dist/$(SLUG)/$(TARGET)
install_name_tool -change libRack.dylib @rpath/libRack.dylib dist/$(SLUG)/$(TARGET)
install_name_tool -add_rpath . dist/$(SLUG)/$(TARGET)
otool -L dist/$(SLUG)/$(TARGET) otool -L dist/$(SLUG)/$(TARGET)
else else
$(STRIP) -s dist/$(SLUG)/$(TARGET) $(STRIP) -s dist/$(SLUG)/$(TARGET)


+ 1
- 1
src/app/MenuBar.cpp View File

@@ -1012,7 +1012,7 @@ struct MenuBar : widget::OpaqueWidget {
layout->addChild(helpButton); layout->addChild(helpButton);


MenuButton* alphaButton = new MenuButton; MenuButton* alphaButton = new MenuButton;
alphaButton->text = "Pre-alpha built for Christoph Scholtes. Not for release.";
alphaButton->text = "Pre-alpha build. Not for release.";
layout->addChild(alphaButton); layout->addChild(alphaButton);
} }




+ 1
- 3
src/plugin.cpp View File

@@ -54,9 +54,7 @@ static void* loadLibrary(std::string libraryPath) {
#else #else
// As of Rack v2.0, plugins are linked with `-rpath=.` so change current directory so it can find libRack. // As of Rack v2.0, plugins are linked with `-rpath=.` so change current directory so it can find libRack.
std::string cwd = system::getWorkingDirectory(); std::string cwd = system::getWorkingDirectory();
std::string libDir = asset::systemDir;
DEBUG("Setting working directory to %s", libDir.c_str());
system::setWorkingDirectory(libDir);
system::setWorkingDirectory(asset::systemDir);
// Change it back when we're finished // Change it back when we're finished
DEFER({system::setWorkingDirectory(cwd);}); DEFER({system::setWorkingDirectory(cwd);});
// Load library with dlopen // Load library with dlopen


Loading…
Cancel
Save