diff --git a/.gitignore b/.gitignore index 49d1053..304d6cb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ **/.zig-cache/ **/.zig-out/ .idea/ -src/deps/mailbox/.zig-cache/ -src/deps/mailbox/.zig-out/ src/deps/zig-datetime/.zig-cache/ src/deps/zig-datetime/.zig-out/ src/deps/zig-network/.zig-cache/ diff --git a/.gitmodules b/.gitmodules index 93ce087..bddf62e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ -[submodule "src/deps/mailbox"] - path = src/deps/mailbox - url = https://github.com/g41797/mailbox -[submodule "src/deps/zig-datetime"] - path = src/deps/zig-datetime - url = https://github.com/frmdstryr/zig-datetime [submodule "src/deps/zig-network"] path = src/deps/zig-network url = https://github.com/ikskuh/zig-network diff --git a/_notes.txt b/_notes.txt index 3e1581e..b00571f 100644 --- a/_notes.txt +++ b/_notes.txt @@ -381,4 +381,13 @@ Zig loops https://gencmurat.com/en/posts/zig-loops/ Listening ports - sudo netstat --tcp --udp --listening --programs --numeric \ No newline at end of file + sudo netstat --tcp --udp --listening --programs --numeric + +Import + zig fetch --save-exact https://github.com/g41797/mailbox/archive/master.tar.gz + + zig fetch --save=zig-datetime git+https://github.com/frmdstryr/zig-datetime + + + + diff --git a/build.zig b/build.zig index a859ca3..30b8083 100644 --- a/build.zig +++ b/build.zig @@ -20,6 +20,10 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); + const zig_datetime = b.dependency("zig-datetime", .{ + .target = target, + .optimize = optimize, + }); const lib = b.addStaticLibrary(.{ .name = "syslog", @@ -30,6 +34,8 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); + lib.root_module.addImport("zig-datetime", zig_datetime.module("zig-datetime")); + // This declares intent for the library to be installed into the standard // location when the user invokes the "install" step (the default step when // running `zig build`). @@ -43,6 +49,7 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); + lib_unit_tests.root_module.addImport("zig-datetime", zig_datetime.module("zig-datetime")); lib_unit_tests.root_module.addImport("mailbox", mailbox.module("mailbox")); const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests); diff --git a/build.zig.zon b/build.zig.zon index db12946..407859c 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -27,6 +27,10 @@ .url = "https://github.com/g41797/mailbox/archive/master.tar.gz", .hash = "12208d8777b69f62cccf70b4372d8c31a22bb022881279713d424689d6555532d389", }, + .@"zig-datetime" = .{ + .url = "git+https://github.com/frmdstryr/zig-datetime#70aebf28fb3e137cd84123a9349d157a74708721", + .hash = "122077215ce36e125a490e59ec1748ffd4f6ba00d4d14f7308978e5360711d72d77f", + }, }, .paths = .{ "build.zig", diff --git a/src/deps/zig-datetime b/src/deps/zig-datetime deleted file mode 160000 index 70aebf2..0000000 --- a/src/deps/zig-datetime +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 70aebf28fb3e137cd84123a9349d157a74708721 diff --git a/src/timestamp.zig b/src/timestamp.zig index c8cd172..c1bc340 100644 --- a/src/timestamp.zig +++ b/src/timestamp.zig @@ -2,8 +2,9 @@ const std = @import("std"); const string = @import("shortstring.zig"); const ShortString = string.ShortString; -pub const datetime = @import("deps/zig-datetime/src/datetime.zig"); -pub const timezones = @import("deps/zig-datetime/src/timezones.zig"); +pub const zig_dt = @import("zig-datetime"); +pub const datetime = zig_dt.datetime; +pub const timezones = zig_dt.timezones; //--------------------------------- // TIMESTAMP = NILVALUE / FULL-DATE "T" FULL-TIME