Compare commits

..

17 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
7aa9871c8c readme: update references to 4.0.0
Some checks failed
CI / build (-Dbuild-apps, true, ubuntu-latest, master) (push) Has been cancelled
CI / build (macos-latest, 0.13.0) (push) Has been cancelled
CI / build (ubuntu-latest, 0.12.1) (push) Has been cancelled
CI / build (ubuntu-latest, 0.13.0) (push) Has been cancelled
CI / build (windows-latest, 0.13.0) (push) Has been cancelled
2024-12-05 22:42:42 -07:00
991d09a09e build: update to libressl-portable v4.0.0 2024-12-05 22:42:42 -07:00
9530f3d561 ci: remove --ast-check from zig format
This works around ziglang/zig#22078 (the ast-check behavior changed
since the last successful CI run). Since we build as part of the job,
this check isn't really necessary anyway, though it certainly is
lighter-weight than trying to compile.
2024-11-26 22:39:23 -07:00
d9d586555e ci: run against all branches 2024-11-24 18:51:26 -07:00
02abfefee4 package: bump version
Some checks failed
CI / build (-Dbuild-apps, true, ubuntu-latest, master) (push) Has been cancelled
CI / build (macos-latest, 0.13.0) (push) Has been cancelled
CI / build (ubuntu-latest, 0.12.1) (push) Has been cancelled
CI / build (ubuntu-latest, 0.13.0) (push) Has been cancelled
CI / build (windows-latest, 0.13.0) (push) Has been cancelled
2024-10-03 16:24:22 -07:00
Antoine
5ba009c755 Fix unfortunate typo 2024-10-03 16:31:34 +02:00
a373b82991 readme: clarify status of building apps
Some checks failed
CI / build (-Dbuild-apps, true, ubuntu-latest, master) (push) Has been cancelled
CI / build (macos-latest, 0.13.0) (push) Has been cancelled
CI / build (ubuntu-latest, 0.12.1) (push) Has been cancelled
CI / build (ubuntu-latest, 0.13.0) (push) Has been cancelled
CI / build (windows-latest, 0.13.0) (push) Has been cancelled
2024-09-15 17:57:41 -07:00
a9c2b0b825 build: add some support for building the apps
This appears to work when targeting macOS or Linux. Windows definitely
does not work. These are not built by default.
2024-09-15 17:53:04 -07:00
2f5d617aab build: correct usage of OPENSSL_NO_ASM define
Some checks are pending
CI / build (macos-latest, 0.13.0) (push) Waiting to run
CI / build (true, ubuntu-latest, master) (push) Waiting to run
CI / build (ubuntu-latest, 0.12.1) (push) Waiting to run
CI / build (ubuntu-latest, 0.13.0) (push) Waiting to run
CI / build (windows-latest, 0.13.0) (push) Waiting to run
Whoops.
2024-09-15 15:35:43 -07:00
fbd8c18115 readme: add additional information
Some checks are pending
CI / build (macos-latest, 0.13.0) (push) Waiting to run
CI / build (true, ubuntu-latest, master) (push) Waiting to run
CI / build (ubuntu-latest, 0.12.1) (push) Waiting to run
CI / build (ubuntu-latest, 0.13.0) (push) Waiting to run
CI / build (windows-latest, 0.13.0) (push) Waiting to run
2024-09-15 12:43:52 -07:00
ea53b8380f build with zig master also
Some checks are pending
CI / build (macos-latest, 0.13.0) (push) Waiting to run
CI / build (true, ubuntu-latest, master) (push) Waiting to run
CI / build (ubuntu-latest, 0.12.1) (push) Waiting to run
CI / build (ubuntu-latest, 0.13.0) (push) Waiting to run
CI / build (windows-latest, 0.13.0) (push) Waiting to run
`aarch64_32` has ceased to exist. Actually, I'm not sure it should have
been used on this switch prong anyway.
2024-09-14 17:57:31 -07:00
48b7e2e95d integrate, continuously 2024-09-14 17:57:31 -07:00
5 changed files with 474 additions and 291 deletions

View File

@@ -2,8 +2,6 @@ name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
@@ -14,25 +12,30 @@ jobs:
strategy:
fail-fast: false
matrix:
zig-version: [master]
os: [ubuntu-latest, macos-latest, windows-latest]
zig-version: ["0.14.1"]
os: [macos-latest, windows-latest]
include:
- zig-version: "0.12.1"
- zig-version: "0.14.1"
check-format: true
os: ubuntu-latest
- zig-version: "0.13.0"
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 }}
- name: Check Formatting
- if: ${{ matrix.check-format }}
name: Check Formatting
run: zig fmt --ast-check --check .
- name: Build
run: zig build --summary all
run: zig build ${{ matrix.build-options }} --summary all

2
.gitignore vendored Normal file
View File

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

696
build.zig

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,12 @@
.{
.name = "libressl",
.version = "3.9.2",
.minimum_zig_version = "0.12.0",
.name = .libressl,
.fingerprint = 0x203FA82BE0954AFA,
.version = "4.0.0",
.minimum_zig_version = "0.14.0",
.dependencies = .{
.libressl = .{
.url = "https://github.com/libressl/portable/releases/download/v3.9.2/libressl-3.9.2.tar.gz",
.hash = "1220713b293eab87698edf5d6b9bbacf6c17684e65c42da2ad00da6e7e9cf1df5517",
.url = "https://github.com/libressl/portable/releases/download/v4.0.0/libressl-4.0.0.tar.gz",
.hash = "N-V-__8AAGvDTQHGV38aqRN9PCALgEg4_XExU4juxdTJMTVQ",
},
},
.paths = .{
@@ -13,6 +14,6 @@
"build.zig.zon",
"LICENSE",
"LICENSE-LIBRESSL",
"README.md",
"readme.md",
},
}

View File

@@ -2,22 +2,45 @@
This is [LibreSSL Portable](https://github.com/libressl/portable), packaged for [Zig](https://ziglang.org/).
## Installation
## Status
This project currently builds the three main LibreSSL libraries as static libraries:
- `libcrypto`: core cryptographic routines
- `libssl`: OpenSSL 1.1 compatibility layer
- `libtls`: LibreSSL's new cryptography API
Operating systems and hardware architectures are supported on a best-effort basis, and patches to add additional OS/arch support are welcome. Building for Linux (`x86_64`), macOS (`aarch64`), and Windows (`x86_64` via `mingw64`) is directly tested by CI.
The command-line programs `nc`, `ocspcheck`, and `openssl` are not built by default, and building them when targeting Windows is not supported. Building the command-line programs may be enabled by specifing the `-Dbuild-apps` option to `zig build`
## Usage
First, update your `build.zig.zon`:
```
```sh
# Initialize a `zig build` project if you haven't already
zig init
zig fetch --save <PLACEHOLDER>
# replace <refname> with the version you want to use, e.g. 4.0.0
zig fetch --save git+https://github.com/allyourcodebase/libressl#<refname>
```
You can then import `libressl` in your `build.zig` with:
You can then use `libressl` in your `build.zig` as follows:
```zig
const libressl_dependency = b.dependency("libressl", .{
.target = target,
.optimize = optimize,
.@"enable-asm" = true, // enable assembly routines on supported platforms
});
your_exe.linkLibrary(libressl_dependency.artifact("tls"));
your_exe.linkLibrary(libressl_dependency.artifact("tls")); // or "ssl", or "crypto"
```
## Zig Version Support Matrix
| 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` | ❌ | ❌ | ✅ | ✅ |