2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-11-04 12:27:35 +00:00
|
|
|
, Security
|
2021-08-05 21:33:18 +00:00
|
|
|
, 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";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "5.5.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wolfSSL";
|
|
|
|
repo = "wolfssl";
|
|
|
|
rev = "v${version}-stable";
|
2023-01-11 07:51:40 +00:00
|
|
|
hash = "sha256-sR/Gjk50kLej5oJzDH1I6/V+7OIRiwtyeg5tEE3fmHk=";
|
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
|
2022-09-22 12:36:57 +00:00
|
|
|
# ensure test detects musl-based systems too
|
|
|
|
substituteInPlace scripts/ocsp-stapling2.test \
|
|
|
|
--replace '"linux-gnu"' '"linux-"'
|
2022-01-23 02:10:13 +00:00
|
|
|
'';
|
|
|
|
|
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
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
propagatedBuildInputs = [ ] ++ lib.optionals stdenv.isDarwin [ Security ];
|
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;
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ openssl ];
|
2022-01-23 02:10:13 +00:00
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|