anchor.diff:        };
   
         cfg = {
  -        imapSupport = config.php.imap or true;
  +        imapSupport = config.php.imap or (!stdenv.isDarwin);
           ldapSupport = config.php.ldap or true;
           mhashSupport = config.php.mhash or true;
           mysqlSupport = (!php7) && (config.php.mysql or true);
           mysqliSupport = config.php.mysqli or true;
           pdo_mysqlSupport = config.php.pdo_mysql or true;
           libxml2Support = config.php.libxml2 or true;
  -        apxs2Support = config.php.apxs2 or true;
  +        apxs2Support = config.php.apxs2 or (!stdenv.isDarwin);
           bcmathSupport = config.php.bcmath or true;
           socketsSupport = config.php.sockets or true;
           curlSupport = config.php.curl or true;
  
positive.code: 
        patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];
  
      });
  
  in {
  
negative.code:             "LDAP_DIR=${openldap.dev}"
              "LDAP_INCDIR=${openldap.dev}/include"
              "LDAP_LIBDIR=${openldap.out}/lib"
              (lib.optional stdenv.isLinux "--with-ldap-sasl=${cyrus_sasl.dev}")
              ];
            buildInputs = [openldap openssl] ++ lib.optional stdenv.isLinux cyrus_sasl;
          };
  
          mhash = {
  