From 8e60e87abb390e67355abcac566dced0fb481551 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Fri, 7 May 2021 20:47:29 -0700 Subject: [PATCH] docs- clarify sections to be easier to follow along --- docs/README.md | 12 +++++++++++- docs/commands/fetch.md | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index 549466b44cf867f0afbb528fd97f4ac8c68faf67..83640c3f58395bef3a967d84a5eefdb1ba07dfbd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,12 +14,18 @@ As Zig is still in development itself, if you plan to contribute to Zigmod you w You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source. ### Build Zigmod from source -Assuming you have Zig master installed, +Zigmod partially uses itself to manage dependencies but can be bootstrapped with the 2 (two) included Git submodules. The first step will generate a build of Zigmod that only has the `fetch` command. This binary can then be used to grab the rest of the dependencies and generate a full build. + ``` $ git clone https://github.com/nektro/zigmod --recursive $ cd zigmod $ zig build -Dbootstrap $ ./zig-out/bin/zigmod fetch +``` + +Now that we made our bootstrap build and have the rest of our dependencies, we can build as normal. + +``` $ zig build $ ./zig-out/bin/zigmod ``` @@ -40,6 +46,10 @@ $ zig init-exe $ zigmod init ``` +You will also want to add `/.zigmod` and `/deps.zig` to your `.gitignore`. + +Then run `zigmod fetch`. After that you will be ready to integrate Zigmod with your existing `build.zig` which you can learn how to do [here](commands/fetch.md). + ## Principles Zigmod is but a prototype and not the official Zig package manager. As such I wanted to lay out some of the guiding principles learned/used when making the project. You can find that document [here](./principles.md). diff --git a/docs/commands/fetch.md b/docs/commands/fetch.md index b46bd57f39ec69fc96c0d917a78190bb78ecc3cb..9d1b37b2f8fc1291dc172662909f118ee0a73363 100644 --- a/docs/commands/fetch.md +++ b/docs/commands/fetch.md @@ -3,7 +3,7 @@ zigmod fetch ``` -- This command takes no parameters and will generate a `deps.zig` in the root of your project. +- This command takes no parameters and will generate a `deps.zig` in the root of your project. This is the file that you will then import into your `build.zig` to automatically add all the necessary packages and (any) C code that may be in your dependencies. - `deps.zig` is not typically checked into your source control. For a full reference on the fields available in `deps.zig` you can check [here](../deps.zig.md). -- 2.54.0