authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-07-10 18:11:41 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-07-10 18:11:41 -07:00
log5a5394b6c164d9a40fc3d5dce44ee58cb76f2397
treedc7020453c335af6b5ab7e2d4daf9c7adad70cb1
parent7fd89da8f4e2cd524aeb0e88e0a22ca56a438b16

deps.zig- expose `Package.directory`, closes #9


3 files changed, 17 insertions(+), 4 deletions(-)

deps.zig+13
......@@ -31,6 +31,7 @@ pub fn addAllTo(exe: *std.build.LibExeObjStep) void {
3131}
3232
3333pub const Package = struct {
34 directory: string,
3435 pkg: ?Pkg = null,
3536 c_include_dirs: []const string = &.{},
3637 c_source_files: []const string = &.{},
......@@ -55,52 +56,64 @@ pub const dirs = struct {
5556
5657pub const package_data = struct {
5758 pub const _8mdbh0zuneb0 = Package{
59 .directory = dirs._8mdbh0zuneb0,
5860 .c_include_dirs = &.{ "include" },
5961 .c_source_files = &.{ "src/api.c", "src/dumper.c", "src/emitter.c", "src/loader.c", "src/parser.c", "src/reader.c", "src/scanner.c", "src/writer.c" },
6062 .c_source_flags = &.{ "-DYAML_VERSION_MAJOR=0", "-DYAML_VERSION_MINOR=2", "-DYAML_VERSION_PATCH=5", "-DYAML_VERSION_STRING=\"0.2.5\"", "-DYAML_DECLARE_STATIC=1" },
6163 };
6264
6365 pub const _s84v9o48ucb0 = Package{
66 .directory = dirs._s84v9o48ucb0,
6467 .pkg = Pkg{ .name = "ansi", .path = .{ .path = dirs._s84v9o48ucb0 ++ "/src/lib.zig" }, .dependencies = null },
6568 };
6669
6770 pub const _2ta738wrqbaq = Package{
71 .directory = dirs._2ta738wrqbaq,
6872 .pkg = Pkg{ .name = "known-folders", .path = .{ .path = dirs._2ta738wrqbaq ++ "/known-folders.zig" }, .dependencies = null },
6973 };
7074
7175 pub const _0npcrzfdlrvk = Package{
76 .directory = dirs._0npcrzfdlrvk,
7277 .pkg = Pkg{ .name = "licenses", .path = .{ .path = dirs._0npcrzfdlrvk ++ "/src/lib.zig" }, .dependencies = null },
7378 };
7479
7580 pub const _9k24gimke1an = Package{
81 .directory = dirs._9k24gimke1an,
7682 .pkg = Pkg{ .name = "hzzp", .path = .{ .path = dirs._9k24gimke1an ++ "/src/main.zig" }, .dependencies = null },
7783 };
7884
7985 pub const _csbnipaad8n7 = Package{
86 .directory = dirs._csbnipaad8n7,
8087 .pkg = Pkg{ .name = "iguanaTLS", .path = .{ .path = dirs._csbnipaad8n7 ++ "/src/main.zig" }, .dependencies = null },
8188 };
8289
8390 pub const _yyhw90zkzgmu = Package{
91 .directory = dirs._yyhw90zkzgmu,
8492 .pkg = Pkg{ .name = "network", .path = .{ .path = dirs._yyhw90zkzgmu ++ "/network.zig" }, .dependencies = null },
8593 };
8694
8795 pub const _u9w9dpp6p804 = Package{
96 .directory = dirs._u9w9dpp6p804,
8897 .pkg = Pkg{ .name = "uri", .path = .{ .path = dirs._u9w9dpp6p804 ++ "/uri.zig" }, .dependencies = null },
8998 };
9099
91100 pub const _ejw82j2ipa0e = Package{
101 .directory = dirs._ejw82j2ipa0e,
92102 .pkg = Pkg{ .name = "zfetch", .path = .{ .path = dirs._ejw82j2ipa0e ++ "/src/main.zig" }, .dependencies = &.{ _9k24gimke1an.pkg.?, _csbnipaad8n7.pkg.?, _yyhw90zkzgmu.pkg.?, _u9w9dpp6p804.pkg.? } },
93103 };
94104
95105 pub const _ocmr9rtohgcc = Package{
106 .directory = dirs._ocmr9rtohgcc,
96107 .pkg = Pkg{ .name = "json", .path = .{ .path = dirs._ocmr9rtohgcc ++ "/src/lib.zig" }, .dependencies = null },
97108 };
98109
99110 pub const _tnj3qf44tpeq = Package{
111 .directory = dirs._tnj3qf44tpeq,
100112 .pkg = Pkg{ .name = "range", .path = .{ .path = dirs._tnj3qf44tpeq ++ "/src/lib.zig" }, .dependencies = null },
101113 };
102114
103115 pub const _89ujp8gq842x = Package{
116 .directory = dirs._89ujp8gq842x,
104117 .pkg = Pkg{ .name = "zigmod", .path = .{ .path = dirs._89ujp8gq842x ++ "/src/lib.zig" }, .dependencies = &.{ _s84v9o48ucb0.pkg.?, _2ta738wrqbaq.pkg.?, _0npcrzfdlrvk.pkg.?, _ejw82j2ipa0e.pkg.?, _ocmr9rtohgcc.pkg.?, _tnj3qf44tpeq.pkg.? } },
105118 };
106119
docs/deps.zig.md+1-4
......@@ -12,6 +12,7 @@ A helper function to add all of the packages, C files, and system libraries to t
1212### `Package`
1313```zig
1414pub const Package = struct {
15 directory: string,
1516 pkg: ?Pkg = null,
1617 c_include_dirs: []const string = &.{},
1718 c_source_files: []const string = &.{},
......@@ -20,10 +21,6 @@ pub const Package = struct {
2021};
2122```
2223
23### `dirs`
24- Type: `struct<ID, []const u8>`
25A comptime-known string array of the package directories for each dependency relative to the project root.
26
2724### `package_data`
2825- Type: `struct<ID, Package>`
2926This is a meta struct that associates ID's to their relavant `Package` definition.
src/cmd/fetch.zig+3
......@@ -67,6 +67,7 @@ pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayLis
6767 \\}
6868 \\
6969 \\pub const Package = struct {
70 \\ directory: string,
7071 \\ pkg: ?Pkg = null,
7172 \\ c_include_dirs: []const string = &.{},
7273 \\ c_source_files: []const string = &.{},
......@@ -152,9 +153,11 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(u.Module), d
152153 if (contains_all(mod.deps, done.items)) {
153154 try w.print(
154155 \\ pub const _{s} = Package{{
156 \\ .directory = dirs._{s},
155157 \\
156158 , .{
157159 mod.short_id(),
160 mod.short_id(),
158161 });
159162 if (mod.main.len > 0 and !std.mem.eql(u8, mod.id, "root")) {
160163 try w.print(