diff --git a/macos_packager/README.md b/macos_packager/README.md new file mode 100644 index 0000000..2c742db --- /dev/null +++ b/macos_packager/README.md @@ -0,0 +1,23 @@ +# OSSP macOS Packaging Utilities + +## What is ```launcher``` +Launcher is simply a tool that launches OSSP with the correct environment variables when inside a macOS bundle.
+OSSP packages it's own runtime dependency tree with itself as to avoid dependency issues for the +end user. To achieve this though, some hacks have to be made. +OSSP needs some environment arguments to launch, such as ```DYLD_LIBRARY_PATH``` and ```LV2_PATH``` +to use the correct sysroot, and for the equalizer functionality respectively.
+Normally, macOS sanitizes ```DYLD_*``` environment variables when launching a new program, so +```launcher``` was made to create an entirely new environment pointer for execve() to use. + +## Notice +NOTE: This does NOT bypass and/or exploit any security features of macOS / Darwin. This is an intentional +feature, as when running 'protected' binaries (such as the ones found in ```/usr/bin```), +macOS goes even further to sanitize the ```DYLD_*``` environment variables even when utilizing this method.
+In saying that, there is ABSOLUTELY NO WAY this would EVER pass App Store verification. + +## How to use this? +Firstly, build the launcher.
+Then, build OSSP.
+Then, copy the actual OSSP binary into the newly created bundle (Bundle/Contents/MacOS/).
+Then, copy the sysroot from /opt/ossp into the bundle (Bundle/Contents/Sysroot).
+Finally, make the .icns file for the app icon, and copy it into the bundle (Bundle/Contents/Resources). diff --git a/macos_packager/launcher/main.cpp b/macos_packager/launcher/main.cpp index 93ce6a6..8fec9ee 100644 --- a/macos_packager/launcher/main.cpp +++ b/macos_packager/launcher/main.cpp @@ -39,15 +39,15 @@ int main(int argc, char** argv) { removePath(bundle_path); printf("[OSSPL] Bundle Path: %s\n", bundle_path.c_str()); - // Create DYLD_LIBRARY_PATH - 'Bundle/sysroot/lib' + // Create DYLD_LIBRARY_PATH - 'Bundle/Contents/Sysroot/lib' std::string dyld_library_path = bundle_path; - dyld_library_path += "/sysroot/lib"; + dyld_library_path += "/Contents/Sysroot/lib"; dyld_library_path = "DYLD_LIBRARY_PATH=" + dyld_library_path; char* c_dyld_library_path = strdup(dyld_library_path.c_str()); - // Create LV2_PATH - 'Bundle/sysroot/lib/lv2' + // Create LV2_PATH - 'Bundle/Contents/Sysroot/lib/lv2' std::string lv2_path = bundle_path; - lv2_path += "/sysroot/lib/lv2"; + lv2_path += "/Contents/Sysroot/lib/lv2"; lv2_path = "LV2_PATH=" + lv2_path; char* c_lv2_path = strdup(lv2_path.c_str());