Browse Source

Fix Mac `make dist`

tags/v0.3.0
Andrew Belt 7 years ago
parent
commit
e59373405c
3 changed files with 16 additions and 4 deletions
  1. +6
    -1
      Makefile
  2. +1
    -1
      dep/Makefile
  3. +9
    -2
      src/main.cpp

+ 6
- 1
Makefile View File

@@ -54,7 +54,7 @@ ifeq ($(ARCH), win)
endif

clean:
rm -rf $(TARGET) build dist
rm -rfv $(TARGET) build dist

# For Windows resources
%.res: %.rc
@@ -127,4 +127,9 @@ endif
$(MAKE) -C plugins/Fundamental dist
cp -R plugins/Fundamental/dist/Fundamental dist/Rack/plugins/

ifeq ($(ARCH), mac)
cd dist && ln -s /Applications Applications
cd dist && hdiutil create -srcfolder . -volname Rack -ov -format UDZO Rack.dmg
else
cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack
endif

+ 1
- 1
dep/Makefile View File

@@ -49,7 +49,7 @@ $(glfw):
$(UNZIP) $@.zip
cd $@ && $(CMAKE) . \
-DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \
-DGLFW_USE_CHDIR=ON -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON
-DGLFW_USE_CHDIR=OFF -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON
$(MAKE) -C $@
$(MAKE) -C $@ install
ifeq ($(ARCH),win)


+ 9
- 2
src/main.cpp View File

@@ -53,26 +53,33 @@ void fixCwd() {
if (isCorrectCwd())
return;

/*
// Get path of binary inside the app bundle
// It should be something like */Rack.app/Contents/MacOS
// It should be something like .../Rack.app/Contents/MacOS
char path[PATH_MAX];
uint32_t pathLen = sizeof(path);
int err = _NSGetExecutablePath(path, &pathLen);
assert(!err);
if (isCorrectCwd())
return;

// Switch to the directory of the actual binary
chdir(dirname(path));
if (isCorrectCwd())
return;

// and then go up three directories to get to the parent directory
chdir("../../../");
if (isCorrectCwd())
return;
*/

// Switch to a default absolute path
chdir("/Applications/Rack");
if (isCorrectCwd())
return;

alert("Install Rack", "To install Rack, please move the Rack directory to your /Applications folder.", 2);
alert("Install Rack", "To install Rack, please move the Rack directory (including the Rack app and plugins directory) to the /Applications folder.", 2);
exit(1);
}
#endif


Loading…
Cancel
Save