| | |
| | | /usr/libexec/PlistBuddy -c "Add :$key string $value" "$plist" |
| | | } |
| | | |
| | | strip_extended_attributes() { |
| | | local item="$1" |
| | | if command -v xattr >/dev/null; then |
| | | xattr -cr "$item" 2>/dev/null || true |
| | | fi |
| | | } |
| | | |
| | | assert_no_quarantine_attributes() { |
| | | local item="$1" |
| | | if command -v xattr >/dev/null; then |
| | | local found |
| | | found="$(xattr -lr "$item" 2>/dev/null | grep -F "com.apple.quarantine" | head -n 20 || true)" |
| | | [[ -z "$found" ]] || fail "com.apple.quarantine attributes remain under $item: |
| | | $found" |
| | | fi |
| | | } |
| | | |
| | | TARGET_ARCH="${1:-$(uname -m)}" |
| | | resolve_arch "$TARGET_ARCH" |
| | | |
| | |
| | | cp "$SHERPA_LIB_DIR/libsherpa-onnx-c-api.dylib" "$APP_BUNDLE/Contents/Frameworks/" |
| | | cp "$ONNXRUNTIME_DYLIB" "$APP_BUNDLE/Contents/Frameworks/" |
| | | |
| | | step "Removing extended attributes from app bundle" |
| | | strip_extended_attributes "$APP_BUNDLE" |
| | | assert_no_quarantine_attributes "$APP_BUNDLE" |
| | | |
| | | step "Fixing rpaths" |
| | | install_name_tool -add_rpath @executable_path/../Frameworks \ |
| | | "$APP_BUNDLE/Contents/MacOS/$APP_NAME" 2>/dev/null || true |
| | |
| | | sign_sandboxed "$APP_BUNDLE/Contents/MacOS/$APP_NAME" |
| | | sign_sandboxed "$APP_BUNDLE" |
| | | |
| | | step "Removing extended attributes after signing" |
| | | strip_extended_attributes "$APP_BUNDLE" |
| | | assert_no_quarantine_attributes "$APP_BUNDLE" |
| | | |
| | | step "Verifying app signature and entitlements" |
| | | codesign -vvv --deep --strict "$APP_BUNDLE" |
| | | codesign -d --entitlements :- "$APP_BUNDLE" |