@@ -1,5 +1,5 @@
11{ stdenv, fetchurl, pkgconfig, gnutls, jansson, liburcu, lmdb, libcap_ng, libidn
2−, systemd, nettle, libedit, zlib, libiconv
2+, systemd, nettle, libedit, zlib, libiconv, fetchpatch
33}:
44
55# Note: ATM only the libraries have been tested in nixpkgs.
@@ -12,6 +12,13 @@ stdenv.mkDerivation rec {
1212 sha256 = "0y9nhp9lfmxv4iy1xg7l4lfxv4168qhag26wwg0dbi0zjpkd790b";
1313 };
1414
15+ patches = stdenv.lib.optional stdenv.isDarwin
16+ (fetchpatch {
17+ name = "before-sierra.diff";
18+ url = "https://gitlab.labs.nic.cz/labs/knot/merge_requests/664.diff";
19+ sha256 = "0g4gm2m3pi0lfpkp53xayf6jq6yn3ifidh40maiy1a46dfadvw6w";
20+ });
21+
1522 outputs = [ "bin" "out" "dev" ];
1623
1724 nativeBuildInputs = [ pkgconfig ];
@@ -27,7 +34,7 @@ stdenv.mkDerivation rec {
2734
2835 enableParallelBuilding = true;
2936
30− CFLAGS = [ "-DNDEBUG" ];
37+ CFLAGS = [ "-O2" "-DNDEBUG" ];
3138
3239 #doCheck = true; problems in combination with dynamic linking
3340