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 {
name = "apg-2.3.0b";
src = fetchurl {
@ -8,9 +8,14 @@ stdenv.mkDerivation rec {
configurePhase = ''
substituteInPlace Makefile --replace /usr/local "$out"
'';
makeFlags = stdenv.lib.optionals stdenv.isDarwin ["CC=cc"];
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 = {
description = "Tools for random password generation";
longDescription = ''