SPB Git

Repository Public License

project.yml 11.8 KB 243 lines yaml

1# ORIX Convert — project.yml2# Description: XcodeGen project definition (run Scripts/build.sh generate). The .xcodeproj is generated and gitignored.3#              To wire an engine: add its package below, add it to the target's dependencies, then one import + one4#              line in App/Sources/App/EngineCatalog.swift. List only packages that build.5# Author: Simon-Pierre Boucher — contact@spboucher.ai6name: ORIXConvert7options:8  bundleIdPrefix: ai.spboucher.orix9  deploymentTarget:10    macOS: "15.0"11  createIntermediateGroups: true12  developmentLanguage: en13packages:14  ORIXConvertCore:15    path: Packages/ORIXConvertCore16  EnginePDF:17    path: Packages/EnginePDF18  EngineImage:19    path: Packages/EngineImage20  EngineVector:21    path: Packages/EngineVector22  EngineMedia:23    path: Packages/EngineMedia24  EngineDocuments:25    path: Packages/EngineDocuments26  EngineFont:27    path: Packages/EngineFont28  EngineSubtitle:29    path: Packages/EngineSubtitle30  EngineGeo:31    path: Packages/EngineGeo32  EngineData:33    path: Packages/EngineData34  EngineModel3D:35    path: Packages/EngineModel3D36  EngineArchive:37    path: Packages/EngineArchive38  EngineScientific:39    path: Packages/EngineScientific40  # ENGINE-PACKAGES (kept in sync by hand with EngineCatalog.swift)41  # Static xcframeworks (CWebP, CAssimp, CArchive, CHDF5) and the CDuckDB dylib must carry their module map in42  # Headers/<Module>/module.modulemap (EmbeddedEngines/normalize-xcframework.sh): Xcode copies the Headers of every43  # xcframework into one shared include directory, and top-level module maps collide.44settings:45  base:46    SWIFT_VERSION: "6.0"47    MARKETING_VERSION: 1.0.048    CURRENT_PROJECT_VERSION: 149    DEVELOPMENT_TEAM: 3YM54G49SN50    DEAD_CODE_STRIPPING: YES51    ARCHS: arm6452    ONLY_ACTIVE_ARCH: YES53targets:54  ORIXConvert:55    type: application56    platform: macOS57    sources:58      - App/Sources59      - App/Resources60    dependencies:61      - package: ORIXConvertCore62        product: ConvertCore63      - package: EnginePDF64      - package: EngineImage65      - package: EngineVector66      - package: EngineMedia67      - package: EngineDocuments68      - package: EngineFont69      - package: EngineSubtitle70      - package: EngineGeo71      - package: EngineData72      - package: EngineModel3D73        product: EngineModel3D74      - package: EngineArchive75        product: EngineArchive76      - package: EngineScientific77        product: EngineScientific78      # ENGINE-DEPENDENCIES79    info:80      path: App/Info.plist81      properties:82        CFBundleDisplayName: ORIX Convert83        CFBundleName: ORIX Convert84        CFBundleShortVersionString: $(MARKETING_VERSION)85        CFBundleVersion: $(CURRENT_PROJECT_VERSION)86        LSApplicationCategoryType: public.app-category.utilities87        LSMinimumSystemVersion: $(MACOSX_DEPLOYMENT_TARGET)88        NSHumanReadableCopyright: "© 2026 Simon-Pierre Boucher"89        CFBundleLocalizations: [en, fr-CA]90        CFBundleDevelopmentRegion: en91        # Any file or folder can be dropped on the Dock icon or sent through "Open With". The rank is Alternate:92        # ORIX Convert never becomes the default handler of a type.93        CFBundleDocumentTypes:94          - CFBundleTypeName: File95            CFBundleTypeRole: Viewer96            LSHandlerRank: Alternate97            LSItemContentTypes: [public.data, public.item, public.content]98          - CFBundleTypeName: Folder99            CFBundleTypeRole: Viewer100            LSHandlerRank: Alternate101            LSItemContentTypes: [public.folder, public.directory]102        # Services menu (Finder › Services, any app whose selection is files): the selected files and folders are103        # staged in the app. Handled by ServicesProvider.convertFiles (App/Sources/Features/Integration).104        NSServices:105          - NSMenuItem:106              default: Convert with ORIX Convert107            NSMessage: convertFiles108            NSPortName: ORIX Convert109            NSSendFileTypes: [public.item]110    settings:111      base:112        PRODUCT_NAME: ORIX Convert113        PRODUCT_BUNDLE_IDENTIFIER: ai.spboucher.orix.convert114        ENABLE_HARDENED_RUNTIME: YES115        SWIFT_DEFAULT_ACTOR_ISOLATION: MainActor116        SWIFT_STRICT_CONCURRENCY: complete117        ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon118        ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor119        CODE_SIGN_ENTITLEMENTS: App/ORIXConvert.entitlements120        ENABLE_APP_SANDBOX: NO121        ENABLE_USER_SCRIPT_SANDBOXING: NO122        COMBINE_HIDPI_IMAGES: YES123      configs:124        Debug:125          CODE_SIGN_STYLE: Manual126          CODE_SIGN_IDENTITY: "-"127          DEVELOPMENT_TEAM: ""128        Release:129          CODE_SIGN_STYLE: Manual130          CODE_SIGN_IDENTITY: "Developer ID Application"131          CODE_SIGN_INJECT_BASE_ENTITLEMENTS: NO132          OTHER_CODE_SIGN_FLAGS: "--timestamp"133          ONLY_ACTIVE_ARCH: NO134    postBuildScripts:135      - name: Embed tools, helpers and licences136        basedOnDependencyAnalysis: false137        script: |138          set -e139          # 1. Licences → Contents/Resources/Licenses: one notice per bundled component (<component>.md) plus the140          #    licence texts that must travel with the binaries (<component>/<file>). LibreOffice keeps its own141          #    LICENSE / NOTICE / CREDITS inside its bundle (Contents/Helpers/LibreOffice.app/Contents/Resources).142          LICENSES="$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/Licenses"143          rm -rf "$LICENSES"; mkdir -p "$LICENSES"144          for notice in "$SRCROOT"/EmbeddedEngines/*/NOTICE.md; do145            [ -f "$notice" ] && cp "$notice" "$LICENSES/$(basename "$(dirname "$notice")").md"146          done147          if [ -d "$SRCROOT/EmbeddedEngines/ffmpeg/licenses" ]; then148            mkdir -p "$LICENSES/ffmpeg"; cp "$SRCROOT"/EmbeddedEngines/ffmpeg/licenses/* "$LICENSES/ffmpeg/"149          fi150          if [ -f "$SRCROOT/EmbeddedEngines/pandoc/COPYING-GPL-2.0.txt" ]; then151            mkdir -p "$LICENSES/pandoc"; cp "$SRCROOT/EmbeddedEngines/pandoc/COPYING-GPL-2.0.txt" "$LICENSES/pandoc/"152          fi153          if [ -f "$SRCROOT/EmbeddedEngines/hdf5/prefix/share/LICENSE" ]; then154            mkdir -p "$LICENSES/hdf5"; cp "$SRCROOT/EmbeddedEngines/hdf5/prefix/share/LICENSE" "$LICENSES/hdf5/LICENSE.txt"155          fi156157          # 2. Bundled helper tools → Contents/Helpers (symlinks preserved).158          #    ORIX_TOOLS_SOURCE=<dir> takes the tools from another folder: build/signed-tools after159          #    Scripts/sign-tools.sh (Developer ID + Hardened Runtime) for anything that leaves this Mac.160          #    Debug: the core falls back to EmbeddedEngines/tools in the repository, so the 700 MB copy is skipped161          #    unless ORIX_EMBED_TOOLS_IN_DEBUG=YES.162          TOOLS="${ORIX_TOOLS_SOURCE:-$SRCROOT/EmbeddedEngines/tools}"163          HELPERS="$TARGET_BUILD_DIR/$CONTENTS_FOLDER_PATH/Helpers"164          if [ "$CONFIGURATION" = "Debug" ] && [ "${ORIX_EMBED_TOOLS_IN_DEBUG:-NO}" != "YES" ]; then165            echo "Debug build: tools are used from $TOOLS (not copied)."166            rm -rf "$HELPERS"; mkdir -p "$HELPERS"167          elif [ -d "$TOOLS" ] && [ -n "$(ls -A "$TOOLS" 2>/dev/null)" ]; then168            mkdir -p "$HELPERS"169            rsync -a --delete --links "$TOOLS"/ "$HELPERS"/170          fi171172          # 3. Our own helper executables, built by SwiftPM in release mode with a clean environment (Xcode's build173          #    variables break a nested `swift build`), each in its own scratch folder under build/helpers, then174          #    signed here with the identity of this build (Hardened Runtime; secure timestamp when the app has one).175          #    - orix-model3d-helper: parses untrusted 3D files outside the app (required by Release builds).176          #    - orix-hdf5-probe: walks an HDF5 / NetCDF-4 file in its own process before the app opens it.177          #    - orix-midi-render: renders MIDI files to audio in a child process.178          #    - orix-convert: the command-line tool (Packages/ConvertKit), Release only (ORIX_EMBED_CLI=YES forces179          #      it in Debug, =NO skips it). Optional: a failed build is a warning.180          sign_helper() {181            if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" ]; then182              FLAGS="--force --options runtime --sign $EXPANDED_CODE_SIGN_IDENTITY"183              case "${OTHER_CODE_SIGN_FLAGS:-}" in *--timestamp*) FLAGS="$FLAGS --timestamp" ;; esac184              /usr/bin/codesign $FLAGS -i "ai.spboucher.orix.convert.$(basename "$1")" "$1"185            fi186          }187          # Run paths that only exist on the build machine (the Xcode toolchain, any absolute folder) are removed188          # before signing; @loader_path… and /usr/lib/swift stay (same rule as orix_strip_rpaths in cli-build.sh).189          strip_rpaths() {190            /usr/bin/otool -l "$1" | /usr/bin/awk '$1 == "cmd" && $2 == "LC_RPATH" { want = 1 } want && $1 == "path" { sub(/^ *path /, ""); sub(/ \(offset [0-9]+\)$/, ""); print; want = 0 }' |191            while IFS= read -r RPATH_ENTRY; do192              case "$RPATH_ENTRY" in193                @*|/usr/lib/swift) ;;194                *) /usr/bin/install_name_tool -delete_rpath "$RPATH_ENTRY" "$1" 2>/dev/null || true ;;195              esac196            done197            # The edit invalidates the linker's ad hoc signature; sign ad hoc again (sign_helper then applies the198            # identity of the build when there is one).199            /usr/bin/codesign --force --sign - "$1" >/dev/null 2>&1 || true200          }201          build_helper() { # <package dir> <product> <required: YES|NO>202            SCRATCH="$SRCROOT/build/helpers/$2"203            if env -i HOME="$HOME" PATH="/usr/bin:/bin:/usr/sbin:/sbin" DEVELOPER_DIR="$DEVELOPER_DIR" TMPDIR="${TMPDIR:-/tmp}" \204                /usr/bin/xcrun swift build --package-path "$1" --scratch-path "$SCRATCH" --build-system native -c release --product "$2" > "$SCRATCH.log" 2>&1; then205              cp -f "$SCRATCH/release/$2" "$HELPERS/$2"206              strip_rpaths "$HELPERS/$2"207              sign_helper "$HELPERS/$2"208            elif [ "$3" = "YES" ]; then209              tail -30 "$SCRATCH.log"; echo "error: $2 could not be built (log: $SCRATCH.log)"; exit 1210            else211              echo "warning: $2 could not be built and is not bundled (log: $SCRATCH.log)"212            fi213          }214          mkdir -p "$HELPERS" "$SRCROOT/build/helpers"215          build_helper "$SRCROOT/Packages/EngineModel3D" orix-model3d-helper YES216          build_helper "$SRCROOT/Packages/EngineScientific" orix-hdf5-probe YES217          build_helper "$SRCROOT/Packages/EngineMedia" orix-midi-render YES218          # The CLI is built by Scripts/cli-build.sh (shared with matrix.sh / offline-check.sh / bench.sh).219          if { [ "$CONFIGURATION" != "Debug" ] && [ "${ORIX_EMBED_CLI:-YES}" != "NO" ]; } || [ "${ORIX_EMBED_CLI:-NO}" = "YES" ]; then220            CLI="$(env -i HOME="$HOME" PATH="/usr/bin:/bin:/usr/sbin:/sbin" DEVELOPER_DIR="$DEVELOPER_DIR" TMPDIR="${TMPDIR:-/tmp}" ROOT="$SRCROOT" ORIX_CONFIGURATION=release \221              /bin/bash -c '. "$ROOT/Scripts/cli-build.sh"; orix_build_cli >&2 && echo "$ORIX_CLI"' 2> "$SRCROOT/build/helpers/orix-convert.log" || true)"222            if [ -n "$CLI" ] && [ -x "$CLI" ]; then223              cp -f "$CLI" "$HELPERS/orix-convert"224              # The tool links libduckdb.dylib by rpath: next to it (.build) or in the app's Contents/Frameworks.225              if ! /usr/bin/otool -l "$HELPERS/orix-convert" | grep -q "@loader_path/../Frameworks"; then226                /usr/bin/install_name_tool -add_rpath "@loader_path/../Frameworks" "$HELPERS/orix-convert" 2>/dev/null || true227              fi228              strip_rpaths "$HELPERS/orix-convert"229              sign_helper "$HELPERS/orix-convert"230            else231              echo "warning: orix-convert (Packages/ConvertKit) could not be built and is not bundled (log: build/helpers/orix-convert.log)"232            fi233          fi234schemes:235  ORIXConvert:236    build:237      targets:238        ORIXConvert: all239    run:240      config: Debug241    archive:242      config: Release243
Files main
Menu

Theme