bozohttpd: experimental darwin compat patch

As far as I can tell, libSystem on darwin provides a libm compatibility
symlink, but not a libcrypt one.

Prior art (eg. CPython) appears to use `stdenv.isDarwin` as a proxy for
`stdenv.hostPlatform.libc == "libSystem"`, but the latter also works in
cases where we're building on Darwin, but with eg. musl for some reason.
This commit is contained in:
embr 2021-05-31 10:53:33 +02:00
parent ee4b583ae8
commit a75c0a7f87

View file

@ -64,7 +64,8 @@ stdenv.mkDerivation rec {
++ optional (!cgiSupport) "-DNO_CGIBIN_SUPPORT"
++ optional (htpasswdSupport) "-DDO_HTPASSWD";
_LDADD = [ "-lcrypt" "-lm" ]
_LDADD = [ "-lm" ]
++ optional (stdenv.hostPlatform.libc != "libSystem") "-lcrypt"
++ optional (luaSupport) "-llua"
++ optionals (sslSupport) [ "-lssl" "-lcrypto" ];
makeFlags = [ "LDADD=$(_LDADD)" "prefix=$(out)" "MANDIR=$(out)/share/man" "BINOWN=" ];