Compare commits

..

5 Commits

Author SHA1 Message Date
Antoine
43595de12d build: support 0.15.0-dev
Some checks failed
CI / build (-Dbuild-apps, true, ubuntu-latest, 0.14.1) (push) Has been cancelled
CI / build (macos-latest, 0.14.1) (push) Has been cancelled
CI / build (ubuntu-latest, master) (push) Has been cancelled
CI / build (windows-latest, 0.14.1) (push) Has been cancelled
addStaticLibrary -> addLibrary
target and optimize are now in a module
2025-07-24 23:11:50 +02:00
45ba485901 ci: re-enable zig fmt ast-check 2025-03-05 21:41:01 -07:00
34751eeb87 readme: reorganize version support table 2025-03-05 21:01:20 -07:00
18d16b2663 build: support 0.14.0
Unfortunately, this has irreconcilable incompatibilities with previous
versions of zig, due to the build.zig.zon schema changes. Support for
older versions has been dropped.
2025-03-05 19:17:31 -07:00
Antoine
fd0fe77715 defineCMacro -> addCMacro 2024-12-31 19:06:00 +01:00
5 changed files with 159 additions and 158 deletions

View File

@@ -12,28 +12,30 @@ jobs:
strategy:
fail-fast: false
matrix:
zig-version: ["0.13.0"]
os: [ubuntu-latest, macos-latest, windows-latest]
zig-version: ["0.14.1"]
os: [macos-latest, windows-latest]
include:
- zig-version: "0.12.1"
os: ubuntu-latest
- zig-version: "master"
- zig-version: "0.14.1"
check-format: true
os: ubuntu-latest
build-options: "-Dbuild-apps"
- zig-version: "master"
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v1
uses: mlugg/setup-zig@v2
with:
version: ${{ matrix.zig-version }}
- if: ${{ matrix.check-format }}
name: Check Formatting
run: zig fmt --check .
run: zig fmt --ast-check --check .
- name: Build
run: zig build ${{ matrix.build-options }} --summary all

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.zig-cache
zig-out

282
build.zig
View File

