Build sup2vob into the app bundle so it ships and stays fresh

A "Build sup2vob CLI" run-script phase on the Subler target runs the
submodule's Makefile (incremental — a no-op unless the conversion
sources changed) and installs the product to Contents/MacOS/sup2vob.
Every Subler build refreshes the CLI; a terminal sup2vob can be a
symlink into the bundle instead of a copied `make install`.

extractsubs finds that bundle-internal sup2vob automatically: PATH
first, then the script's own ../MacOS/sup2vob sibling, so running the
copy inside Subler.app/Contents/Resources works with no install at all
(verified with sup2vob absent from PATH: same 1920x1080 .sub/.idx).

The phase walks the source tree, so it opts the Subler target out of
ENABLE_USER_SCRIPT_SANDBOXING — a build-time shell-script file-access
setting only, no effect on the app's runtime security posture.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Scott GarrettandClaude Code committed 2026-11-28 23:25:40 -05:00
1 parent 56d843c044
commit 51112947fb
3 files changed
+53 -9

No files matched your search

+25
View File
@@ -809,6 +809,7 @@
8D15AC330486D014006FF6A4 /* Frameworks */,
A984DB5E0F52D68E001A20B2 /* Copy Files */,
A922E0272233C9AC0072FD1B /* Copy Files */,
A9E77B152E5C0FF4E0000004 /* Build sup2vob CLI */,
);
buildRules = (
);
@@ -945,6 +946,28 @@
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
A9E77B152E5C0FF4E0000004 /* Build sup2vob CLI */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Build sup2vob CLI";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/zsh;
shellScript = "# The sup2vob CLI ships inside the app bundle (Contents/MacOS) so it\n# updates with every Subler build; make is incremental, so this is a\n# no-op unless the conversion sources or main.swift changed. The recipe\n# lives in the submodule's Makefile — do not duplicate it here.\nset -eu\nmake -C \"${SRCROOT}/MP42Foundation/sup2vob\"\ninstall -m 755 \"${SRCROOT}/MP42Foundation/sup2vob/sup2vob\" \"${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/MacOS/sup2vob\"\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D15AC300486D014006FF6A4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
@@ -1522,6 +1545,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO; /* the "Build sup2vob CLI" phase runs the submodule Makefile over MP42/Sup2Vob */
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_OPTIMIZATION = space;
@@ -1570,6 +1594,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO; /* the "Build sup2vob CLI" phase runs the submodule Makefile over MP42/Sup2Vob */
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_OPTIMIZATION = space;