| author | |
| committer | |
| log | 014d13f8a3ca27359ee2b48b1e83e60c6df78f33 |
| tree | c06cc61038dfc7bf5a0025b753db1a269c4434b1 |
| parent | 7cd61e4cc5676da20b74302e9b39276f15cdc9d0 |
8 files changed, 12 insertions(+), 57 deletions(-)
.github/workflows/nightly.yml-3| ... | ... | @@ -30,9 +30,6 @@ jobs: |
| 30 | 30 | |
| 31 | 31 | - run: zig version |
| 32 | 32 | - run: zig env |
| 33 | - run: zig build -Dbootstrap | |
| 34 | - run: ./zig-out/bin/zigmod ci | |
| 35 | - run: cat deps.zig | |
| 36 | 33 | - run: zig build |
| 37 | 34 | - run: ./zig-out/bin/zigmod version |
| 38 | 35 | - run: ./zig-out/bin/zigmod sum |
.github/workflows/push.yml-3| ... | ... | @@ -23,9 +23,6 @@ jobs: |
| 23 | 23 | |
| 24 | 24 | - run: zig version |
| 25 | 25 | - run: zig env |
| 26 | - run: zig build -Dbootstrap | |
| 27 | - run: ./zig-out/bin/zigmod ci | |
| 28 | - run: cat deps.zig | |
| 29 | 26 | - run: zig build |
| 30 | 27 | |
| 31 | 28 | # Build All |
README.md+1-8| ... | ... | @@ -23,16 +23,9 @@ A package manager for the Zig programming language. |
| 23 | 23 | ### Build from Source |
| 24 | 24 | Initially, |
| 25 | 25 | ``` |
| 26 | $ git clone https://github.com/nektro/zigmod --recursive | |
| 26 | $ git clone https://github.com/nektro/zigmod | |
| 27 | 27 | $ cd zigmod |
| 28 | $ zig build -Dbootstrap | |
| 29 | $ ./zig-out/bin/zigmod fetch | |
| 30 | ``` | |
| 31 | ||
| 32 | To build, | |
| 33 | ``` | |
| 34 | 28 | $ zig build |
| 35 | $ ./zig-out/bin/zigmod | |
| 36 | 29 | ``` |
| 37 | 30 | |
| 38 | 31 | ## Usage |
build.zig+9-14| ... | ... | @@ -15,19 +15,6 @@ pub fn build(b: *std.build.Builder) void { |
| 15 | 15 | const use_full_name = b.option(bool, "use-full-name", "") orelse false; |
| 16 | 16 | const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) }); |
| 17 | 17 | const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" }); |
| 18 | const exe = makeExe(b, exe_name, target, mode); | |
| 19 | ||
| 20 | const run_cmd = exe.run(); | |
| 21 | run_cmd.step.dependOn(b.getInstallStep()); | |
| 22 | if (b.args) |args| { | |
| 23 | run_cmd.addArgs(args); | |
| 24 | } | |
| 25 | ||
| 26 | const run_step = b.step("run", "Run the app"); | |
| 27 | run_step.dependOn(&run_cmd.step); | |
| 28 | } | |
| 29 | ||
| 30 | fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget, mode: std.builtin.Mode) *std.build.LibExeObjStep { | |
| 31 | 18 | const exe = b.addExecutable(exe_name, "src/main.zig"); |
| 32 | 19 | exe.setTarget(target); |
| 33 | 20 | exe.setBuildMode(mode); |
| ... | ... | @@ -38,5 +25,13 @@ fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget, |
| 38 | 25 | |
| 39 | 26 | deps.addAllTo(exe); |
| 40 | 27 | exe.install(); |
| 41 | return exe; | |
| 28 | ||
| 29 | const run_cmd = exe.run(); | |
| 30 | run_cmd.step.dependOn(b.getInstallStep()); | |
| 31 | if (b.args) |args| { | |
| 32 | run_cmd.addArgs(args); | |
| 33 | } | |
| 34 | ||
| 35 | const run_step = b.step("run", "Run the app"); | |
| 36 | run_step.dependOn(&run_cmd.step); | |
| 42 | 37 | } |
docs/README.md+1-11| ... | ... | @@ -16,20 +16,10 @@ The earliest Zig release this Zigmod was verified to work with is `0.10.0-dev.39 |
| 16 | 16 | You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source. |
| 17 | 17 | |
| 18 | 18 | ### Build Zigmod from source |
| 19 | 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. | |
| 20 | ||
| 21 | 19 | ``` |
| 22 | $ git clone https://github.com/nektro/zigmod --recursive | |
| 20 | $ git clone https://github.com/nektro/zigmod | |
| 23 | 21 | $ cd zigmod |
| 24 | $ zig build -Dbootstrap | |
| 25 | $ ./zig-out/bin/zigmod fetch | |
| 26 | ``` | |
| 27 | ||
| 28 | Now that we made our bootstrap build and have the rest of our dependencies, we can build as normal. | |
| 29 | ||
| 30 | ``` | |
| 31 | 22 | $ zig build |
| 32 | $ ./zig-out/bin/zigmod | |
| 33 | 23 | ``` |
| 34 | 24 | |
| 35 | 25 | ## Getting Started |
src/lib.zig+1-5| ... | ... | @@ -1,13 +1,9 @@ |
| 1 | 1 | const zfetch = @import("zfetch"); |
| 2 | 2 | |
| 3 | pub const commands_to_bootstrap = struct { | |
| 3 | pub const commands = struct { | |
| 4 | 4 | pub const version = @import("./cmd/version.zig"); |
| 5 | 5 | pub const fetch = @import("./cmd/fetch.zig"); |
| 6 | 6 | pub const ci = @import("./cmd/ci.zig"); |
| 7 | }; | |
| 8 | ||
| 9 | pub const commands = struct { | |
| 10 | pub usingnamespace commands_to_bootstrap; | |
| 11 | 7 | pub const init = @import("./cmd/init.zig"); |
| 12 | 8 | pub const sum = @import("./cmd/sum.zig"); |
| 13 | 9 | pub const zpm = @import("./cmd/zpm.zig"); |
src/zfetch_stub.zig deleted-9| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | //! placeholder for bootstrap build | |
| 2 | ||
| 3 | pub fn init() !void { | |
| 4 | // | |
| 5 | } | |
| 6 | ||
| 7 | pub fn deinit() void { | |
| 8 | // | |
| 9 | } |
zig.mod-4| ... | ... | @@ -26,10 +26,6 @@ dependencies: |
| 26 | 26 | - src/scanner.c |
| 27 | 27 | - src/writer.c |
| 28 | 28 | |
| 29 | # Entries above this line are needed to bootstrap and kept as git submodules | |
| 30 | # -------- | |
| 31 | # Entries below this line are only fetched with zigmod itself | |
| 32 | ||
| 33 | 29 | - src: git https://github.com/nektro/zig-ansi |
| 34 | 30 | - src: git https://github.com/ziglibs/known-folders |
| 35 | 31 | - src: git https://github.com/nektro/zig-licenses |