summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2024-02-02 17:59:21 +0200
committerGravatar Uko Kokņevičs2024-02-02 17:59:21 +0200
commitf0161ce3c4e86ea1c309b1db67ca77066bb02779 (patch)
tree90114545912bc706737bfbbfc5b313a03dbdf0d1 /build.zig
parentRelease 0.3.0 (diff)
downloadzup-f0161ce3c4e86ea1c309b1db67ca77066bb02779.tar.gz
zup-f0161ce3c4e86ea1c309b1db67ca77066bb02779.tar.xz
zup-f0161ce3c4e86ea1c309b1db67ca77066bb02779.zip
Update for latest zig
Diffstat (limited to '')
-rw-r--r--build.zig12
-rw-r--r--build.zig.zon13
2 files changed, 12 insertions, 13 deletions
diff --git a/build.zig b/build.zig
index 762eb67..fc642a7 100644
--- a/build.zig
+++ b/build.zig
@@ -24,12 +24,10 @@ pub fn build(b: *Build) void {
24 .target = target, 24 .target = target,
25 .optimize = optimize, 25 .optimize = optimize,
26 }); 26 });
27 exe.addOptions("zup-config", config); 27 exe.root_module.addOptions("zup-config", config);
28 exe.addModule("clap", clap.module("clap")); 28 exe.root_module.addImport("clap", clap.module("clap"));
29 exe.addModule("libarchive", libarchive.module("libarchive")); 29 exe.root_module.addImport("libarchive", libarchive.module("libarchive"));
30 exe.addModule("xdg", xdg.module("xdg")); 30 exe.root_module.addImport("xdg", xdg.module("xdg"));
31 exe.linkLibC();
32 exe.linkSystemLibrary("libarchive");
33 b.installArtifact(exe); 31 b.installArtifact(exe);
34 32
35 const run_cmd = b.addRunArtifact(exe); 33 const run_cmd = b.addRunArtifact(exe);
@@ -55,7 +53,7 @@ const default_version = SemanticVersion.parse("0.2.1") catch unreachable;
55 53
56fn getVersion(b: *Build) SemanticVersion { 54fn getVersion(b: *Build) SemanticVersion {
57 var out_code: u8 = undefined; 55 var out_code: u8 = undefined;
58 const untrimmed = b.execAllowFail( 56 const untrimmed = b.runAllowFail(
59 &.{ "git", "-C", b.build_root.path.?, "describe", "--tags" }, 57 &.{ "git", "-C", b.build_root.path.?, "describe", "--tags" },
60 &out_code, 58 &out_code,
61 .Ignore, 59 .Ignore,
diff --git a/build.zig.zon b/build.zig.zon
index fcd0f82..ba57f52 100644
--- a/build.zig.zon
+++ b/build.zig.zon
@@ -2,18 +2,19 @@
2.{ 2.{
3 .name = "zup", 3 .name = "zup",
4 .version = "0.2.1", 4 .version = "0.2.1",
5 .paths = .{""},
5 .dependencies = .{ 6 .dependencies = .{
6 .clap = .{ 7 .clap = .{
7 .url = "https://github.com/Hejsil/zig-clap/archive/0.7.0.tar.gz", 8 .url = "https://github.com/Hejsil/zig-clap/archive/4267b0b60ef6f87cccf3ee6ed481e6d0759180c6.tar.gz",
8 .hash = "1220f48518ce22882e102255ed3bcdb7aeeb4891f50b2cdd3bd74b5b2e24d3149ba2", 9 .hash = "12202fa30d679d821292bcd953458b9e76097a5d16999489125a206db63a53392833",
9 }, 10 },
10 .libarchive = .{ 11 .libarchive = .{
11 .url = "https://git.sr.ht/~ukko/zig-libarchive/archive/0.2.0.tar.gz", 12 .url = "https://git.sr.ht/~ukko/zig-libarchive/archive/7d3a63d5e05787847e5a199ffdd5bad99e7dbd7a.tar.gz",
12 .hash = "12206a8120d9a7550112f2fcc908c46900d6882c95156f900d5e0b39fcdb6a64a065", 13 .hash = "1220d8262d35559168d67d60797829a36958320556b277cd0e701a34eb00880461ab",
13 }, 14 },
14 .xdg = .{ 15 .xdg = .{
15 .url = "https://git.sr.ht/~ukko/zig-xdg/archive/0.2.1.tar.gz", 16 .url = "https://git.sr.ht/~ukko/zig-xdg/archive/1e925ee081a4880ad895c3976bd6e1d1061a4040.tar.gz",
16 .hash = "122012e83994a01a6faede69260f30bf25d3c7b9c2a6ef5226ce9b3e7ccd13b54898", 17 .hash = "122022d632b2ca6fd959b31748b3a4a7404d391abfae9b297bb3ce29045ae27e5568",
17 }, 18 },
18 }, 19 },
19} 20}