@@ -1,6 +1,7 @@
11{ stdenv
22, lib
33, fetchurl
4+, optimize ? false # impure
45}:
56stdenv.mkDerivation rec {
67 name = "nauty-${version}";
@@ -10,6 +11,13 @@ stdenv.mkDerivation rec {
1011 sha256 = "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y";
1112 };
1213 outputs = [ "out" "dev" ];
14+ configureFlags = lib.optionals (!optimize) [
15+ # Prevent nauty from sniffing some cpu features. While those are very
16+ # widely available, it can lead to nasty bugs when they are not available:
17+ # https://groups.google.com/forum/#!topic/sage-packaging/Pe4SRDNYlhA
18+ "--disable-popcnt"
19+ "--disable-clz"
20+ ];
1321 buildInputs = [];
1422 installPhase = ''
1523 mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty}