Skip to content

Commit fabb236

Browse files
committed
update to zig 0.14.0
for realsies this time
1 parent d81b81d commit fabb236

File tree

2 files changed

+53
-35
lines changed

2 files changed

+53
-35
lines changed

build.zig

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ pub fn build(b: *std.Build) !void {
77
const libgit_src = b.dependency("libgit2", .{});
88
const libgit_root = libgit_src.path(".");
99

10-
const lib = b.addStaticLibrary(.{
10+
const lib = b.addLibrary(.{
1111
.name = "git2",
12-
.target = target,
13-
.optimize = optimize,
14-
.link_libc = true,
12+
.linkage = .static,
13+
.root_module = b.createModule(.{
14+
.target = target,
15+
.optimize = optimize,
16+
.link_libc = true,
17+
}),
1518
});
1619

1720
const features = b.addConfigHeader(
@@ -110,11 +113,14 @@ pub fn build(b: *std.Build) !void {
110113

111114
// ntlmclient
112115
{
113-
const ntlm = b.addStaticLibrary(.{
116+
const ntlm = b.addLibrary(.{
114117
.name = "ntlmclient",
115-
.target = target,
116-
.optimize = optimize,
117-
.link_libc = true,
118+
.linkage = .static,
119+
.root_module = b.createModule(.{
120+
.target = target,
121+
.optimize = optimize,
122+
.link_libc = true,
123+
}),
118124
});
119125
ntlm.addIncludePath(libgit_src.path("deps/ntlmclient"));
120126
maybeAddTlsIncludes(ntlm, tls_dep, tls_backend);
@@ -184,11 +190,14 @@ pub fn build(b: *std.Build) !void {
184190

185191
// Bundled dependencies
186192
{
187-
const llhttp = b.addStaticLibrary(.{
193+
const llhttp = b.addLibrary(.{
188194
.name = "llhttp",
189-
.target = target,
190-
.optimize = optimize,
191-
.link_libc = true,
195+
.linkage = .static,
196+
.root_module = b.createModule(.{
197+
.target = target,
198+
.optimize = optimize,
199+
.link_libc = true,
200+
}),
192201
});
193202
llhttp.addIncludePath(libgit_src.path("deps/llhttp"));
194203
llhttp.addCSourceFiles(.{
@@ -202,11 +211,14 @@ pub fn build(b: *std.Build) !void {
202211
features.addValues(.{ .GIT_HTTPPARSER_BUILTIN = 1 });
203212
}
204213
{
205-
const pcre = b.addStaticLibrary(.{
214+
const pcre = b.addLibrary(.{
206215
.name = "pcre",
207-
.target = target,
208-
.optimize = optimize,
209-
.link_libc = true,
216+
.linkage = .static,
217+
.root_module = b.createModule(.{
218+
.target = target,
219+
.optimize = optimize,
220+
.link_libc = true,
221+
}),
210222
});
211223
pcre.root_module.addConfigHeader(b.addConfigHeader(
212224
.{ .style = .{ .cmake = libgit_src.path("deps/pcre/config.h.in") } },
@@ -240,11 +252,14 @@ pub fn build(b: *std.Build) !void {
240252
}
241253
{
242254
// @Todo: support using system zlib?
243-
const zlib = b.addStaticLibrary(.{
255+
const zlib = b.addLibrary(.{
244256
.name = "z",
245-
.target = target,
246-
.optimize = optimize,
247-
.link_libc = true,
257+
.linkage = .static,
258+
.root_module = b.createModule(.{
259+
.target = target,
260+
.optimize = optimize,
261+
.link_libc = true,
262+
}),
248263
});
249264
zlib.addIncludePath(libgit_src.path("deps/zlib"));
250265
zlib.addCSourceFiles(.{
@@ -301,13 +316,14 @@ pub fn build(b: *std.Build) !void {
301316
{
302317
const cli = b.addExecutable(.{
303318
.name = "git2_cli",
304-
.target = target,
305-
.optimize = optimize,
306-
.link_libc = true,
319+
.root_module = b.createModule(.{
320+
.target = target,
321+
.optimize = optimize,
322+
.link_libc = true,
323+
}),
307324
});
308325

309326
cli.addConfigHeader(features);
310-
cli.addIncludePath(libgit_src.path("include"));
311327
cli.addIncludePath(libgit_src.path("src/util"));
312328
cli.addIncludePath(libgit_src.path("src/cli"));
313329
maybeAddTlsIncludes(cli, tls_dep, tls_backend);
@@ -341,9 +357,11 @@ pub fn build(b: *std.Build) !void {
341357
{
342358
const exe = b.addExecutable(.{
343359
.name = "lg2",
344-
.target = target,
345-
.optimize = optimize,
346-
.link_libc = true,
360+
.root_module = b.createModule(.{
361+
.target = target,
362+
.optimize = optimize,
363+
.link_libc = true,
364+
}),
347365
});
348366

349367
exe.addIncludePath(libgit_src.path("examples"));
@@ -356,7 +374,6 @@ pub fn build(b: *std.Build) !void {
356374
},
357375
});
358376

359-
exe.addIncludePath(libgit_src.path("include"));
360377
maybeAddTlsIncludes(exe, tls_dep, tls_backend);
361378
exe.linkLibrary(lib);
362379

@@ -385,7 +402,6 @@ pub fn build(b: *std.Build) !void {
385402
tests.root_module.addOptions("fixture", fixture);
386403

387404
tests.addConfigHeader(features);
388-
tests.addIncludePath(libgit_src.path("include"));
389405
tests.addIncludePath(libgit_src.path("src/util"));
390406
maybeAddTlsIncludes(tests, tls_dep, tls_backend);
391407

build.zig.zon

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
.{
2-
.name = "libgit2",
2+
.name = .libgit2,
33
.version = "1.9.0",
4-
.minimum_zig_version = "0.13.0",
4+
.minimum_zig_version = "0.14.0",
5+
.fingerprint = 0x7f0051374dea2cba,
56
.dependencies = .{
67
.libgit2 = .{
78
.url = "https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.0.tar.gz",
8-
.hash = "1220c7c470d6933d22e96211e85a4d7bab5748bcda3ee5adbc10603b8b1803043987",
9+
.hash = "N-V-__8AAJbmLwHHxHDWkz0i6WIR6FpNe6tXSLzaPuWtvBBg",
910
},
1011
.openssl = .{
1112
.url = "https://github.com/allyourcodebase/openssl/archive/refs/tags/3.3.1-1.tar.gz",
12-
.hash = "12207c40cefa38fe90e4230dfba2e5c76b37e1ee36602512cad8ff0501f892002a65",
13+
.hash = "openssl-3.3.1-1-AAAAACi3ZAB8QM76OP6Q5CMN-6Llx2s34e42YCUSytj_",
1314
.lazy = true,
1415
},
1516
.mbedtls = .{
16-
.url = "https://github.com/allyourcodebase/mbedtls/archive/40a2c1126b45f87d19b256229620bc2995637e5a.tar.gz",
17-
.hash = "122034bd019496a4e20a775116c53ef05e3247e9a98436b3407d4c0503fa3a16cd42",
17+
// @Temporary waiting for patch to be upstreamed (https://github.com/allyourcodebase/mbedtls/pull/2)
18+
.url = "git+https://github.com/Parzival-3141/mbedtls#b9ec01cbaf29e19f8fc3b40e541bd86a6878027f",
19+
.hash = "mbedtls-3.6.2-E4NURzYUAABWLBwHJWx_ppb_j2kDSoGfCfR2rI2zs9dz",
1820
.lazy = true,
1921
},
2022
},

0 commit comments

Comments
 (0)