2023-08-06 17:29:32 +00:00
|
|
|
{
|
|
|
|
fetchurl
|
|
|
|
, lib
|
2023-02-02 16:11:23 +00:00
|
|
|
, nixosTests
|
2023-08-06 17:29:32 +00:00
|
|
|
, openssl
|
|
|
|
, stdenv
|
|
|
|
, systemd
|
|
|
|
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
|
2024-11-02 15:28:10 +00:00
|
|
|
, mimalloc
|
|
|
|
, mimallocSupport ? false
|
2023-02-02 16:11:23 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-06 17:29:32 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "stunnel";
|
2024-10-14 04:06:48 +00:00
|
|
|
version = "5.73";
|
2014-04-08 21:13:08 +00:00
|
|
|
|
2023-02-02 16:15:41 +00:00
|
|
|
outputs = [ "out" "doc" "man" ];
|
|
|
|
|
2009-03-02 15:23:52 +00:00
|
|
|
src = fetchurl {
|
2023-08-06 17:29:32 +00:00
|
|
|
url = "https://www.stunnel.org/archive/${lib.versions.major finalAttrs.version}.x/stunnel-${finalAttrs.version}.tar.gz";
|
2024-10-14 04:06:48 +00:00
|
|
|
hash = "sha256-vJF8O82UOk1jI2DAZ5d6MeheOF9fSEX2l0m86IGDyzg=";
|
2022-07-30 16:25:22 +00:00
|
|
|
# please use the contents of "https://www.stunnel.org/downloads/stunnel-${version}.tar.gz.sha256",
|
2018-02-01 00:00:00 +00:00
|
|
|
# not the output of `nix-prefetch-url`
|
2009-03-02 15:23:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 16:15:41 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-02-02 16:11:23 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals systemdSupport [
|
|
|
|
systemd
|
2024-11-02 15:28:10 +00:00
|
|
|
] ++ lib.optionals mimallocSupport [
|
|
|
|
mimalloc
|
2023-02-02 16:11:23 +00:00
|
|
|
];
|
|
|
|
|
2015-04-22 21:47:09 +00:00
|
|
|
configureFlags = [
|
2016-04-16 17:44:32 +00:00
|
|
|
"--with-ssl=${openssl.dev}"
|
2015-04-22 21:47:09 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2023-02-02 16:11:23 +00:00
|
|
|
(lib.enableFeature systemdSupport "systemd")
|
2015-04-22 21:47:09 +00:00
|
|
|
];
|
|
|
|
|
2018-12-14 08:19:39 +00:00
|
|
|
postInstall = ''
|
|
|
|
# remove legacy compatibility-wrapper that would require perl
|
|
|
|
rm $out/bin/stunnel3
|
|
|
|
'';
|
|
|
|
|
2015-04-22 21:47:09 +00:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=\${out}/etc"
|
|
|
|
"localstatedir=\${TMPDIR}"
|
|
|
|
];
|
2013-05-30 10:11:13 +00:00
|
|
|
|
2022-02-22 22:08:43 +00:00
|
|
|
passthru.tests = {
|
|
|
|
stunnel = nixosTests.stunnel;
|
|
|
|
};
|
|
|
|
|
2009-03-02 15:23:52 +00:00
|
|
|
meta = {
|
2016-06-20 10:53:46 +00:00
|
|
|
description = "Universal tls/ssl wrapper";
|
2023-08-06 17:29:32 +00:00
|
|
|
homepage = "https://www.stunnel.org/";
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-01-15 09:19:50 +00:00
|
|
|
maintainers = [ lib.maintainers.thoughtpolice ];
|
2023-08-06 17:29:32 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2024-02-11 02:19:15 +00:00
|
|
|
mainProgram = "stunnel";
|
2009-03-02 15:23:52 +00:00
|
|
|
};
|
2023-08-06 17:29:32 +00:00
|
|
|
})
|