Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0b1719921 | ||
|
|
fe68c5c01d |
@@ -28,7 +28,7 @@ This directory is the **native AppKit implementation** of [`SPEC.md`](SPEC.md).
|
||||
|
||||
| Item | Value |
|
||||
|------|--------|
|
||||
| macOS | 10.15 Catalina → 26+ Tahoe |
|
||||
| macOS | Intel **10.15** Catalina · Apple Silicon **11.0** Big Sur → 26+ Tahoe |
|
||||
| Architecture | Universal 2 (Intel + Apple Silicon) |
|
||||
| Xcode | Command Line Tools / full Xcode (Swift 5) |
|
||||
| Sandbox | Hardened Runtime **on**, App Sandbox **off** |
|
||||
|
||||
@@ -34,7 +34,8 @@ if xcodebuild_works; then
|
||||
# shellcheck source=lib.sh
|
||||
source "$SCRIPTS/lib.sh"
|
||||
JOBS="$(cpu_jobs)"
|
||||
echo "==> Building TargetPrint ($CONFIGURATION, $ARCH) with $XCODEBUILD (-jobs $JOBS)"
|
||||
MIN_OS="$(min_os_for_arch "$ARCH")"
|
||||
echo "==> Building TargetPrint ($CONFIGURATION, $ARCH, min $MIN_OS) with $XCODEBUILD (-jobs $JOBS)"
|
||||
rm -rf "$OUT_DIR"
|
||||
mkdir -p "$OUT_DIR" "$DD_DIR"
|
||||
"$XCODEBUILD" \
|
||||
@@ -47,6 +48,7 @@ if xcodebuild_works; then
|
||||
-derivedDataPath "$DD_DIR" \
|
||||
CONFIGURATION_BUILD_DIR="$OUT_DIR" \
|
||||
ONLY_ACTIVE_ARCH=NO \
|
||||
MACOSX_DEPLOYMENT_TARGET="$MIN_OS" \
|
||||
CODE_SIGN_IDENTITY="${MACOS_CODESIGN_IDENTITY:--}" \
|
||||
CODE_SIGNING_ALLOWED=YES \
|
||||
ENABLE_HARDENED_RUNTIME=YES \
|
||||
|
||||
@@ -39,6 +39,15 @@ cpu_jobs() {
|
||||
sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4
|
||||
}
|
||||
|
||||
# Intel: Catalina 10.15. Apple Silicon did not exist until Big Sur 11.0.
|
||||
min_os_for_arch() {
|
||||
case "$1" in
|
||||
x86_64) echo "${MACOSX_DEPLOYMENT_TARGET_X86_64:-10.15}" ;;
|
||||
arm64) echo "${MACOSX_DEPLOYMENT_TARGET_ARM64:-11.0}" ;;
|
||||
*) echo "10.15" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
zip_app() {
|
||||
local app="$1"
|
||||
local dest="$2"
|
||||
|
||||
@@ -20,22 +20,17 @@ BIN="$MACOS_DIR/TargetPrint"
|
||||
|
||||
SDKROOT="${SDKROOT:-$(xcrun --sdk macosx --show-sdk-path)}"
|
||||
SWIFT="${SWIFT:-$(xcrun --find swiftc)}"
|
||||
# Match the SDK so swiftc uses the prebuilt stdlib. Targeting macos10.15
|
||||
# with a modern CLT compiler forces a multi-minute stdlib rebuild and
|
||||
# still may not find a compatible x86_64 runtime.
|
||||
SDK_VER="$(xcrun --sdk macosx --show-sdk-version 2>/dev/null || sw_vers -productVersion)"
|
||||
SDK_VER="${SDK_VER%%$'\n'*}"
|
||||
TARGET="${ARCH}-apple-macos${SDK_VER}"
|
||||
MIN_OS="10.15"
|
||||
|
||||
# shellcheck source=lib.sh
|
||||
source "$(dirname "$0")/lib.sh"
|
||||
JOBS="$(cpu_jobs)"
|
||||
MIN_OS="$(min_os_for_arch "$ARCH")"
|
||||
TARGET="${ARCH}-apple-macos${MIN_OS}"
|
||||
|
||||
echo "==> swiftc build ($CONFIGURATION, $ARCH, $JOBS threads)"
|
||||
echo " SDKROOT=$SDKROOT"
|
||||
echo " SWIFT=$SWIFT"
|
||||
echo " TARGET=$TARGET"
|
||||
echo " TARGET=$TARGET (min $MIN_OS)"
|
||||
|
||||
rm -rf "$APP"
|
||||
mkdir -p "$MACOS_DIR" "$RES_DIR"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import AppKit
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
/// SPEC §9 — three-pane window: thumbnails | canvas | inspector.
|
||||
|
||||
@@ -211,7 +212,15 @@ final class PreviewWindowController: NSWindowController {
|
||||
let panel = NSOpenPanel()
|
||||
panel.allowsMultipleSelection = true
|
||||
panel.canChooseDirectories = false
|
||||
panel.allowedFileTypes = ["tif", "tiff", "targetjob", "json"]
|
||||
if #available(macOS 12.0, *) {
|
||||
var types: [UTType] = [.tiff, .json]
|
||||
if let jobType = UTType(filenameExtension: "targetjob") {
|
||||
types.append(jobType)
|
||||
}
|
||||
panel.allowedContentTypes = types
|
||||
} else {
|
||||
panel.allowedFileTypes = ["tif", "tiff", "targetjob", "json"]
|
||||
}
|
||||
panel.begin { result in
|
||||
if result == .OK { completion(panel.urls) }
|
||||
}
|
||||
|
||||
@@ -82,11 +82,16 @@ enum ColorMatching {
|
||||
static func stripColorMatchingAccessories(from panel: NSPrintPanel) {
|
||||
let accessories = panel.accessoryControllers
|
||||
for ac in accessories {
|
||||
let title = (ac.title ?? "") + " " + (ac.nibName ?? "")
|
||||
let cls = NSStringFromClass(type(of: ac))
|
||||
let title = (ac.title ?? "") + " " + (ac.nibName ?? "") + " " + cls
|
||||
let hay = title.lowercased()
|
||||
if hay.contains("color matching") || hay.contains("colour matching") || hay.contains("colormatch") {
|
||||
panel.removeAccessoryController(ac)
|
||||
TPLog.info("Removed print-panel accessory: \(title)")
|
||||
// SDK types this as NSViewController; removeAccessoryController
|
||||
// requires NSPrintPanelAccessorizing (SPEC §7.2).
|
||||
if let accessor = ac as? (NSViewController & NSPrintPanelAccessorizing) {
|
||||
panel.removeAccessoryController(accessor)
|
||||
TPLog.info("Removed print-panel accessory: \(title)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user