diff --git a/.gitignore b/.gitignore index 2350e9f2d77..40bac29edd4 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,5 @@ scripts/templates/ios/bin libs/openFrameworksCompiled/project/tvOS/tvOS+OFLib.xcodeproj/xcshareddata scripts/osx/regressionTest examples/**/**/[Cc]onfig.make +*.key +*.pem diff --git a/apps/projectGenerator b/apps/projectGenerator index 28d3e248a94..c3f56f8396d 160000 --- a/apps/projectGenerator +++ b/apps/projectGenerator @@ -1 +1 @@ -Subproject commit 28d3e248a94c8f7da91385b78abdb3c1f5238411 +Subproject commit c3f56f8396d279eef1f7d57bafccd385988fcf2e diff --git a/libs/openFrameworks/utils/ofURLFileLoader.cpp b/libs/openFrameworks/utils/ofURLFileLoader.cpp index 7aec68e4ef4..51f0dcdcd07 100644 --- a/libs/openFrameworks/utils/ofURLFileLoader.cpp +++ b/libs/openFrameworks/utils/ofURLFileLoader.cpp @@ -1,16 +1,29 @@ #include "ofAppRunner.h" #include "ofURLFileLoader.h" #include "ofUtils.h" +#include "ofFileUtils.h" +#include "ofLog.h" using std::map; using std::set; using std::string; #if !defined(TARGET_IMPLEMENTS_URL_LOADER) - #include - #include "ofThreadChannel.h" - #include "ofThread.h" +#include +#include "ofThreadChannel.h" +#include "ofThread.h" static bool curlInited = false; +#if !defined(NO_OPENSSL) +#include +#include +#include +#include +#include +#include +#include +#define CERTIFICATE_FILE "ssl/cacert.pem" +#define PRIVATE_KEY_FILE "ssl/cacert.key" +#endif #endif int ofHttpRequest::nextID = 0; @@ -32,6 +45,10 @@ class ofURLFileLoaderImpl : public ofThread, public ofBaseURLFileLoader { void remove(int id); void clear(); void stop(); +#if !defined(NO_OPENSSL) + bool checkValidCertifcate(const std::string& cert_file); + void createSSLCertificate(); +#endif ofHttpResponse handleRequest(const ofHttpRequest & request); int handleRequestAsync(const ofHttpRequest & request); // returns id @@ -110,6 +127,87 @@ void ofURLFileLoaderImpl::stop() { waitForThread(); } +#if !defined(NO_OPENSSL) +bool ofURLFileLoaderImpl::checkValidCertifcate(const std::string& cert_file) { + FILE *fp = fopen(cert_file.c_str(), "r"); + if (!fp) return false; + X509 *cert = PEM_read_X509(fp, NULL, NULL, NULL); + fclose(fp); + if (!cert) return false; + time_t current_time = time(NULL); + int notBefore = X509_cmp_time(X509_get0_notBefore(cert), ¤t_time); + int notAfter = X509_cmp_time(X509_get0_notAfter(cert), ¤t_time); + X509_free(cert); + return (notBefore <= 0 && notAfter >= 0); +} + +void ofURLFileLoaderImpl::createSSLCertificate() { + EVP_PKEY *pkey = nullptr; + X509 *x509 = nullptr; + EVP_PKEY_CTX *pkey_ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL); + if (!pkey_ctx) { + ofLogError("ofURLFileLoader") << "Error initializing key generation context"; + return; + } + if (EVP_PKEY_keygen_init(pkey_ctx) <= 0 || + EVP_PKEY_CTX_set_rsa_keygen_bits(pkey_ctx, 2048) <= 0 || + EVP_PKEY_keygen(pkey_ctx, &pkey) <= 0) { + ofLogError("ofURLFileLoader") << "Error generating RSA key"; + EVP_PKEY_CTX_free(pkey_ctx); + return; + } + EVP_PKEY_CTX_free(pkey_ctx); + x509 = X509_new(); + ASN1_INTEGER_set(X509_get_serialNumber(x509), 1); + X509_gmtime_adj(X509_get_notBefore(x509), 0); + X509_gmtime_adj(X509_get_notAfter(x509), 31536000L); // 1 year == 31536000L + X509_set_pubkey(x509, pkey); + X509_NAME *name = X509_get_subject_name(x509); + X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, (unsigned char *)"US", -1, -1, 0); + X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC, (unsigned char *)"Local Machine", -1, -1, 0); + X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)"Local Root CA", -1, -1, 0); + X509_set_issuer_name(x509, name); + if (X509_sign(x509, pkey, EVP_sha256()) == 0) { + ofLogError("ofURLFileLoader") << "Error signing the certificate"; + EVP_PKEY_free(pkey); + X509_free(x509); + return; + } + BIO *keyBio = BIO_new(BIO_s_mem()); + BIO *certBio = BIO_new(BIO_s_mem()); + PEM_write_bio_PrivateKey(keyBio, pkey, nullptr, nullptr, 0, nullptr, nullptr); + PEM_write_bio_X509(certBio, x509); + char *keyData = nullptr; + long keyLen = BIO_get_mem_data(keyBio, &keyData); + std::string keyStr(keyData, keyLen); + char *certData = nullptr; + long certLen = BIO_get_mem_data(certBio, &certData); + std::string certStr(certData, certLen); + ofBuffer keyBuffer; + ofBuffer certBuffer; + keyBuffer.set(keyStr.c_str(), keyLen); + certBuffer.set(certStr.c_str(), certLen); + + if(!ofDirectory::createDirectory( "ssl" )) { + ofLogWarning("ofURLFileLoader") << "ssl dir could not create"; + } + if(!ofBufferToFile(ofToDataPath(PRIVATE_KEY_FILE), keyBuffer)) { + ofLogError("ofURLFileLoader") << "createSSLCertificate. could not save keyBuffer"; + } + if(!ofBufferToFile(ofToDataPath(CERTIFICATE_FILE), certBuffer)) { + ofLogError("ofURLFileLoader") << "createSSLCertificate. could not save certBuffer"; + } + + BIO_free(keyBio); + BIO_free(certBio); + EVP_PKEY_free(pkey); + X509_free(x509); + + ofLogNotice("ofURLFileLoader") << "Root certificate and private key generated and saved"; +} +#endif + + void ofURLFileLoaderImpl::threadedFunction() { setThreadName("ofURLFileLoader " + ofToString(getThreadId())); while (isThreadRunning()) { @@ -172,7 +270,29 @@ size_t readBody_cb(void * ptr, size_t size, size_t nmemb, void * userdata) { ofHttpResponse ofURLFileLoaderImpl::handleRequest(const ofHttpRequest & request) { std::unique_ptr curl = std::unique_ptr(curl_easy_init(), curl_easy_cleanup); curl_slist * headers = nullptr; - curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, true); +#ifdef CURL_DEBUG + curl_version_info_data *version = curl_version_info( CURLVERSION_NOW ); + CURLcode ret = curl_easy_setopt(curl.get(), CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl.get(), CURLOPT_USERAGENT, "curl/8.9.1"); +#endif +#ifdef TARGET_OSX +#if !defined(NO_OPENSSL) + const std::string caPath = "ssl"; + const std::string caFile = "ssl/cacert.pem"; + if (ofFile::doesFileExist(ofToDataPath(CERTIFICATE_FILE)) && checkValidCertifcate(ofToDataPath(CERTIFICATE_FILE))) { + ofLogVerbose("ofURLFileLoader") << "SSL valid certificate found"; + } else { + ofLogVerbose("ofURLFileLoader") << "SSL certificate not found - generating"; + createSSLCertificate(); + } + curl_easy_setopt(curl.get(), CURLOPT_CAPATH, ofToDataPath(caPath, true).c_str()); + curl_easy_setopt(curl.get(), CURLOPT_CAINFO, ofToDataPath(caFile, true).c_str()); + curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, false); +#endif +#else + curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, 1L); +#endif + curl_easy_setopt(curl.get(), CURLOPT_MAXREDIRS, 50L); curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYHOST, 2); curl_easy_setopt(curl.get(), CURLOPT_URL, request.url.c_str()); diff --git a/libs/openFrameworksCompiled/project/macos/config.osx.default.mk b/libs/openFrameworksCompiled/project/macos/config.macos.default.mk similarity index 93% rename from libs/openFrameworksCompiled/project/macos/config.osx.default.mk rename to libs/openFrameworksCompiled/project/macos/config.macos.default.mk index 5063929e3c3..13997ecd630 100644 --- a/libs/openFrameworksCompiled/project/macos/config.osx.default.mk +++ b/libs/openFrameworksCompiled/project/macos/config.macos.default.mk @@ -77,20 +77,23 @@ ifndef MAC_OS_STD_LIB MAC_OS_STD_LIB = libc++ endif +ifndef MAC_OS_C_VER + MAC_OS_C_VER = -std=c17 +endif + ifndef MAC_OS_CPP_VER - MAC_OS_CPP_VER = -std=c++17 + MAC_OS_CPP_VER = -std=c++23 endif # Link against libstdc++ to silence tr1/memory errors on latest versions of osx PLATFORM_CFLAGS = -stdlib=$(MAC_OS_STD_LIB) # Warning Flags (http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html) -PLATFORM_CFLAGS += -Wall +PLATFORM_CFLAGS += -Wall -Werror=return-type # Code Generation Option Flags (http://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html) PLATFORM_CFLAGS += -fexceptions -PLATFORM_CFLAGS += -Werror=return-type ifeq ($(shell xcode-select -print-path 2> /dev/null; echo $$?),0) MAC_OS_XCODE_ROOT=$(shell xcode-select -print-path) @@ -98,7 +101,9 @@ ifeq ($(shell xcode-select -print-path 2> /dev/null; echo $$?),0) MAC_OS_SDK_PATH=$(MAC_OS_XCODE_ROOT)/Platforms/MacOSX.platform/Developer/SDKs ifndef MAC_OS_SDK - ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX14.4.sdk),$(MAC_OS_SDK_PATH)/MacOSX14.4.sdk) + ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX14.5.sdk),$(MAC_OS_SDK_PATH)/MacOSX14.5.sdk) + MAC_OS_SDK=14.5 + else ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX14.4.sdk),$(MAC_OS_SDK_PATH)/MacOSX14.4.sdk) MAC_OS_SDK=14.4 else ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX14.3.sdk),$(MAC_OS_SDK_PATH)/MacOSX14.3.sdk) MAC_OS_SDK=14.3 @@ -135,7 +140,7 @@ ifeq ($(shell xcode-select -print-path 2> /dev/null; echo $$?),0) else ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX11.0.sdk),$(MAC_OS_SDK_PATH)/MacOSX11.0.sdk) MAC_OS_SDK=11.0 else ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX10.15.sdk),$(MAC_OS_SDK_PATH)/MacOSX10.15.sdk) - MAC_OS_SDK=10.15 + MAC_OS_SDK=10.15 else ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX10.14.sdk),$(MAC_OS_SDK_PATH)/MacOSX10.14.sdk) MAC_OS_SDK=10.14 else ifeq ($(wildcard $(MAC_OS_SDK_PATH)/MacOSX10.13.sdk),$(MAC_OS_SDK_PATH)/MacOSX10.13.sdk) @@ -179,7 +184,9 @@ ifdef MAC_OS_SDK_ROOT endif PLATFORM_CFLAGS += -mmacosx-version-min=$(MAC_OS_MIN_VERSION) +PLATFORM_CFLAGS += $(MAC_OS_C_VER) +PLATFORM_CXXFLAGS += -mmacosx-version-min=$(MAC_OS_MIN_VERSION) PLATFORM_CXXFLAGS += -x objective-c++ PLATFORM_CXXFLAGS += $(MAC_OS_CPP_VER) @@ -201,9 +208,8 @@ endif ################################################################################ PLATFORM_LDFLAGS = -stdlib=$(MAC_OS_STD_LIB) - -PLATFORM_LDFLAGS += -lcurl - +#PLATFORM_LDFLAGS += -arch i386 +# PLATFORM_LDFLAGS += -lcurl PLATFORM_LDFLAGS += -mmacosx-version-min=$(MAC_OS_MIN_VERSION) -v ########################################################################################## @@ -334,19 +340,24 @@ PLATFORM_LIBRARY_SEARCH_PATHS = PLATFORM_FRAMEWORKS = PLATFORM_FRAMEWORKS += Accelerate PLATFORM_FRAMEWORKS += AGL +PLATFORM_FRAMEWORKS += AppKit PLATFORM_FRAMEWORKS += ApplicationServices +PLATFORM_FRAMEWORKS += AVFoundation PLATFORM_FRAMEWORKS += AudioToolbox +PLATFORM_FRAMEWORKS += Cocoa +PLATFORM_FRAMEWORKS += CoreVideo PLATFORM_FRAMEWORKS += CoreAudio +PLATFORM_FRAMEWORKS += CoreMedia PLATFORM_FRAMEWORKS += CoreFoundation PLATFORM_FRAMEWORKS += CoreServices -PLATFORM_FRAMEWORKS += OpenGL +PLATFORM_FRAMEWORKS += Metal +PLATFORM_FRAMEWORKS += Foundation PLATFORM_FRAMEWORKS += IOKit -PLATFORM_FRAMEWORKS += Cocoa -PLATFORM_FRAMEWORKS += CoreVideo -PLATFORM_FRAMEWORKS += AVFoundation -PLATFORM_FRAMEWORKS += CoreMedia +PLATFORM_FRAMEWORKS += OpenGL PLATFORM_FRAMEWORKS += QuartzCore PLATFORM_FRAMEWORKS += Security +PLATFORM_FRAMEWORKS += SystemConfiguration + ifeq ($(USE_GST),1) PLATFORM_FRAMEWORKS += GStreamer @@ -399,23 +410,23 @@ afterplatform: $(TARGET_NAME) @mkdir -p bin/$(BIN_NAME).app/Contents/Resources # Use the openFrameworks-Info.plist as the default. Feel free to edit it in your project folder to override and values. - @if [ ! -f openFrameworks-Info.plist ]; then cp $(OF_ROOT)/scripts/templates/macos/openFrameworks-Info.plist openFrameworks-Info.plist; fi + @if [ ! -f openFrameworks-Info.plist ]; then cp $(OF_ROOT)/scripts/templates/osx/openFrameworks-Info.plist openFrameworks-Info.plist; fi @cp openFrameworks-Info.plist bin/$(BIN_NAME).app/Contents/Info.plist; # App icons ifeq ($(RUN_TARGET), RunRelease) - @if [ -f of.icns ]; then cp of.icns bin/$(BIN_NAME).app/Contents/Resources/; else cp $(OF_LIBS_PATH)/openFrameworksCompiled/project/macos/of.icns bin/$(BIN_NAME).app/Contents/Resources/; fi - @sed -i '' 's/\$$(ICON_NAME)/of.icns/g' bin/$(BIN_NAME).app/Contents/Info.plist + @if [ -f of.icns ]; then cp of.icns bin/$(BIN_NAME).app/Contents/Resources/; else cp $(OF_LIBS_PATH)/openFrameworksCompiled/project/osx/of.icns bin/$(BIN_NAME).app/Contents/Resources/; fi + @sed -i '' 's/\$${ICON_NAME}/of.icns/g' bin/$(BIN_NAME).app/Contents/Info.plist else - @if [ -f of_debug.icns ]; then cp of_debug.icns bin/$(BIN_NAME).app/Contents/Resources/; else cp $(OF_LIBS_PATH)/openFrameworksCompiled/project/macos/of_debug.icns bin/$(BIN_NAME).app/Contents/Resources/; fi - @sed -i '' 's/\$$(ICON_NAME)/of_debug.icns/g' bin/$(BIN_NAME).app/Contents/Info.plist + @if [ -f of_debug.icns ]; then cp of_debug.icns bin/$(BIN_NAME).app/Contents/Resources/; else cp $(OF_LIBS_PATH)/openFrameworksCompiled/project/osx/of_debug.icns bin/$(BIN_NAME).app/Contents/Resources/; fi + @sed -i '' 's/\$${ICON_NAME}/of_debug.icns/g' bin/$(BIN_NAME).app/Contents/Info.plist endif - @sed -i '' 's/\$$(DEVELOPMENT_LANGUAGE)/English/g' bin/$(BIN_NAME).app/Contents/Info.plist - @sed -i '' 's/\$$(EXECUTABLE_NAME)/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist - @sed -i '' 's/\$$(TARGET_NAME)/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist - @sed -i '' 's/\$$(PRODUCT_BUNDLE_IDENTIFIER)/cc.openFrameworks.$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist - @sed -i '' 's/\$$(VERSION)/1.0/g' bin/$(BIN_NAME).app/Contents/Info.plist + @sed -i '' 's/\$${DEVELOPMENT_LANGUAGE}/English/g' bin/$(BIN_NAME).app/Contents/Info.plist + @sed -i '' 's/\$${EXECUTABLE_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist + @sed -i '' 's/\$${TARGET_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist + @sed -i '' 's/\$${PRODUCT_BUNDLE_IDENTIFIER}/cc.openFrameworks.$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist + @sed -i '' 's/\$${MARKETING_VERSION}/1.0/g' bin/$(BIN_NAME).app/Contents/Info.plist @echo TARGET=$(TARGET) @mv $(TARGET) bin/$(BIN_NAME).app/Contents/MacOS diff --git a/libs/openFrameworksCompiled/project/makefileCommon/config.shared.mk b/libs/openFrameworksCompiled/project/makefileCommon/config.shared.mk index 029aeb1ed51..d23188e2815 100644 --- a/libs/openFrameworksCompiled/project/makefileCommon/config.shared.mk +++ b/libs/openFrameworksCompiled/project/makefileCommon/config.shared.mk @@ -112,7 +112,7 @@ ifndef PLATFORM_LIB_SUBPATH PLATFORM_LIB_SUBPATH=android SHARED_LIB_EXTENSION=so else ifeq ($(PLATFORM_OS),Darwin) - PLATFORM_LIB_SUBPATH=osx + PLATFORM_LIB_SUBPATH=macos SHARED_LIB_EXTENSION=dylib else ifeq ($(PLATFORM_OS),emscripten) PLATFORM_LIB_SUBPATH=emscripten diff --git a/libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig b/libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig index 881fbdac924..c0c40623f88 100644 --- a/libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig +++ b/libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig @@ -26,10 +26,10 @@ HEADER_URIPARSER = "$(OF_PATH)/libs/uriparser/include" HEADER_PUGIXML = "$(OF_PATH)/libs/pugixml/include" //------- Libraries -LIB_OF = "$(OF_PATH)/libs/openFrameworksCompiled/lib/osx/openFrameworks.a" -LIB_OF_DEBUG = "$(OF_PATH)/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a" +LIB_OF = "$(OF_PATH)/libs/openFrameworksCompiled/lib/macos/openFrameworks.a" +LIB_OF_DEBUG = "$(OF_PATH)/libs/openFrameworksCompiled/lib/macos/openFrameworksDebug.a" -LIB_FMOD = "$(OF_PATH)/libs/fmod/lib/osx/libfmod.dylib" +LIB_FMOD = "$(OF_PATH)/libs/fmod/lib/macos/libfmod.dylib" //LIB_GLFW = "$(OF_PATH)/libs/glfw/lib/osx/glfw3.a" //LIB_FREEIMAGE = "$(OF_PATH)/libs/FreeImage/lib/osx/freeimage.a" @@ -44,7 +44,7 @@ LIB_FMOD = "$(OF_PATH)/libs/fmod/lib/osx/libfmod.dylib" //LIB_URIPARSER = "$(OF_PATH)/libs/uriparser/lib/osx/uriparser.a" //LIB_PUGIXML = "$(OF_PATH)/libs/pugixml/lib/osx/pugixml.a" -OF_CORE_LIBS = $(LIB_FMOD) +OF_CORE_LIBS = $(LIB_FMOD) //$(LIB_CURL) OF_CORE_HEADERS = $(HEADER_OF) $(HEADER_FREETYPE) $(HEADER_FREETYPE2) $(HEADER_FMOD) $(HEADER_GLEW) $(HEADER_FREEIMAGE) $(HEADER_TESS2) $(HEADER_CAIRO) $(HEADER_RTAUDIO) $(HEADER_GLFW) $(HEADER_UTF8) $(HEADER_JSON) $(HEADER_GLM) $(HEADER_CURL) ${HEADER_SSL} $(HEADER_URIPARSER) $(HEADER_PUGIXML) ${HEADER_BROTLI} diff --git a/libs/openFrameworksCompiled/project/osx/config.osx.default.mk b/libs/openFrameworksCompiled/project/osx/config.osx.default.mk index c10204c941c..13997ecd630 100644 --- a/libs/openFrameworksCompiled/project/osx/config.osx.default.mk +++ b/libs/openFrameworksCompiled/project/osx/config.osx.default.mk @@ -77,8 +77,12 @@ ifndef MAC_OS_STD_LIB MAC_OS_STD_LIB = libc++ endif +ifndef MAC_OS_C_VER + MAC_OS_C_VER = -std=c17 +endif + ifndef MAC_OS_CPP_VER - MAC_OS_CPP_VER = -std=c++17 + MAC_OS_CPP_VER = -std=c++23 endif # Link against libstdc++ to silence tr1/memory errors on latest versions of osx @@ -180,7 +184,9 @@ ifdef MAC_OS_SDK_ROOT endif PLATFORM_CFLAGS += -mmacosx-version-min=$(MAC_OS_MIN_VERSION) +PLATFORM_CFLAGS += $(MAC_OS_C_VER) +PLATFORM_CXXFLAGS += -mmacosx-version-min=$(MAC_OS_MIN_VERSION) PLATFORM_CXXFLAGS += -x objective-c++ PLATFORM_CXXFLAGS += $(MAC_OS_CPP_VER) @@ -203,7 +209,7 @@ endif PLATFORM_LDFLAGS = -stdlib=$(MAC_OS_STD_LIB) #PLATFORM_LDFLAGS += -arch i386 -PLATFORM_LDFLAGS += -lcurl +# PLATFORM_LDFLAGS += -lcurl PLATFORM_LDFLAGS += -mmacosx-version-min=$(MAC_OS_MIN_VERSION) -v ########################################################################################## diff --git a/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj b/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj index aeaf3e6e7c8..fcec43cadf3 100644 --- a/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj +++ b/libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj/project.pbxproj @@ -235,22 +235,22 @@ 9979E8201A1CCC44007E55D1 /* ofMainLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofMainLoop.cpp; sourceTree = ""; }; 9979E8211A1CCC44007E55D1 /* ofMainLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofMainLoop.h; sourceTree = ""; }; BBA81C421FFBE4DB0064EA94 /* ofBaseApp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofBaseApp.cpp; sourceTree = ""; }; - BF5BF83F2B737C0A0049DEF6 /* zlib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = zlib.xcframework; path = ../../../zlib/lib/osx/zlib.xcframework; sourceTree = ""; }; - BF5BF8412B737C700049DEF6 /* uriparser.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = uriparser.xcframework; path = ../../../uriparser/lib/osx/uriparser.xcframework; sourceTree = ""; }; - BF5BF8432B737C7C0049DEF6 /* tess2.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = tess2.xcframework; path = ../../../tess2/lib/osx/tess2.xcframework; sourceTree = ""; }; - BF5BF8452B737C870049DEF6 /* rtAudio.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = rtAudio.xcframework; path = ../../../rtAudio/lib/osx/rtAudio.xcframework; sourceTree = ""; }; - BF5BF8472B737D280049DEF6 /* pugixml.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = pugixml.xcframework; path = ../../../pugixml/lib/osx/pugixml.xcframework; sourceTree = ""; }; - BF5BF8492B737E260049DEF6 /* cairo.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = cairo.xcframework; path = ../../../cairo/lib/osx/cairo.xcframework; sourceTree = ""; }; - BF5BF84B2B737E320049DEF6 /* FreeImage.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = FreeImage.xcframework; path = ../../../FreeImage/lib/osx/FreeImage.xcframework; sourceTree = ""; }; - BF5BF84D2B737E3B0049DEF6 /* freetype.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = freetype.xcframework; path = ../../../freetype/lib/osx/freetype.xcframework; sourceTree = ""; }; - BF5BF84F2B737E440049DEF6 /* glew.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = glew.xcframework; path = ../../../glew/lib/osx/glew.xcframework; sourceTree = ""; }; - BF5BF8512B737E4E0049DEF6 /* glfw.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = glfw.xcframework; path = ../../../glfw/lib/osx/glfw.xcframework; sourceTree = ""; }; - BF5BF8532B737E880049DEF6 /* libpng.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libpng.xcframework; path = ../../../libpng/lib/osx/libpng.xcframework; sourceTree = ""; }; - BF5BF8552B737E930049DEF6 /* pixman.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = pixman.xcframework; path = ../../../pixman/lib/osx/pixman.xcframework; sourceTree = ""; }; - BF6276A12BAD6619008864C1 /* openssl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = openssl.xcframework; path = ../../../openssl/lib/osx/openssl.xcframework; sourceTree = ""; }; - BF6276A32BAD6639008864C1 /* curl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = curl.xcframework; path = ../../../curl/lib/osx/curl.xcframework; sourceTree = ""; }; + BF5BF83F2B737C0A0049DEF6 /* zlib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = zlib.xcframework; path = ../../../zlib/lib/macos/zlib.xcframework; sourceTree = ""; }; + BF5BF8412B737C700049DEF6 /* uriparser.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = uriparser.xcframework; path = ../../../uriparser/lib/macos/uriparser.xcframework; sourceTree = ""; }; + BF5BF8432B737C7C0049DEF6 /* tess2.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = tess2.xcframework; path = ../../../tess2/lib/macos/tess2.xcframework; sourceTree = ""; }; + BF5BF8452B737C870049DEF6 /* rtAudio.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = rtAudio.xcframework; path = ../../../rtAudio/lib/macos/rtAudio.xcframework; sourceTree = ""; }; + BF5BF8472B737D280049DEF6 /* pugixml.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = pugixml.xcframework; path = ../../../pugixml/lib/macos/pugixml.xcframework; sourceTree = ""; }; + BF5BF8492B737E260049DEF6 /* cairo.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = cairo.xcframework; path = ../../../cairo/lib/macos/cairo.xcframework; sourceTree = ""; }; + BF5BF84B2B737E320049DEF6 /* FreeImage.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = FreeImage.xcframework; path = ../../../FreeImage/lib/macos/FreeImage.xcframework; sourceTree = ""; }; + BF5BF84D2B737E3B0049DEF6 /* freetype.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = freetype.xcframework; path = ../../../freetype/lib/macos/freetype.xcframework; sourceTree = ""; }; + BF5BF84F2B737E440049DEF6 /* glew.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = glew.xcframework; path = ../../../glew/lib/macos/glew.xcframework; sourceTree = ""; }; + BF5BF8512B737E4E0049DEF6 /* glfw.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = glfw.xcframework; path = ../../../glfw/lib/macos/glfw.xcframework; sourceTree = ""; }; + BF5BF8532B737E880049DEF6 /* libpng.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libpng.xcframework; path = ../../../libpng/lib/macos/libpng.xcframework; sourceTree = ""; }; + BF5BF8552B737E930049DEF6 /* pixman.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = pixman.xcframework; path = ../../../pixman/lib/macos/pixman.xcframework; sourceTree = ""; }; + BF6276A12BAD6619008864C1 /* openssl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = openssl.xcframework; path = ../../../openssl/lib/macos/openssl.xcframework; sourceTree = ""; }; + BF6276A32BAD6639008864C1 /* curl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = curl.xcframework; path = ../../../curl/lib/macos/curl.xcframework; sourceTree = ""; }; BF6276A52BAD9900008864C1 /* ofBaseTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofBaseTypes.h; sourceTree = ""; }; - BF7C462D2C097CCE00461163 /* brotli.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = brotli.xcframework; path = ../../../brotli/lib/osx/brotli.xcframework; sourceTree = ""; }; + BF7C462D2C097CCE00461163 /* brotli.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = brotli.xcframework; path = ../../../brotli/lib/macos/brotli.xcframework; sourceTree = ""; }; DA48FE74131D85A6000062BC /* ofPolyline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofPolyline.h; sourceTree = ""; }; DA94C2ED1301D32200CCC773 /* ofRendererCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofRendererCollection.h; sourceTree = ""; }; DA97FD3612F5A61A005C9991 /* ofCairoRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofCairoRenderer.cpp; sourceTree = ""; }; @@ -871,7 +871,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = "/usr/bin/env bash"; - shellScript = "#!/usr/bin/env bash\nif [ ! -d \"${SRCROOT}/../../../freetype/lib/osx/freetype.xcframework\" ]; then\n\techo \"openFrameworks has missing xcFrameworks for osx. Downloading libaries now via scripts/osx/download_latest_libs.sh\"\n ${SRCROOT}/../../../../scripts/osx/download_latest_libs.sh\nelse\n\techo \"xcFrameworks found\"\nfi\n"; + shellScript = "#!/usr/bin/env bash\nif [ ! -d \"${SRCROOT}/../../../freetype/lib/macos/freetype.xcframework\" ]; then\n\techo \"openFrameworks has missing xcFrameworks for osx. Downloading libaries now via scripts/osx/download_latest_libs.sh\"\n ${SRCROOT}/../../../../scripts/osx/download_latest_libs.sh\nelse\n\techo \"xcFrameworks found\"\nfi\n"; }; BFF80A5D2C50B2C300784E74 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -889,7 +889,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#!/bin/sh\nTARGET_DIR=\"$SRCROOT/../../lib/osx\"\nATTRIBUTE_CHECK=$(xattr -p com.apple.xcode.CreatedByBuildSystem \"$TARGET_DIR\" 2>/dev/null)\nif [ -z \"$ATTRIBUTE_CHECK\" ]; then\n xattr -w com.apple.xcode.CreatedByBuildSystem true \"$TARGET_DIR\"\n echo \"Attribute com.apple.xcode.CreatedByBuildSystem set to true for $TARGET_DIR\"\nelse\n echo \"Attribute com.apple.xcode.CreatedByBuildSystem already set for $TARGET_DIR\"\nfi\n"; + shellScript = "#!/bin/sh\nTARGET_DIR=\"$SRCROOT/../../lib/macos\"\nATTRIBUTE_CHECK=$(xattr -p com.apple.xcode.CreatedByBuildSystem \"$TARGET_DIR\" 2>/dev/null)\nif [ -z \"$ATTRIBUTE_CHECK\" ]; then\n xattr -w com.apple.xcode.CreatedByBuildSystem true \"$TARGET_DIR\"\n echo \"Attribute com.apple.xcode.CreatedByBuildSystem set to true for $TARGET_DIR\"\nelse\n echo \"Attribute com.apple.xcode.CreatedByBuildSystem already set for $TARGET_DIR\"\nfi\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -980,7 +980,7 @@ E4B27C1610CBEB8E00536013 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/osx/"; + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/macos/"; EXECUTABLE_PREFIX = ""; INSTALL_PATH = /usr/local/lib; LIBRARY_SEARCH_PATHS = ( @@ -995,7 +995,7 @@ "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", ); - OBJROOT = "$(SRCROOT)/../../lib/osx/build/debug/"; + OBJROOT = "$(SRCROOT)/../../lib/macos/build/debug/"; PRODUCT_NAME = openFrameworksDebug; SDKROOT = ""; }; @@ -1004,7 +1004,7 @@ E4B27C1710CBEB8E00536013 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/osx/"; + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/macos/"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; EXECUTABLE_PREFIX = ""; INSTALL_PATH = /usr/local/lib; @@ -1020,7 +1020,7 @@ "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", ); - OBJROOT = "$(SRCROOT)/../../lib/osx/build/release/"; + OBJROOT = "$(SRCROOT)/../../lib/macos/build/release/"; PRODUCT_NAME = openFrameworks; SDKROOT = ""; }; @@ -1030,9 +1030,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = E432815F138AC0470047C5CB /* Debug.xcconfig */; buildSettings = { - CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/osx/"; - CONFIGURATION_TEMP_DIR = "$(SRCROOT)/../../lib/osx/build/debug/"; - OBJROOT = "$(SRCROOT)/../../lib/osx/build/debug/"; + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/macos/"; + CONFIGURATION_TEMP_DIR = "$(SRCROOT)/../../lib/macos/build/debug/"; + OBJROOT = "$(SRCROOT)/../../lib/macos/build/debug/"; ONLY_ACTIVE_ARCH = NO; SDKROOT = ""; }; @@ -1042,9 +1042,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = E4328160138AC04A0047C5CB /* Release.xcconfig */; buildSettings = { - CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/osx/"; - CONFIGURATION_TEMP_DIR = "$(SRCROOT)/../../lib/osx/build/release/"; - OBJROOT = "$(SRCROOT)/../../lib/osx/build/release"; + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/../../lib/macos/"; + CONFIGURATION_TEMP_DIR = "$(SRCROOT)/../../lib/macos/build/release/"; + OBJROOT = "$(SRCROOT)/../../lib/macos/build/release"; ONLY_ACTIVE_ARCH = NO; SDKROOT = ""; }; diff --git a/scripts/apothecary b/scripts/apothecary index 7d5a6d85683..2d2f7ad685a 160000 --- a/scripts/apothecary +++ b/scripts/apothecary @@ -1 +1 @@ -Subproject commit 7d5a6d856838d02224464d57ef19bd17609d4e50 +Subproject commit 2d2f7ad685abb329363a82955779f26c4cd1d39b diff --git a/scripts/osx/xcode_project.sh b/scripts/osx/xcode_project.sh index 9afd677acfd..d365d500e1b 100755 --- a/scripts/osx/xcode_project.sh +++ b/scripts/osx/xcode_project.sh @@ -25,8 +25,8 @@ copy_resources() { # Copy libfmod and change install directory for fmod to run if [ -z "$OF_NO_FMOD" ] ; then msg "Copying Resources - Fmod" - echo rsync -aved --delete --ignore-existing "$OF_PATH/libs/fmod/lib/osx/libfmod.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"; - rsync -aved --delete --ignore-existing "$OF_PATH/libs/fmod/lib/osx/libfmod.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"; + echo rsync -aved --delete --ignore-existing "$OF_PATH/libs/fmod/lib/macos/libfmod.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"; + rsync -aved --delete --ignore-existing "$OF_PATH/libs/fmod/lib/macos/libfmod.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"; fi # Not needed as we now call install_name_tool -id @loader_path/../Frameworks/libfmod.dylib libfmod.dylib on the dylib directly which prevents the need for calling every post build - keeping here for reference and possible legacy usage # install_name_tool -change @rpath/libfmod.dylib @executable_path/../Frameworks/libfmod.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME";