2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
2022-01-23 02:10:13 +00:00
|
|
|
, openssl
|
2021-08-05 21:33:18 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "wolfssl";
|
2022-01-07 04:07:37 +00:00
|
|
|
version = "5.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wolfSSL";
|
|
|
|
repo = "wolfssl";
|
|
|
|
rev = "v${version}-stable";
|
2022-01-07 04:07:37 +00:00
|
|
|
sha256 = "sha256-/noS5cn8lllWoGyZ9QyjRmdiR6LXzfT4lYGEt+0+Bdw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./scripts
|
|
|
|
# ocsp tests require network access
|
|
|
|
sed -i -e '/ocsp\.test/d' -e '/ocsp-stapling\.test/d' scripts/include.am
|
|
|
|
'';
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
# Almost same as Debian but for now using --enable-all --enable-reproducible-build instead of --enable-distro to ensure options.h gets installed
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-all"
|
|
|
|
"--enable-base64encode"
|
|
|
|
"--enable-pkcs11"
|
2021-12-06 16:07:01 +00:00
|
|
|
"--enable-writedup"
|
2021-08-05 21:33:18 +00:00
|
|
|
"--enable-reproducible-build"
|
|
|
|
"--enable-tls13"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
outputs = [
|
|
|
|
"dev"
|
|
|
|
"doc"
|
|
|
|
"lib"
|
|
|
|
"out"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkInputs = [ openssl ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
# fix recursive cycle:
|
|
|
|
# wolfssl-config points to dev, dev propagates bin
|
|
|
|
moveToOutput bin/wolfssl-config "$dev"
|
|
|
|
# moveToOutput also removes "$out" so recreate it
|
|
|
|
mkdir -p "$out"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A small, fast, portable implementation of TLS/SSL for embedded devices";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://www.wolfssl.com/";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.gpl2Plus;
|
2021-08-10 14:31:46 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|