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 endif


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


# For Windows resources # For Windows resources
%.res: %.rc %.res: %.rc
@@ -127,4 +127,9 @@ endif
$(MAKE) -C plugins/Fundamental dist $(MAKE) -C plugins/Fundamental dist
cp -R plugins/Fundamental/dist/Fundamental dist/Rack/plugins/ 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 cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack
endif

+ 1
- 1
dep/Makefile View File

@@ -49,7 +49,7 @@ $(glfw):
$(UNZIP) $@.zip $(UNZIP) $@.zip
cd $@ && $(CMAKE) . \ cd $@ && $(CMAKE) . \
-DCMAKE_INSTALL_PREFIX="$(LOCAL)" -DBUILD_SHARED_LIBS=ON \ -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 $@
$(MAKE) -C $@ install $(MAKE) -C $@ install
ifeq ($(ARCH),win) ifeq ($(ARCH),win)


+ 9
- 2
src/main.cpp View File

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


/*
// Get path of binary inside the app bundle // 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]; char path[PATH_MAX];
uint32_t pathLen = sizeof(path); uint32_t pathLen = sizeof(path);
int err = _NSGetExecutablePath(path, &pathLen); int err = _NSGetExecutablePath(path, &pathLen);
assert(!err); assert(!err);
if (isCorrectCwd())
return;


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

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


// Switch to a default absolute path // Switch to a default absolute path
chdir("/Applications/Rack"); chdir("/Applications/Rack");
if (isCorrectCwd()) if (isCorrectCwd())
return; 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); exit(1);
} }
#endif #endif


Loading…
Cancel
Save