From fe713d5a7a53bca8f7059a2c5e7508800d04b5a3 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 11 May 2019 01:16:34 -0400 Subject: [PATCH] Add codesigning on Mac. Silently fail if settings.json is not found when loaded. --- Makefile | 13 +++++++++---- plugin.mk | 2 +- src/settings.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 89623ffc..b991f189 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ ifdef ARCH_LIN ldd dist/Rack/$(TARGET) cp plugins/Fundamental/dist/*.zip dist/Rack/Fundamental.zip # Make ZIP - cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack + cd dist && zip -q -5 -r Rack-$(VERSION)-$(ARCH).zip Rack endif ifdef ARCH_MAC mkdir -p dist/$(TARGET).app @@ -123,8 +123,13 @@ ifdef ARCH_MAC otool -L dist/$(TARGET).app/Contents/MacOS/$(TARGET) cp plugins/Fundamental/dist/*.zip dist/$(TARGET).app/Contents/Resources/Fundamental.zip + # Clean up and sign bundle + xattr -cr dist/$(TARGET).app + codesign --sign "VCV" --verbose dist/$(TARGET).app + codesign --verify --verbose dist/$(TARGET).app + spctl --assess --verbose dist/$(TARGET).app # Make ZIP - cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip $(TARGET).app + cd dist && zip -q -5 -r Rack-$(VERSION)-$(ARCH).zip $(TARGET).app endif ifdef ARCH_WIN mkdir -p dist/Rack @@ -136,7 +141,7 @@ ifdef ARCH_WIN cp /mingw64/bin/libgcc_s_seh-1.dll dist/Rack/ cp plugins/Fundamental/dist/*.zip dist/Rack/Fundamental.zip # Make ZIP - cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack + cd dist && zip -q -5 -r Rack-$(VERSION)-$(ARCH).zip Rack # Make NSIS installer # pacman -S mingw-w64-x86_64-nsis makensis -DVERSION=$(VERSION) installer.nsi @@ -153,7 +158,7 @@ endif ifdef ARCH_WIN cp libRack.a dist/Rack-SDK/ endif - cd dist && zip -5 -r Rack-SDK-$(VERSION).zip Rack-SDK + cd dist && zip -q -5 -r Rack-SDK-$(VERSION).zip Rack-SDK # Obviously this will only work if you have the private keys to my server diff --git a/plugin.mk b/plugin.mk index 6d58c5e5..f0a92dda 100644 --- a/plugin.mk +++ b/plugin.mk @@ -62,7 +62,7 @@ endif @# Copy distributables cp -R $(DISTRIBUTABLES) dist/$(SLUG)/ @# Create ZIP package - cd dist && zip -5 -r $(SLUG)-$(VERSION)-$(ARCH).zip $(SLUG) + cd dist && zip -q -5 -r $(SLUG)-$(VERSION)-$(ARCH).zip $(SLUG) install: dist cp dist/$(SLUG)-$(VERSION)-$(ARCH).zip $(RACK_USER_DIR)/plugins/ diff --git a/src/settings.cpp b/src/settings.cpp index a722a284..dc4afd2b 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -248,7 +248,7 @@ void load(const std::string &path) { INFO("Loading settings %s", path.c_str()); FILE *file = fopen(path.c_str(), "r"); if (!file) - throw UserException(string::f("Could not load settings file %s", path.c_str())); + return; DEFER({ fclose(file); });