@@ -11,36 +11,30 @@ pub fn build(b: *std.Build) !void {
const upstream = b.dependency("libressl", .{});
const libressl_common: LibreSslCommon = .{
.libcrypto = b.addStaticLibrary(.{
.libcrypto = b.addLibrary(.{
.name = "crypto",
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
}),
.libssl = b.addStaticLibrary(.{
.libssl = b.addLibrary(.{
.name = "ssl",
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
}),
.libtls = b.addStaticLibrary(.{
.libtls = b.addLibrary(.{
.name = "tls",
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
}),
.apps = .{
.nc = b.addExecutable(.{
.name = "nc",
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
}),
.ocspcheck = b.addExecutable(.{
.name = "ocspcheck",
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
}),
.openssl = b.addExecutable(.{
.name = "openssl",
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{ .target = target, .optimize = optimize }),
}),
},
};
@@ -114,21 +108,21 @@ pub fn build(b: *std.Build) !void {
.flags = cflags,
});
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null);
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT5", null);
libressl_common.libcrypto.defineCMacro("MD5_ASM", null);
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
libressl_common.libcrypto.defineCMacro("RSA_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
libressl_common.libcrypto.defineCMacro("HAVE_GNU_STACK", null);
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT5", "");
libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
libressl_common.libcrypto.root_module.addCMacro("HAVE_GNU_STACK", "");
} else if (tinfo.cpu.arch == .arm) {
libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot,
@@ -141,55 +135,55 @@ pub fn build(b: *std.Build) !void {
.flags = cflags,
});
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null);
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
} else {
build_asm = false;
}
} else if (tinfo.isDarwin() and tinfo.cpu.arch == .x86_64) {
} else if (tinfo.os.tag.isDarwin() and tinfo.cpu.arch == .x86_64) {
libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot,
.files = libcrypto_macos_x86_64_asm,
.flags = cflags,
});
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null);
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_BN_ASM_MONT5", null);
libressl_common.libcrypto.defineCMacro("MD5_ASM", null);
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
libressl_common.libcrypto.defineCMacro("RSA_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_BN_ASM_MONT5", "");
libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
} else if (tinfo.os.tag == .windows and tinfo.abi == .gnu) {
libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot,
.files = libcrypto_mingw64_x86_64_asm,
.flags = cflags,
});
libressl_common.libcrypto.defineCMacro("AES_ASM", null);
libressl_common.libcrypto.defineCMacro("BSAES_ASM", null);
libressl_common.libcrypto.defineCMacro("VPAES_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_IA32_SSE2", null);
libressl_common.libcrypto.defineCMacro("MD5_ASM", null);
libressl_common.libcrypto.defineCMacro("GHASH_ASM", null);
libressl_common.libcrypto.defineCMacro("RSA_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA1_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA256_ASM", null);
libressl_common.libcrypto.defineCMacro("SHA512_ASM", null);
libressl_common.libcrypto.defineCMacro("WHIRLPOOL_ASM", null);
libressl_common.libcrypto.defineCMacro("OPENSSL_CPUID_OBJ", null);
libressl_common.libcrypto.root_module.addCMacro("AES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("BSAES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("VPAES_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_IA32_SSE2", "");
libressl_common.libcrypto.root_module.addCMacro("MD5_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("GHASH_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("RSA_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA1_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA256_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("SHA512_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("WHIRLPOOL_ASM", "");
libressl_common.libcrypto.root_module.addCMacro("OPENSSL_CPUID_OBJ", "");
} else {
build_asm = false;
}
@@ -205,15 +199,15 @@ pub fn build(b: *std.Build) !void {
.files = libcrypto_nonasm,
.flags = cflags,
});
libressl_common.defineCMacro("OPENSSL_NO_ASM", null);
libressl_common.addCMacro("OPENSSL_NO_ASM", "");
}
libressl_common.defineCMacro("OPENSSLDIR", std.fmt.allocPrint(b.allocator, "\"{s}\"", .{resolved_openssl_dir}) catch @panic("OOM"));
libressl_common.defineCMacro("LIBRESSL_INTERNAL", null);
libressl_common.defineCMacro("OPENSSL_NO_HW_PADLOCK", null);
libressl_common.defineCMacro("__BEGIN_HIDDEN_DECLS", "");
libressl_common.defineCMacro("__END_HIDDEN_DECLS", "");
libressl_common.defineCMacro("LIBRESSL_CRYPTO_INTERNAL", null);
libressl_common.addCMacro("OPENSSLDIR", std.fmt.allocPrint(b.allocator, "\"{s}\"", .{resolved_openssl_dir}) catch @panic("OOM"));
libressl_common.addCMacro("LIBRESSL_INTERNAL", "");
libressl_common.addCMacro("OPENSSL_NO_HW_PADLOCK", "");
libressl_common.addCMacro("__BEGIN_HIDDEN_DECLS", "");
libressl_common.addCMacro("__END_HIDDEN_DECLS", "");
libressl_common.addCMacro("LIBRESSL_CRYPTO_INTERNAL", "");
switch (tinfo.os.tag) {
.linux => {
@@ -234,28 +228,28 @@ pub fn build(b: *std.Build) !void {
.flags = cflags,
});
libressl_common.defineCMacro("_DEFAULT_SOURCE", null);
libressl_common.defineCMacro("_BSD_SOURCE", null);
libressl_common.defineCMacro("_POSIX_SOURCE", null);
libressl_common.defineCMacro("_GNU_SOURCE", null);
libressl_common.addCMacro("_DEFAULT_SOURCE", "");
libressl_common.addCMacro("_BSD_SOURCE", "");
libressl_common.addCMacro("_POSIX_SOURCE", "");
libressl_common.addCMacro("_GNU_SOURCE", "");
libressl_common.defineCMacro("HAVE_ASPRINTF", null);
libressl_common.addCMacro("HAVE_ASPRINTF", "");
libressl_common.defineCMacro("HAVE_STRCASECMP", null);
libressl_common.addCMacro("HAVE_STRCASECMP", "");
libressl_common.defineCMacro("HAVE_STRNDUP", null);
libressl_common.defineCMacro("HAVE_STRNLEN", null);
libressl_common.defineCMacro("HAVE_STRSEP", null);
libressl_common.addCMacro("HAVE_STRNDUP", "");
libressl_common.addCMacro("HAVE_STRNLEN", "");
libressl_common.addCMacro("HAVE_STRSEP", "");
libressl_common.defineCMacro("HAVE_EXPLICIT_BZERO", null);
libressl_common.defineCMacro("HAVE_GETAUXVAL", null);
libressl_common.defineCMacro("HAVE_GETPAGESIZE", null);
libressl_common.addCMacro("HAVE_EXPLICIT_BZERO", "");
libressl_common.addCMacro("HAVE_GETAUXVAL", "");
libressl_common.addCMacro("HAVE_GETPAGESIZE", "");
libressl_common.defineCMacro("HAVE_SYSLOG", null);
libressl_common.defineCMacro("HAVE_MEMMEM", null);
libressl_common.defineCMacro("HAVE_ENDIAN_H", null);
libressl_common.defineCMacro("HAVE_ERR_H", null);
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null);
libressl_common.addCMacro("HAVE_SYSLOG", "");
libressl_common.addCMacro("HAVE_MEMMEM", "");
libressl_common.addCMacro("HAVE_ENDIAN_H", "");
libressl_common.addCMacro("HAVE_ERR_H", "");
libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
if (tinfo.abi.isGnu()) {
libressl_common.libcrypto.addCSourceFiles(.{
@@ -270,9 +264,9 @@ pub fn build(b: *std.Build) !void {
.flags = cflags,
});
libressl_common.defineCMacro("HAVE_STRLCAT", null);
libressl_common.defineCMacro("HAVE_STRLCPY", null);
libressl_common.defineCMacro("HAVE_GETENTROPY", null);
libressl_common.addCMacro("HAVE_STRLCAT", "");
libressl_common.addCMacro("HAVE_STRLCPY", "");
libressl_common.addCMacro("HAVE_GETENTROPY", "");
} else @panic("weird ABI, dude");
libressl_common.linkSystemLibrary("pthread");
@@ -306,39 +300,39 @@ pub fn build(b: *std.Build) !void {
});
if (tinfo.abi != .msvc) {
libressl_common.defineCMacro("_GNU_SOURCE", null);
libressl_common.defineCMacro("_POSIX", null);
libressl_common.defineCMacro("_POSIX_SOURCE", null);
libressl_common.defineCMacro("__USE_MINGW_ANSI_STDIO", null);
libressl_common.addCMacro("_GNU_SOURCE", "");
libressl_common.addCMacro("_POSIX", "");
libressl_common.addCMacro("_POSIX_SOURCE", "");
libressl_common.addCMacro("__USE_MINGW_ANSI_STDIO", "");
}
libressl_common.defineCMacro("_CRT_SECURE_NO_WARNINGS", null);
libressl_common.defineCMacro("_CRT_DEPRECATED_NO_WARNINGS", null);
libressl_common.defineCMacro("_REENTRANT", null);
libressl_common.defineCMacro("_POSIX_THREAD_SAFE_FUNCTIONS", null);
libressl_common.defineCMacro("CPPFLAGS", null);
libressl_common.defineCMacro("NO_SYSLOG", null);
libressl_common.defineCMacro("NO_CRYPT", null);
libressl_common.defineCMacro("WIN32_LEAN_AND_MEAN", null);
libressl_common.defineCMacroForLibs("_WIN32_WINNT", "0x0600");
libressl_common.addCMacro("_CRT_SECURE_NO_WARNINGS", "");
libressl_common.addCMacro("_CRT_DEPRECATED_NO_WARNINGS", "");
libressl_common.addCMacro("_REENTRANT", "");
libressl_common.addCMacro("_POSIX_THREAD_SAFE_FUNCTIONS", "");
libressl_common.addCMacro("CPPFLAGS", "");
libressl_common.addCMacro("NO_SYSLOG", "");
libressl_common.addCMacro("NO_CRYPT", "");
libressl_common.addCMacro("WIN32_LEAN_AND_MEAN", "");
libressl_common.addCMacroForLibs("_WIN32_WINNT", "0x0600");
libressl_common.defineCMacro("HAVE_ASPRINTF", null);
libressl_common.defineCMacro("HAVE_STRCASECMP", null);
libressl_common.defineCMacro("HAVE_STRNLEN", null);
libressl_common.defineCMacro("HAVE_GETAUXVAL", null);
libressl_common.addCMacro("HAVE_ASPRINTF", "");
libressl_common.addCMacro("HAVE_STRCASECMP", "");
libressl_common.addCMacro("HAVE_STRNLEN", "");
libressl_common.addCMacro("HAVE_GETAUXVAL", "");
libressl_common.defineCMacro("HAVE_TIMESPECSUB", null);
libressl_common.defineCMacro("HAVE_MEMMEM", null);
libressl_common.defineCMacro("HAVE_MACHINE_ENDIAN_H", null);
libressl_common.defineCMacro("HAVE_READPASSPHRASE", null);
libressl_common.defineCMacro("HAVE_ACCEPT4", null);
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null);
libressl_common.addCMacro("HAVE_TIMESPECSUB", "");
libressl_common.addCMacro("HAVE_MEMMEM", "");
libressl_common.addCMacro("HAVE_MACHINE_ENDIAN_H", "");
libressl_common.addCMacro("HAVE_READPASSPHRASE", "");
libressl_common.addCMacro("HAVE_ACCEPT4", "");
libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
libressl_common.linkSystemLibrary("ws2_32");
libressl_common.linkSystemLibrary("bcrypt");
},
else => if (tinfo.isDarwin()) {
else => if (tinfo.os.tag.isDarwin()) {
libressl_common.libcrypto.addCSourceFiles(.{
.root = crypto_srcroot,
.files = libcrypto_unix_sources,
@@ -355,24 +349,24 @@ pub fn build(b: *std.Build) !void {
.flags = cflags,
});
libressl_common.defineCMacro("HAVE_CLOCK_GETTIME", null);
libressl_common.defineCMacro("HAVE_ASPRINTF", null);
libressl_common.defineCMacro("HAVE_STRCASECMP", null);
libressl_common.defineCMacro("HAVE_STRLCAT", null);
libressl_common.defineCMacro("HAVE_STRLCPY", null);
libressl_common.defineCMacro("HAVE_STRNDUP", null);
libressl_common.defineCMacro("HAVE_STRNLEN", null);
libressl_common.defineCMacro("HAVE_STRSEP", null);
libressl_common.defineCMacro("HAVE_STRTONUM", null);
libressl_common.defineCMacro("HAVE_ARC4RANDOM_BUF", null);
libressl_common.defineCMacro("HAVE_ARC4RANDOM_UNIFORM", null);
libressl_common.defineCMacro("HAVE_GETENTROPY", null);
libressl_common.defineCMacro("HAVE_GETPAGESIZE", null);
libressl_common.defineCMacro("HAVE_GETPROGNAME", null);
libressl_common.defineCMacro("HAVE_MEMMEM", null);
libressl_common.defineCMacro("HAVE_MACHINE_ENDIAN_H", null);
libressl_common.defineCMacro("HAVE_ERR_H", null);
libressl_common.defineCMacro("HAVE_NETINET_IP_H", null);
libressl_common.addCMacro("HAVE_CLOCK_GETTIME", "");
libressl_common.addCMacro("HAVE_ASPRINTF", "");
libressl_common.addCMacro("HAVE_STRCASECMP", "");
libressl_common.addCMacro("HAVE_STRLCAT", "");
libressl_common.addCMacro("HAVE_STRLCPY", "");
libressl_common.addCMacro("HAVE_STRNDUP", "");
libressl_common.addCMacro("HAVE_STRNLEN", "");
libressl_common.addCMacro("HAVE_STRSEP", "");
libressl_common.addCMacro("HAVE_STRTONUM", "");
libressl_common.addCMacro("HAVE_ARC4RANDOM_BUF", "");
libressl_common.addCMacro("HAVE_ARC4RANDOM_UNIFORM", "");
libressl_common.addCMacro("HAVE_GETENTROPY", "");
libressl_common.addCMacro("HAVE_GETPAGESIZE", "");
libressl_common.addCMacro("HAVE_GETPROGNAME", "");
libressl_common.addCMacro("HAVE_MEMMEM", "");
libressl_common.addCMacro("HAVE_MACHINE_ENDIAN_H", "");
libressl_common.addCMacro("HAVE_ERR_H", "");
libressl_common.addCMacro("HAVE_NETINET_IP_H", "");
if (tinfo.cpu.arch == .x86_64 and build_asm) {} else {}
} else {
@@ -499,8 +493,8 @@ pub fn build(b: *std.Build) !void {
libressl_common.installLibraries(b);
// weird hack here
libressl_common.apps.nc.defineCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" }));
libressl_common.apps.ocspcheck.defineCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" }));
libressl_common.apps.nc.root_module.addCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" }));
libressl_common.apps.ocspcheck.root_module.addCMacro("DEFAULT_CA_FILE", b.pathJoin(&.{ b.install_prefix, "etc", "ssl", "cert.pem" }));
libressl_common.apps.nc.linkLibrary(libressl_common.libtls);
libressl_common.apps.ocspcheck.linkLibrary(libressl_common.libtls);
libressl_common.apps.openssl.linkLibrary(libressl_common.libssl);
@@ -532,17 +526,17 @@ const LibreSslCommon = struct {
self.libtls.linkSystemLibrary(library);
}
pub fn defineCMacroForLibs(self: LibreSslCommon, name: []const u8, value: ?[]const u8) void {
self.libcrypto.defineCMacro(name, value);
self.libssl.defineCMacro(name, value);
self.libtls.defineCMacro(name, value);
pub fn addCMacroForLibs(self: LibreSslCommon, name: []const u8, value: []const u8) void {
self.libcrypto.root_module.addCMacro(name, value);
self.libssl.root_module.addCMacro(name, value);
self.libtls.root_module.addCMacro(name, value);
}
pub fn defineCMacro(self: LibreSslCommon, name: []const u8, value: ?[]const u8) void {
self.defineCMacroForLibs(name, value);
self.apps.nc.defineCMacro(name, value);
self.apps.ocspcheck.defineCMacro(name, value);
self.apps.openssl.defineCMacro(name, value);
pub fn addCMacro(self: LibreSslCommon, name: []const u8, value: []const u8) void {
self.addCMacroForLibs(name, value);
self.apps.nc.root_module.addCMacro(name, value);
self.apps.ocspcheck.root_module.addCMacro(name, value);
self.apps.openssl.root_module.addCMacro(name, value);
}
pub fn installLibraries(self: LibreSslCommon, b: *std.Build) void {

View File

@@ -1,11 +1,12 @@
.{
.name = "libressl",
.name = .libressl,
.fingerprint = 0x203FA82BE0954AFA,
.version = "4.0.0",
.minimum_zig_version = "0.12.0",
.minimum_zig_version = "0.14.0",
.dependencies = .{
.libressl = .{
.url = "https://github.com/libressl/portable/releases/download/v4.0.0/libressl-4.0.0.tar.gz",
.hash = "1220c6577f1aa9137d3c200b804838fd71315388eec5d4c9313550143d02fe69308b",
.hash = "N-V-__8AAGvDTQHGV38aqRN9PCALgEg4_XExU4juxdTJMTVQ",
},
},
.paths = .{

View File

@@ -38,7 +38,9 @@ your_exe.linkLibrary(libressl_dependency.artifact("tls")); // or "ssl", or "cryp
## Zig Version Support Matrix
| Refname | LibreSSL Version | Zig `0.12.x` | Zig `0.13.x` | Zig `0.14.0-dev` |
|----------|------------------|--------------|--------------|------------------|
| `3.9.2+1`| `3.9.2+1` | ✅ | ✅ | |
| `4.0.0` | `4.0.0` | | ✅ | |
| Refname | LibreSSL Version | Zig `0.15.0-dev` | Zig `0.14.x` | Zig `0.13.x` | Zig `0.12.x` |
|-----------|------------------|------------------|--------------|--------------|--------------|
| `4.0.0+3` | `4.0.0` | ✅ | ✅ | ❌ | ❌ |
| `4.0.0+2` | `4.0.0` | | ✅ | ❌ | ❌ |
| `4.0.0+1` | `4.0.0` | ❌ | ❌ | ✅ | ✅ |
| `3.9.2+1` | `3.9.2` | ❌ | ❌ | ✅ | ✅ |