chore: update packer metadata and readme

This commit is contained in:
2026-08-06 13:47:05 +08:00
parent bf0837e4a6
commit f9333c72be
2 changed files with 71 additions and 3 deletions
+51 -2
View File
@@ -1,5 +1,52 @@
# sarasacw-omrf-packer # sarasacw-omrf-packer
`sarasacw-omrf-packer` is the distribution packer of the Sarasas Chip Workshop Oh My Rust FFI (OMRF) toolset.
Given a Rust project that exposes a C-friendly FFI as a `cdylib`, it assembles a CMake-style redistributable tree.
It involves header files, the built dynamic library, and generated CMake and pkg-config package files,
and it can additionally bundle the result into a zip archive.
It targets Rust FFI projects that need to be distributed and consumed like ordinary CMake/pkg-config packages,
including on MSVC-only Windows toolchains where pkg-config alone is not enough.
## Status
Barely works for the specific workflow of Sarasas Chip Workshop.
And will be improved by new requirement coming from Sarasas Chip Workshop devlopment.
Projects declare the minimum required packer version through the `min_version` field in their `[package.metadata.omrf]` table;
running an older packer than requested fails fast with a clear error.
## License
Licensed under the MIT License.
## Usage
Install from PyPI (the project is built with `uv`, but `pipx install` or `pip install` work just as well on the published wheel):
```console
uv tool install sarasacw-omrf-packer
```
The packer does not build the project itself. Build it first -- `cargo build --release`, adding `--target <triple>` for cross-compilation -- then run:
```console
sarasacw-omrf-packer -m path/to/Cargo.toml
```
`cargo` and `rustc` are resolved from `PATH`; override them with the environment variables listed in the [Environment Variables](#environment-variables) section.
### Command-line options
| Option | Required | Description |
|---|---|---|
| `-m`, `--manifest <CARGO.TOML>` | yes | Path to the `Cargo.toml` of the project to pack. |
| `-d`, `--dist-dir <DIR>` | no | Directory where the redistributable tree is materialized (`bin/`, `include/`, `lib/`, ...). |
| `-z`, `--dist-zip <ZIP>` | no | Path of the zip archive produced from the redistributable tree. |
| `-t`, `--target <TRIPLE>` | no | Target triple to pack for (e.g. `x86_64-pc-windows-msvc`). Defaults to the host toolchain triple. |
`--dist-dir` and `--dist-zip` are independent: pass either, both, or neither. Omitting both performs a dry run that validates the configuration without writing any output. Run `sarasacw-omrf-packer --help` for the authoritative list.
## Metadata ## Metadata
All packer used properties are stored in target Rust manifest file as metadata style. All packer used properties are stored in target Rust manifest file as metadata style.
@@ -77,5 +124,7 @@ requires = ["libfoo >= 1.0", "libbar"]
## Environment Variables ## Environment Variables
- `OMRF_PACKER_CARGO`: Path to the `cargo` executable used to collect project metadata. When unset, the packer invokes `cargo` as resolved from `PATH`. - `OMRF_PACKER_CARGO`: Path to the `cargo` executable used to collect project metadata.
- `OMRF_PACKER_RUSTC`: Path to the `rustc` executable used to resolve the host toolchain triple. When unset, the packer invokes `rustc` as resolved from `PATH`. When unset, the packer invokes `cargo` as resolved from `PATH`.
- `OMRF_PACKER_RUSTC`: Path to the `rustc` executable used to resolve the host toolchain triple.
When unset, the packer invokes `rustc` as resolved from `PATH`.
+20 -1
View File
@@ -1,12 +1,26 @@
[project] [project]
name = "sarasacw-omrf-packer" name = "sarasacw-omrf-packer"
version = "1.0.0" version = "1.0.0"
description = "Add your description here" description = "The packer for Rust, specifically designed for the SarasaCW OMRF project, to distribute C-friendly FFI dynamic library as CMake package."
readme = "README.md" readme = "README.md"
authors = [ authors = [
{ name = "yyc12345", email = "yyc12321@outlook.com" } { name = "yyc12345", email = "yyc12321@outlook.com" }
] ]
requires-python = ">=3.13" requires-python = ">=3.13"
license = { text = "MIT" }
keywords = ["rust", "ffi", "cmake", "pkg-config", "packaging", "omrf"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [ dependencies = [
"jinja2==3.1.6", "jinja2==3.1.6",
"semver>=3.0.4", "semver>=3.0.4",
@@ -15,6 +29,11 @@ dependencies = [
[project.scripts] [project.scripts]
sarasacw-omrf-packer = "sarasacw_omrf_packer:main" sarasacw-omrf-packer = "sarasacw_omrf_packer:main"
[project.urls]
Homepage = "https://github.com/SarasasChipWorkshop/sarasacw-omrf"
Repository = "https://github.com/SarasasChipWorkshop/sarasacw-omrf"
Issues = "https://github.com/SarasasChipWorkshop/sarasacw-omrf/issues"
[build-system] [build-system]
requires = ["uv_build>=0.8.0,<0.9"] requires = ["uv_build>=0.8.0,<0.9"]
build-backend = "uv_build" build-backend = "uv_build"