2022-09-09 14:08:57 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, openssl, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "stunnel";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "5.65";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.stunnel.org/downloads/${pname}-${version}.tar.gz";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "60c500063bd1feff2877f5726e38278c086f96c178f03f09d264a2012d6bf7fc";
|
|
|
|
# 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`
|
|
|
|
};
|
2022-09-09 14:08:57 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes compilation on darwin, patch is from
|
|
|
|
# https://github.com/mtrojnar/stunnel/pull/15.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "stunnel_darwin_environ.patch";
|
|
|
|
url = "https://github.com/mtrojnar/stunnel/commit/d41932f6d55f639cc921007c2e180a55ef88bf00.patch";
|
|
|
|
sha256 = "sha256-d2K/BHE6GxvDCBIbttCHEVwH9SCu0jggNvhVHkC/qto=";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
configureFlags = [
|
|
|
|
"--with-ssl=${openssl.dev}"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
];
|
|
|
|
|
|
|
|
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";
|
|
|
|
homepage = "https://www.stunnel.org/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = [ lib.maintainers.thoughtpolice ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|