summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2018-01-03 21:47:29 -0800
committerJohn Wiegley <johnw@newartisans.com>2018-01-03 21:48:06 -0800
commit426c513c14c10feac6a6afb1a810f74d8a16ed6e (patch)
treec77de54a318becdbebad015d7dfbd7cc94957c73
parentccb0ba56ef190205a39d59743ef7bd6936da43a0 (diff)
downloadnixpkgs-426c513c14c10feac6a6afb1a810f74d8a16ed6e.tar
nixpkgs-426c513c14c10feac6a6afb1a810f74d8a16ed6e.tar.gz
nixpkgs-426c513c14c10feac6a6afb1a810f74d8a16ed6e.tar.bz2
nixpkgs-426c513c14c10feac6a6afb1a810f74d8a16ed6e.tar.lz
nixpkgs-426c513c14c10feac6a6afb1a810f74d8a16ed6e.tar.xz
nixpkgs-426c513c14c10feac6a6afb1a810f74d8a16ed6e.tar.zst
nixpkgs-426c513c14c10feac6a6afb1a810f74d8a16ed6e.zip
apg: Permit building again on Darwin
-rw-r--r--pkgs/tools/security/apg/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/tools/security/apg/default.nix b/pkgs/tools/security/apg/default.nix
index 24d88517b6a..04b29bcf8f7 100644
--- a/pkgs/tools/security/apg/default.nix
+++ b/pkgs/tools/security/apg/default.nix
@@ -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 = ''