3
0
Fork 0
forked from mirrors/nixpkgs

stunnel: fix compilation on darwin

stunnel 5.65 has a build error on darwin: `client.c:1514:11: error: use
of undeclared identifier 'environ'`. I think darwin is unique in that it
has unistd but doesn't define `environ`. I tested the resulting binary
for my stunnel use-case and it works on x86-darwin.

Introduced in:
f6d7bf0315

Failing build: https://hydra.nixos.org/build/187400018
This commit is contained in:
Sheldon Neuberger 2022-08-27 22:01:23 -07:00
parent 089d863077
commit 446e0752e9

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, openssl, nixosTests }:
{ lib, stdenv, fetchurl, fetchpatch, openssl, nixosTests }:
stdenv.mkDerivation rec {
pname = "stunnel";
@ -10,6 +10,15 @@ stdenv.mkDerivation rec {
# please use the contents of "https://www.stunnel.org/downloads/stunnel-${version}.tar.gz.sha256",
# not the output of `nix-prefetch-url`
};
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=";
})
];
buildInputs = [ openssl ];
configureFlags = [