diff --git a/build.zig b/build.zig index 8d28f74..68c8b41 100644 --- a/build.zig +++ b/build.zig @@ -6,20 +6,18 @@ pub fn build(b: *std.Build) !void { const is_wasm_freestanding = target.result.cpu.arch.isWasm() and target.result.os.tag == .freestanding; // --- Rust C ABI & Pre-built via temporal-rs subpackage --- // - const libtemporal_src = b.dependency("libtemporal_src", .{ + const temporal = b.dependency("temporal", .{ .target = target, .optimize = optimize, }); - + // --- Zig Module: temporalz --- // const mod = b.addModule("temporalz", .{ .root_source_file = b.path("src/root.zig"), .target = target, .optimize = optimize, }); - - // Use the comprehensive mod from the package - mod.addImport("temporal_rs", libtemporal_src.module("temporal_rs")); + mod.addImport("temporal_rs", temporal.module("temporal_rs")); // --- Zig Executable: temporalz --- // const exe_root = if (is_wasm_freestanding) diff --git a/build.zig.zon b/build.zig.zon index 1b682a3..43cbe01 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -4,8 +4,8 @@ .fingerprint = 0xd8d79d59acc4faae, .minimum_zig_version = "0.16.0-dev.2860+9c5460316", .dependencies = .{ - .libtemporal_src = .{ - .path = "pkg/temporal-rs", + .temporal = .{ + .path = "pkg/temporal", }, }, .paths = .{ diff --git a/pkg/temporal-rs/Cargo.lock b/pkg/temporal/Cargo.lock similarity index 100% rename from pkg/temporal-rs/Cargo.lock rename to pkg/temporal/Cargo.lock diff --git a/pkg/temporal-rs/Cargo.toml b/pkg/temporal/Cargo.toml similarity index 100% rename from pkg/temporal-rs/Cargo.toml rename to pkg/temporal/Cargo.toml diff --git a/pkg/temporal-rs/build.zig b/pkg/temporal/build.zig similarity index 100% rename from pkg/temporal-rs/build.zig rename to pkg/temporal/build.zig diff --git a/pkg/temporal-rs/build.zig.zon b/pkg/temporal/build.zig.zon similarity index 100% rename from pkg/temporal-rs/build.zig.zon rename to pkg/temporal/build.zig.zon diff --git a/pkg/temporal-rs/src/lib.rs b/pkg/temporal/src/lib.rs similarity index 100% rename from pkg/temporal-rs/src/lib.rs rename to pkg/temporal/src/lib.rs diff --git a/pkg/temporal-rs/src/root.zig b/pkg/temporal/src/root.zig similarity index 100% rename from pkg/temporal-rs/src/root.zig rename to pkg/temporal/src/root.zig diff --git a/pkg/temporal-rs/src/stubs/c_headers/assert.h b/pkg/temporal/src/stubs/c_headers/assert.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/assert.h rename to pkg/temporal/src/stubs/c_headers/assert.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stdbool.h b/pkg/temporal/src/stubs/c_headers/stdbool.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stdbool.h rename to pkg/temporal/src/stubs/c_headers/stdbool.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stddef.h b/pkg/temporal/src/stubs/c_headers/stddef.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stddef.h rename to pkg/temporal/src/stubs/c_headers/stddef.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stdint.h b/pkg/temporal/src/stubs/c_headers/stdint.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stdint.h rename to pkg/temporal/src/stubs/c_headers/stdint.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stdio.h b/pkg/temporal/src/stubs/c_headers/stdio.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stdio.h rename to pkg/temporal/src/stubs/c_headers/stdio.h diff --git a/pkg/temporal-rs/src/stubs/unwind.zig b/pkg/temporal/src/stubs/unwind.zig similarity index 100% rename from pkg/temporal-rs/src/stubs/unwind.zig rename to pkg/temporal/src/stubs/unwind.zig diff --git a/update_zon.js b/update_zon.js deleted file mode 100644 index 5e1c7f0..0000000 --- a/update_zon.js +++ /dev/null @@ -1,15 +0,0 @@ -const fs = require('fs'); - -const app_zon = fs.readFileSync('build.zig.zon', 'utf8'); -function extractDep(name) { - const regex = new RegExp(`\\.${name}\\s*=\\s*\\{([\\s\\S]*?)\\},`); - return app_zon.match(regex)[0]; -} - -const p1 = extractDep('temporal_rs'); -const p2 = extractDep('libtemporal_prebuilt'); - -const pkg_zon = fs.readFileSync('pkg/temporal-rs/build.zig.zon', 'utf8'); -const new_pkg_zon = pkg_zon.replace(' .dependencies = .{', ` .dependencies = .{\n ${p1}\n ${p2}`); - -fs.writeFileSync('pkg/temporal-rs/build.zig.zon', new_pkg_zon);