diff --git a/build.zig b/build.zig index 6f45198..678726c 100644 --- a/build.zig +++ b/build.zig @@ -7,7 +7,7 @@ pub fn build(b: *std.Build) !void { const force_build_rust = b.option(bool, "build-rust", "Always build Rust library from source") orelse false; // --- Rust C ABI & Pre-built via temporal-rs subpackage --- // - const temporal = b.dependency("temporal", .{ + const libtemporal = b.dependency("libtemporal", .{ .target = target, .optimize = optimize, .@"build-rust" = force_build_rust, @@ -19,7 +19,7 @@ pub fn build(b: *std.Build) !void { .target = target, .optimize = optimize, }); - mod.addImport("temporal_rs", temporal.module("temporal_rs")); + mod.addImport("libtemporal", libtemporal.module("libtemporal")); // --- Zig Executable: temporalz --- // const exe = b.addExecutable(.{ diff --git a/build.zig.zon b/build.zig.zon index f1efea0..4ff7e8b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -4,8 +4,8 @@ .fingerprint = 0xd8d79d59acc4faae, .minimum_zig_version = "0.17.0-dev.1398+cb5635714", .dependencies = .{ - .temporal = .{ - .path = "pkg/temporal", + .libtemporal = .{ + .path = "lib", }, }, .paths = .{ @@ -14,6 +14,6 @@ "README.md", "LICENCE", "src", - "pkg", + "lib", }, } diff --git a/example/build.zig.zon b/example/build.zig.zon index ba1bcdf..e269b0c 100644 --- a/example/build.zig.zon +++ b/example/build.zig.zon @@ -2,7 +2,6 @@ .name = .temporalz_example, .version = "0.1.2", .fingerprint = 0x686c9dfc777f9593, - .minimum_zig_version = "0.17.0-dev.1398+cb5635714", .dependencies = .{ .temporalz = .{ .path = "../", diff --git a/pkg/temporal/Cargo.lock b/lib/Cargo.lock similarity index 100% rename from pkg/temporal/Cargo.lock rename to lib/Cargo.lock diff --git a/pkg/temporal/Cargo.toml b/lib/Cargo.toml similarity index 100% rename from pkg/temporal/Cargo.toml rename to lib/Cargo.toml diff --git a/pkg/temporal/build.zig b/lib/build.zig similarity index 96% rename from pkg/temporal/build.zig rename to lib/build.zig index 25d26f2..68323a3 100644 --- a/pkg/temporal/build.zig +++ b/lib/build.zig @@ -25,7 +25,7 @@ pub fn build(b: *std.Build) !void { var selected_lib_file: std.Build.LazyPath = undefined; if (!force_build_rust) { - const libtemporal_dep = b.lazyDependency("libtemporal", .{}); + const libtemporal_dep = b.lazyDependency("prebuilt_libtemporal", .{}); if (libtemporal_dep) |dep| { const lib_file_candidate = dep.path(prebuilt_lib_path); if (dep.builder.root.access(b.graph.io, prebuilt_lib_path, .{})) { @@ -59,7 +59,7 @@ pub fn build(b: *std.Build) !void { b.getInstallStep().dependOn(&install_lib.step); // --- Zig Module --- // - const mod = b.addModule("temporal_rs", .{ + const mod = b.addModule("libtemporal", .{ .root_source_file = b.path("src/root.zig"), .target = target, .optimize = optimize, diff --git a/pkg/temporal/build.zig.zon b/lib/build.zig.zon similarity index 85% rename from pkg/temporal/build.zig.zon rename to lib/build.zig.zon index 0705c27..ed73017 100644 --- a/pkg/temporal/build.zig.zon +++ b/lib/build.zig.zon @@ -1,14 +1,13 @@ .{ - .name = .temporal, + .name = .libtemporal, .version = "0.2.0", - .fingerprint = 0xd5dcf3f41df6b117, - .minimum_zig_version = "0.17.0-dev.1398+cb5635714", + .fingerprint = 0xded01f16f20c2a64, .dependencies = .{ .temporal_rs = .{ .url = "git+https://github.com/boa-dev/temporal?ref=v0.2.3#c003cc92325e19b26f8ee2f85e4a47d98cbcc781", .hash = "N-V-__8AAPLKOQDfJ5TYhiiy_6a_dZqUmo9K4e8Xhjfup3fd", }, - .libtemporal = .{ + .prebuilt_libtemporal = .{ .url = "https://github.com/nurulhudaapon/temporalz/releases/download/v0.2.3/libtemporal.tar.gz", .hash = "N-V-__8AADYZ_AXnqpmkTa49ZQ6lEQlDXWRLthyxEbgse3Hi", .lazy = true, diff --git a/pkg/temporal/src/lib.h b/lib/src/lib.h similarity index 100% rename from pkg/temporal/src/lib.h rename to lib/src/lib.h diff --git a/pkg/temporal/src/lib.rs b/lib/src/lib.rs similarity index 100% rename from pkg/temporal/src/lib.rs rename to lib/src/lib.rs diff --git a/pkg/temporal/src/root.zig b/lib/src/root.zig similarity index 100% rename from pkg/temporal/src/root.zig rename to lib/src/root.zig diff --git a/pkg/temporal/src/stubs/c_headers/assert.h b/lib/src/stubs/c_headers/assert.h similarity index 100% rename from pkg/temporal/src/stubs/c_headers/assert.h rename to lib/src/stubs/c_headers/assert.h diff --git a/pkg/temporal/src/stubs/c_headers/stdbool.h b/lib/src/stubs/c_headers/stdbool.h similarity index 100% rename from pkg/temporal/src/stubs/c_headers/stdbool.h rename to lib/src/stubs/c_headers/stdbool.h diff --git a/pkg/temporal/src/stubs/c_headers/stddef.h b/lib/src/stubs/c_headers/stddef.h similarity index 100% rename from pkg/temporal/src/stubs/c_headers/stddef.h rename to lib/src/stubs/c_headers/stddef.h diff --git a/pkg/temporal/src/stubs/c_headers/stdint.h b/lib/src/stubs/c_headers/stdint.h similarity index 100% rename from pkg/temporal/src/stubs/c_headers/stdint.h rename to lib/src/stubs/c_headers/stdint.h diff --git a/pkg/temporal/src/stubs/c_headers/stdio.h b/lib/src/stubs/c_headers/stdio.h similarity index 100% rename from pkg/temporal/src/stubs/c_headers/stdio.h rename to lib/src/stubs/c_headers/stdio.h diff --git a/pkg/temporal/src/stubs/unwind.zig b/lib/src/stubs/unwind.zig similarity index 100% rename from pkg/temporal/src/stubs/unwind.zig rename to lib/src/stubs/unwind.zig diff --git a/src/abi.zig b/src/abi.zig index a32505b..40e7aba 100644 --- a/src/abi.zig +++ b/src/abi.zig @@ -1,6 +1,6 @@ const std = @import("std"); -pub const c = @import("temporal_rs").c; +pub const c = @import("libtemporal").c; pub const to_string_rounding_options_auto: c.ToStringRoundingOptions = .{ .precision = .{ .is_minute = false, .precision = toOption(c.OptionU8, null) },