Awesome
maxutils: a few utility scripts for Max/MSP
This repo is for commandline scripts (typically in python3) to help solve recurrent release requirements for products built using Max / MSP and its related SDKs.
Product Scope
The types of products targetted by the scripts are:
-
Max External: compiled products using one of the Max SDKs, typically based on the Max c-api, and built on macOS, Windows, or both, and also for different architectures: arm64, x86_64 or, in the macOS case, so-called 'universal' architectures which combine arm64 and x86_64. These products may also have external dependencies which maybe bundled with the external or statically compiled into it.
-
Max Package: as per the Cycling74 definition: "a package is simply a folder adhering to a prescribed structure and placed in the 'packages' folder. Folders adhering to this structure can be accessed by Max to integrate seamlessly at launch time." Notably, such 'packages' may include an 'externals' folder which contains compiled Max externals and/or a
support
folder which may contain compiled dynamic link libraries (*.dll
,*.dylib
) or other resources to support the externals. -
Max Standalone: applications which can be shared with users who don't need to have Max installed. Can include packages and externals.
Script Functions
When building and releasing Max products the following functions may be needed:
-
Bundling: bundling dependencies together with the product.
-
Fixing: re-writing bundled dependency links to ensure that the bundle is relocatable.
-
Size Reduction: reduce the product's size by removing extranous parts or architectures.
-
Codesigning: codesign the compiled elements in the product.
-
Notarization: notarize products or containers.
-
Packaging: package signed, notarized products for distribution.
Design Requirements
Python scripts should be self-contained and have a main class that encapsulates methods to solve a particular problem. The script should be independent, self-contained and usable from the commandline or imported for programmatic usage. The class should be general enough to be re-used in other contexts if required.
Shell scripts should be bash compatible and should pass 100% of shellcheck tests.
The Scripts
The scripts are in the scripts
directory and are most;y written in bash or in pure python3 code without any dependencies outside of the python3 standard library.
-
notarize.sh: a bash script for manual codesigning and notarization on macOS, which requires some environmental variables to be set:
DEV_ID
,APP_PASS
,APPLE_ID
andENTITLEMENTS
(optionally). -
standalone.py: a cli utility intended to handle max standalone post-production tasks (cleaning, shrinking, fixes, codesigning, packaging, notarization).
-
shrink.py: recursively 'thins' a folder of fat binaries by dropping uneeded architectures from binaries within the folder. This is not max specific and can be used in any macOS folder which contains fat binaries (even if they are deeply nested).
maxutils: max utilities in a python package
Since it was observed that a number of the scripts kept re-inventing the wheel, there is a (grand unification) project, currently called maxutils
, to refactor as much as possible and create a unified python package which will have an argparse-based interface. This project under development and still not functional.