From af6a10f9802c1d01209abbca3d4253c224d299c6 Mon Sep 17 00:00:00 2001 From: Kristian Larsson Date: Thu, 26 Sep 2024 00:05:43 +0200 Subject: [PATCH] Guide: fix zig pkg-add example --- docs/acton-by-example/src/zig_dependencies.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/acton-by-example/src/zig_dependencies.md b/docs/acton-by-example/src/zig_dependencies.md index 78fdfb11..f1bcb420 100644 --- a/docs/acton-by-example/src/zig_dependencies.md +++ b/docs/acton-by-example/src/zig_dependencies.md @@ -2,6 +2,28 @@ Much like dependencies on other Acton packages, an Acton project can depend on a Zig package which could be a C / C++ or Zig library, as long as it has a `build.zig` file. -- `acton zig-pkg add URL NAME --artifact X --artifact` +- `acton zig-pkg add URL NAME --artifact X --artifact Y` - list the libraries you want to link with as artifacts - `acton zig-pkg remove NAME` + +~~~admonish example +``` +acton zig-pkg add https://github.com/allyourcodebase/zlib/archive/refs/tags/1.3.1.tar.gz zlib --artifacts z +``` + +```json +{ + "dependencies": {}, + "zig_dependencies": { + "zlib": { + "url": "https://github.com/allyourcodebase/zlib/archive/refs/tags/1.3.1.tar.gz", + "hash": "122034ab2a12adf8016ffa76e48b4be3245ffd305193edba4d83058adbcfa749c107", + "artifacts": [ + "z" + ] + } + } +} +``` + +~~~