apg: Permit building again on Darwin

This commit is contained in:
John Wiegley 2018-01-03 21:47:29 -08:00
parent ccb0ba56ef
commit 426c513c14

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl }: { stdenv, fetchurl, openssl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "apg-2.3.0b"; name = "apg-2.3.0b";
src = fetchurl { src = fetchurl {
@ -8,9 +8,14 @@ stdenv.mkDerivation rec {
configurePhase = '' configurePhase = ''
substituteInPlace Makefile --replace /usr/local "$out" substituteInPlace Makefile --replace /usr/local "$out"
''; '';
makeFlags = stdenv.lib.optionals stdenv.isDarwin ["CC=cc"];
patches = [ ./apg.patch ]; patches = [ ./apg.patch ];
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
sed -i -e 's|APG_CLIBS += -lcrypt|APG_CLIBS += -L${openssl.out}/lib -lcrypto|' Makefile
'';
meta = { meta = {
description = "Tools for random password generation"; description = "Tools for random password generation";
longDescription = '' longDescription = ''