| ... | ... | @@ -31,7 +31,6 @@ pub const GitExactStep = struct { |
| 31 | 31 | |
| 32 | 32 | var clonestep = std.Build.Step.Run.create(b, "clone"); |
| 33 | 33 | clonestep.addArgs(&.{ "git", "clone", "-q", "--progress", url, repopath }); |
| 34 | | result.step.dependOn(&clonestep.step); |
| 35 | 34 | |
| 36 | 35 | var checkoutstep = std.Build.Step.Run.create(b, "checkout"); |
| 37 | 36 | checkoutstep.addArgs(&.{ "git", "-C", repopath, "checkout", "-q", commit }); |
| ... | ... | @@ -47,30 +46,32 @@ pub const GitExactStep = struct { |
| 47 | 46 | } |
| 48 | 47 | }; |
| 49 | 48 | |
| 50 | | pub fn fetch(exe: *std.Build.Step.Compile) void { |
| 49 | pub fn fetch(exe: *std.Build.Step.Compile) *std.Build.Step { |
| 51 | 50 | const b = exe.step.owner; |
| 51 | const step = b.step("fetch", ""); |
| 52 | 52 | inline for (comptime std.meta.declarations(package_data)) |decl| { |
| 53 | 53 | const path = &@field(package_data, decl.name).entry; |
| 54 | 54 | const root = if (@field(package_data, decl.name).store) |_| b.cache_root.path.? else "."; |
| 55 | 55 | if (path.* != null) path.* = b.fmt("{s}/zigmod/deps{s}", .{ root, path.*.? }); |
| 56 | 56 | } |
| 57 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/marlersoft/zigwin32", "c778640d3dc153e900fbe37e2816b5176af3c802").step); |
| 58 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/arqv-ini", "38a018ad3a19d5b4663a5364d2d31271f250846b").step); |
| 59 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "4dc8850883b49e4a452871298788b06b1af9fe24").step); |
| 60 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zfetch", "863be236188e5f24d16554f9dcd7df96dd254a13").step); |
| 61 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "c3e439f86b0484e4428f38c4d8b07b7b5ae1634b").step); |
| 62 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "3ff57d0681b7bd7f8ca9bd092afa0b4bfe2f1afd").step); |
| 63 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "74f0ddb0a4dfa7921739b88cc381951a6b6e73ce").step); |
| 64 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "9e1d873db79e9ffa6ae6e06bd372428c9be85d97").step); |
| 65 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "e548b0bcc7b6f34f636c0b6b905928d31254c54d").step); |
| 66 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "f46d9f774df929885eef66c733a1e2a46bf16aec").step); |
| 67 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "b01e5a2dffcc564bddd8f514fe64bab9b5c52572").step); |
| 68 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-range", "4b2f12808aa09be4b27a163efc424dd4e0415992").step); |
| 69 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "ba546bbf2e8438c9b2325f36f392c9d95b432e8e").step); |
| 70 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "0d17fb99cba338aedc1abac12d78d5e5f04f0b6b").step); |
| 71 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/hzzp", "a7f03a1e652abe8c89b376d090cec50acb0d2a1a").step); |
| 72 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "0ad514dcfb7525e32ae349b9acc0a53976f3a9fa").step); |
| 73 | | exe.step.dependOn(&GitExactStep.create(b, "https://github.com/yaml/libyaml", "2c891fc7a770e8ba2fec34fc6b545c672beb37e6").step); |
| 57 | step.dependOn(&GitExactStep.create(b, "https://github.com/marlersoft/zigwin32", "c778640d3dc153e900fbe37e2816b5176af3c802").step); |
| 58 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/arqv-ini", "38a018ad3a19d5b4663a5364d2d31271f250846b").step); |
| 59 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "4dc8850883b49e4a452871298788b06b1af9fe24").step); |
| 60 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zfetch", "863be236188e5f24d16554f9dcd7df96dd254a13").step); |
| 61 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "c3e439f86b0484e4428f38c4d8b07b7b5ae1634b").step); |
| 62 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "3ff57d0681b7bd7f8ca9bd092afa0b4bfe2f1afd").step); |
| 63 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "74f0ddb0a4dfa7921739b88cc381951a6b6e73ce").step); |
| 64 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "9e1d873db79e9ffa6ae6e06bd372428c9be85d97").step); |
| 65 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "e548b0bcc7b6f34f636c0b6b905928d31254c54d").step); |
| 66 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "f46d9f774df929885eef66c733a1e2a46bf16aec").step); |
| 67 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "b01e5a2dffcc564bddd8f514fe64bab9b5c52572").step); |
| 68 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-range", "4b2f12808aa09be4b27a163efc424dd4e0415992").step); |
| 69 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "ba546bbf2e8438c9b2325f36f392c9d95b432e8e").step); |
| 70 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "0d17fb99cba338aedc1abac12d78d5e5f04f0b6b").step); |
| 71 | step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/hzzp", "a7f03a1e652abe8c89b376d090cec50acb0d2a1a").step); |
| 72 | step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "0ad514dcfb7525e32ae349b9acc0a53976f3a9fa").step); |
| 73 | step.dependOn(&GitExactStep.create(b, "https://github.com/yaml/libyaml", "2c891fc7a770e8ba2fec34fc6b545c672beb37e6").step); |
| 74 | return step; |
| 74 | 75 | } |
| 75 | 76 | |
| 76 | 77 | fn trimPrefix(comptime T: type, haystack: []const T, needle: []const T) []const T { |
| ... | ... | @@ -87,10 +88,10 @@ fn flip(foo: anytype) !void { |
| 87 | 88 | |
| 88 | 89 | pub fn addAllTo(exe: *std.Build.Step.Compile) void { |
| 89 | 90 | checkMinZig(builtin.zig_version, exe); |
| 90 | | fetch(exe); |
| 91 | const fetch_step = fetch(exe); |
| 91 | 92 | @setEvalBranchQuota(1_000_000); |
| 92 | 93 | for (packages) |pkg| { |
| 93 | | const module = pkg.module(exe); |
| 94 | const module = pkg.module(exe, fetch_step); |
| 94 | 95 | exe.root_module.addImport(pkg.name, module); |
| 95 | 96 | } |
| 96 | 97 | } |
| ... | ... | @@ -108,7 +109,7 @@ pub const Package = struct { |
| 108 | 109 | frameworks: []const string = &.{}, |
| 109 | 110 | module_memo: ?*std.Build.Module = null, |
| 110 | 111 | |
| 111 | | pub fn module(self: *Package, exe: *std.Build.Step.Compile) *std.Build.Module { |
| 112 | pub fn module(self: *Package, exe: *std.Build.Step.Compile, fetch_step: *std.Build.Step) *std.Build.Module { |
| 112 | 113 | if (self.module_memo) |cached| { |
| 113 | 114 | return cached; |
| 114 | 115 | } |
| ... | ... | @@ -120,11 +121,12 @@ pub const Package = struct { |
| 120 | 121 | .target = exe.root_module.resolved_target orelse b.host, |
| 121 | 122 | .optimize = exe.root_module.optimize.?, |
| 122 | 123 | }); |
| 124 | dummy_library.step.dependOn(fetch_step); |
| 123 | 125 | if (self.entry) |capture| { |
| 124 | 126 | result.root_source_file = .{ .path = capture }; |
| 125 | 127 | } |
| 126 | 128 | for (self.deps) |item| { |
| 127 | | const module_dep = item.module(exe); |
| 129 | const module_dep = item.module(exe, fetch_step); |
| 128 | 130 | if (module_dep.root_source_file != null) { |
| 129 | 131 | result.addImport(item.name, module_dep); |
| 130 | 132 | } |