From b341b4d2454b37731c0f58783be78df8cd9f7f19 Mon Sep 17 00:00:00 2001 From: pfg Date: Mon, 30 Sep 2024 16:57:28 -0400 Subject: [PATCH 1/2] Add usage instructions to readme --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index da5dc250a5..1fb20ff4c2 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,30 @@ is [Zig](https://ziglang.org/download/). Zig API bindings are also provided via the "av" module. See `doc/examples` for API usage examples. +## Usage + +``` +zig fetch --save=ffmpeg git+https://github.com/allyourcodebase/ffmpeg#main +``` + +```zig +// build.zig +const ffmpeg_dep = b.dependency("ffmpeg", .{.target = target, .optimize = optimize}); +``` + +Choose one: + +- Just link ffmpeg: + + ```zig + exe.linkLibrary(ffmpeg_dep.artifact("ffmpeg")); + ``` +- Add zig bindings with `@import("ffmpeg")` + + ```zig + exe.root_module.addImport("ffmpeg", ffmpeg_dep.module("av")); + ``` + ## Differences from Upstream * Only a single static library is produced. There is no option to create a From e62139abca11206c4ee5daf3c829f4877cd1af17 Mon Sep 17 00:00:00 2001 From: pfg Date: Mon, 30 Sep 2024 19:27:45 -0400 Subject: [PATCH 2/2] Switch fetch instructions to use a tagged release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1fb20ff4c2..67ba60cd7f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ API usage examples. ## Usage ``` -zig fetch --save=ffmpeg git+https://github.com/allyourcodebase/ffmpeg#main +zig fetch --save=ffmpeg https://github.com/allyourcodebase/ffmpeg/archive/refs/tags/7.0.1-5.tar.gz ``` ```zig