Compare commits

..

2 Commits

Author SHA1 Message Date
a84b1a3dd8 build with zig master also
Some checks are pending
CI / build (macos-latest, 0.13.0) (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 (ubuntu-latest, master) (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:46:57 -07:00
4acdc01d4e integrate, continuously 2024-09-14 17:46:57 -07:00
5 changed files with 290 additions and 473 deletions

View File

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

2
.gitignore vendored
View File

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

696
build.zig

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -2,45 +2,22 @@
This is [LibreSSL Portable](https://github.com/libressl/portable), packaged for [Zig](https://ziglang.org/).
## 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
## Installation
First, update your `build.zig.zon`:
```sh
```
# Initialize a `zig build` project if you haven't already
zig init
# replace <refname> with the version you want to use, e.g. 4.0.0
zig fetch --save git+https://github.com/allyourcodebase/libressl#<refname>
zig fetch --save <PLACEHOLDER>
```
You can then use `libressl` in your `build.zig` as follows:
You can then import `libressl` in your `build.zig` with:
```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")); // or "ssl", or "crypto"
your_exe.linkLibrary(libressl_dependency.artifact("tls"));
```
## 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` | ❌ | ❌ | ✅ | ✅ |