{"id":16267046,"url":"https://github.com/wezm/classic-mac-rust","last_synced_at":"2025-03-19T23:30:49.036Z","repository":{"id":152748280,"uuid":"620098344","full_name":"wezm/classic-mac-rust","owner":"wezm","description":"Experiments using Rust code in classic Mac applications","archived":false,"fork":false,"pushed_at":"2023-03-29T01:59:52.000Z","size":18,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T11:55:04.925Z","etag":null,"topics":["classic-mac-os","retrocomputing","rust"],"latest_commit_sha":null,"homepage":"https://www.wezm.net/v2/posts/2023/rust-classic-mac-os-app/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wezm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-28T02:49:58.000Z","updated_at":"2024-04-27T19:37:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c036b800-d511-4d75-9fa8-eb690cf94ca7","html_url":"https://github.com/wezm/classic-mac-rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wezm%2Fclassic-mac-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wezm%2Fclassic-mac-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wezm%2Fclassic-mac-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wezm%2Fclassic-mac-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wezm","download_url":"https://codeload.github.com/wezm/classic-mac-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244524636,"owners_count":20466464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classic-mac-os","retrocomputing","rust"],"created_at":"2024-10-10T17:43:46.754Z","updated_at":"2025-03-19T23:30:49.031Z","avatar_url":"https://github.com/wezm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Rust on Classic Mac OS\n======================\n\nThis repo includes my experiments running Rust code on PPC classic Mac OS.\n\nBuilding\n--------\n\n**Note:** these steps have only been tested on Linux (Arch).\n\n### Prerequisites\n\n1. [My fork of the Retro68 with updated binutils][Retro68] (`binutils` branch)\n   built and on `$PATH`. E.g. `export PATH=$PATH:/home/you/path/to/Retro68-build/toolchain/bin`\n2. `rustup`\n3. Docker (if not on Debian based system) or `binutils-powerpc-linux-gnu` on\n   Debian based systems For non-Debian systems build the binutils docker image:\n   `(cd powerpc-binutils \u0026\u0026 docker build -t binutils-objcopy .)`\n\n### Prepare\n\n```\nmkdir build\ncd build\ncmake .. -DCMAKE_TOOLCHAIN_FILE=path/to/Retro68-build/toolchain/powerpc-apple-macos/cmake/retroppc.toolchain.cmake\ncd ..\n```\n\n### Build\n\nCompile the Rust code with:\n\n```\ncargo build --release -Z build-std=core,alloc --target powerpc-apple-macos.json\n```\n\nConvert the static library to XCOFF, either via Docker or `powerpc-linux-gnu-objcopy`\ndirectly:\n\n```\ndocker run --rm -it -v $(pwd):/src binutils-objcopy -O aixcoff-rs6000 /src/target/powerpc-apple-macos/release/libclassic_mac_rust.a /src/target/powerpc-apple-macos/release/libclassic_mac_rust.obj\n```\n\nBuild the C code, link in the Rust code, and produce the final binary:\n\n```\ncmake --build build --target Dialog_APPL\n```\n\n### Running\n\n`Dialog.bin` is the MacBinary encoded application, you can copy this to a\nmachine or emulator to run it. Retro68 provides the `LaunchAAPL` tool, which\ncombined with its server counterpart makes this very easy. With the server\nrunning on a machine or emulator you can launch the binary directly from you\nhost with:\n\n```\nLaunchAPPL -e tcp --tcp-address 127.0.0.1 build/Dialog.bin\n```\n\n[Retro68]: https://github.com/wezm/Retro68/tree/binutils\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwezm%2Fclassic-mac-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwezm%2Fclassic-mac-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwezm%2Fclassic-mac-rust/lists"}