cbilz/patch
Zig package for applying patches to files
Work in progress. Feedback is welcome!
This project will provide a Zig package for applying diffs in Git and unified formats to directory trees or individual files. It will be free of system dependencies by default while allowing integration with Git or GNU patch when needed.
One use case for this package will be to enable building C and C++ projects from pristine tarballs while applying patches for the host system, bug fixes, or other reasons. This approach is more transparent to dependents compared to building from a forked version of the upstream source.
The package will expose outputs as artifacts (via b.addNamedLazyPath(...)
)
and accept inputs as options (via b.option(LazyPath, ...)
), following the
intended
approach.
Internally, the package will use std.Build.Step.Run
instead of custom build
steps in preparation for the separation of the build runner from the configure
process.
By default, the package will use its own patch
implementation to help
dependents reduce their system dependencies. Every system dependency removed
makes it easier to onboard new contributors.
However, there will also be options (via b.systemIntegrationOption(...)
) to
use the system packages Git or
GNU patch when appropriate, such as when packaging or when build times or
compatibility are of concern.
Uses Zig 0.14.0-dev.3046+08d661fcf.