2023-08-10 07:59:29 +00:00
|
|
|
{
|
|
|
|
fetchurl
|
|
|
|
, lib
|
2023-02-09 11:40:11 +00:00
|
|
|
, nixosTests
|
2023-08-10 07:59:29 +00:00
|
|
|
, openssl
|
|
|
|
, stdenv
|
|
|
|
, systemd
|
|
|
|
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
|
2023-02-09 11:40:11 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "stunnel";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "5.72";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
outputs = [ "out" "doc" "man" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2023-08-10 07:59:29 +00:00
|
|
|
url = "https://www.stunnel.org/archive/${lib.versions.major finalAttrs.version}.x/stunnel-${finalAttrs.version}.tar.gz";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-PVMpQSga41MxlzUUTkrbmuSJoQt+MJxYpIFX8I9C6Uk=";
|
2022-08-12 12:06:08 +00:00
|
|
|
# please use the contents of "https://www.stunnel.org/downloads/stunnel-${version}.tar.gz.sha256",
|
2020-04-24 23:36:52 +00:00
|
|
|
# not the output of `nix-prefetch-url`
|
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals systemdSupport [
|
|
|
|
systemd
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-ssl=${openssl.dev}"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2023-02-09 11:40:11 +00:00
|
|
|
(lib.enableFeature systemdSupport "systemd")
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# remove legacy compatibility-wrapper that would require perl
|
|
|
|
rm $out/bin/stunnel3
|
|
|
|
'';
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=\${out}/etc"
|
|
|
|
"localstatedir=\${TMPDIR}"
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
passthru.tests = {
|
|
|
|
stunnel = nixosTests.stunnel;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Universal tls/ssl wrapper";
|
2023-08-10 07:59:29 +00:00
|
|
|
homepage = "https://www.stunnel.org/";
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = [ lib.maintainers.thoughtpolice ];
|
2023-08-10 07:59:29 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-08-10 07:59:29 +00:00
|
|
|
})
|