https://github.com/mitchellh/zig-build-libpng
The libpng library built and packaged for the Zig build system. These are not Zig language bindings to the library.
https://github.com/mitchellh/zig-build-libpng
Last synced: 7 months ago
JSON representation
The libpng library built and packaged for the Zig build system. These are not Zig language bindings to the library.
- Host: GitHub
- URL: https://github.com/mitchellh/zig-build-libpng
- Owner: mitchellh
- License: mit
- Created: 2023-08-04T02:47:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-19T21:21:23.000Z (about 1 year ago)
- Last Synced: 2024-11-30T23:04:07.231Z (7 months ago)
- Language: C
- Size: 1.51 MB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libpng built with Zig
This project builds [libpng](https://github.com/glennrp/libpng)
with Zig. These are _not Zig language bindings_ to the project. The goal of
this project is to enable the upstream project to be used with the Zig
package manager. Downstream users may also not be Zig language users, they
may just be using Zig as a build system.This is not strictly a fork (the source for the upstream project is copied
into the "upstream" directory unmodified unless noted). For security reasons,
you can verify the contents using the `verify.sh` script. Please read the
shell script contents, it is written in a plain way.I implore that you do not blindly trust me -- pin this repository to a
specific version and verify the checksums match yourself.## Usage
Create a `build.zig.zon` like so:
```zig
.{
.name = "my-project",
.version = "0.0.0",
.dependencies = .{
.libpng = .{
.url = "https://github.com/mitchellh/zig-build-libpng/archive/.tar.gz",
.hash = "12208070233b17de6be05e32af096a6760682b48598323234824def41789e993432c",
},
},
}
```And in your `build.zig`:
```zig
const libpng = b.dependency("libpng", .{ .target = target, .optimize = optimize });
exe.linkLibrary(libpng.artifact("png"));
```In your code you can now `@cImport` the project.
## Versions
This project makes no guarantee to stay up to date with every released
version of the upstream project. If you'd like to contribute a new version,
please do and we will tag it accordingly.**The current version is always available in `upstream.txt`.** This is
the Git commit hash of the "upstream" folder.### Updating
You can update to any arbitrary upstream Git ref using `update.sh`:
```
$ ./update.sh HEAD
```### Verify
You can verify that the contents match upstream by running `verify.sh`:
```
$ ./verify.sh
```An exit status of 0 means it was successful.