From 79847af6ccb93df42bd6b91b29ae695b44ad871f Mon Sep 17 00:00:00 2001 From: Jora Troosh Date: Mon, 9 Sep 2024 10:06:30 +0300 Subject: [PATCH] refactor: use git protocol to fetch dependencies --- build.zig | 2 +- build.zig.zon | 6 +++--- src/liza.zig | 2 +- src/templates/exe/build.zig.zon | 4 ++-- src/templates/lib/README.md | 2 +- src/templates/prt/README.md | 2 +- src/templates/prt/build.zig.zon | 6 ++---- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/build.zig b/build.zig index 522d779..df7a7fd 100644 --- a/build.zig +++ b/build.zig @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const root_source_file = b.path("src/main.zig"); - const version = std.SemanticVersion{ .major = 0, .minor = 5, .patch = 0 }; + const version = std.SemanticVersion{ .major = 0, .minor = 6, .patch = 0 }; // Dependencies const clap_dep = b.dependency("clap", .{ diff --git a/build.zig.zon b/build.zig.zon index aedcd6a..0ec078f 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,11 +1,11 @@ .{ .name = "liza", - .version = "0.5.0", + .version = "0.6.0", .minimum_zig_version = "0.13.0", .dependencies = .{ .clap = .{ - .url = "https://github.com/Hejsil/zig-clap/archive/c0193e9.tar.gz", - .hash = "12207ee987ce045596cb992cfb15b0d6d9456e50d4721c3061c69dabc2962053644d", + .url = "git+https://github.com/Hejsil/zig-clap?ref=0.9.1#d71cc39a94f3e6ccbad00c25d350c9147de4df9f", + .hash = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b", }, }, .paths = .{ diff --git a/src/liza.zig b/src/liza.zig index 5665550..1e2e149 100644 --- a/src/liza.zig +++ b/src/liza.zig @@ -47,7 +47,7 @@ const LIB_EXAMPLE1 = @embedFile(TEMPLATES ++ LIB ++ EXAMPLE1 ++ EXE_ROOT); const LIB_EXAMPLE2 = @embedFile(TEMPLATES ++ LIB ++ EXAMPLE2 ++ EXE_ROOT); // Port templates. -const PRT_CI_STEP = "install"; +const PRT_CI_STEP = "lib"; const PRT_README = @embedFile(TEMPLATES ++ PRT ++ README); const PRT_BUILD_ZIG = @embedFile(TEMPLATES ++ PRT ++ BUILD_ZIG); const PRT_BUILD_ZON = @embedFile(TEMPLATES ++ PRT ++ BUILD_ZON); diff --git a/src/templates/exe/build.zig.zon b/src/templates/exe/build.zig.zon index 4404a0a..641088c 100644 --- a/src/templates/exe/build.zig.zon +++ b/src/templates/exe/build.zig.zon @@ -4,8 +4,8 @@ .minimum_zig_version = "0.13.0", .dependencies = .{ .clap = .{ - .url = "https://github.com/Hejsil/zig-clap/archive/c0193e9.tar.gz", - .hash = "12207ee987ce045596cb992cfb15b0d6d9456e50d4721c3061c69dabc2962053644d", + .url = "git+https://github.com/Hejsil/zig-clap?ref=0.9.1#d71cc39a94f3e6ccbad00c25d350c9147de4df9f", + .hash = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b", }, }, .paths = .{ diff --git a/src/templates/lib/README.md b/src/templates/lib/README.md index 1f3b057..1d7021f 100644 --- a/src/templates/lib/README.md +++ b/src/templates/lib/README.md @@ -13,7 +13,7 @@ - Add `?r` dependency to `build.zig.zon`. ```sh -zig fetch --save https://github.com/?u/?r/archive/.tar.gz +zig fetch --save git+https://github.com/?u/?r# ``` - Use `?r` dependency in `build.zig`. diff --git a/src/templates/prt/README.md b/src/templates/prt/README.md index 81c4b7d..f66aa43 100644 --- a/src/templates/prt/README.md +++ b/src/templates/prt/README.md @@ -10,7 +10,7 @@ - Add `?r` dependency to `build.zig.zon`. ```sh -zig fetch --save https://github.com/?u/?r/archive/.tar.gz +zig fetch --save git+https://github.com/?u/?r# ``` - Use `?r` dependency in `build.zig`. diff --git a/src/templates/prt/build.zig.zon b/src/templates/prt/build.zig.zon index 72445e8..9b85ad5 100644 --- a/src/templates/prt/build.zig.zon +++ b/src/templates/prt/build.zig.zon @@ -3,10 +3,8 @@ .version = "?v", .minimum_zig_version = "0.13.0", .dependencies = .{ - .?r = .{ - .url = "https://github.com/?r/?r/archive/v?v.tar.gz", - .hash = "12200000000000000000000000000000000000000000000000000000000000000000", - }, + // Depend on upstream repository by running: + // zig fetch --save git+https://github.com/?r/?r#v?v }, .paths = .{ "src/",