From 5880c449dde5eafe8d8412694312e11d34f73912 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Thu, 4 Apr 2019 14:48:49 +0200 Subject: [PATCH 1/3] nauty: small refactoring --- pkgs/applications/science/math/nauty/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/science/math/nauty/default.nix b/pkgs/applications/science/math/nauty/default.nix index 5b431f419261..b16ea82a7af3 100644 --- a/pkgs/applications/science/math/nauty/default.nix +++ b/pkgs/applications/science/math/nauty/default.nix @@ -1,4 +1,7 @@ -{stdenv, fetchurl}: +{ stdenv +, lib +, fetchurl +}: stdenv.mkDerivation rec { name = "nauty-${version}"; version = "26r11"; @@ -14,18 +17,18 @@ stdenv.mkDerivation rec { find . -type f -perm -111 \! -name '*.*' \! -name configure -exec cp '{}' "$out/bin" \; cp [Rr][Ee][Aa][Dd]* COPYRIGHT This* [Cc]hange* "$out/share/doc/nauty" - cp *.h $dev/include/nauty + cp *.h "$dev/include/nauty" for i in *.a; do cp "$i" "$dev/lib/lib$i"; done ''; checkTarget = "checks"; - meta = { + meta = with lib; { inherit version; description = ''Programs for computing automorphism groups of graphs and digraphs''; - license = stdenv.lib.licenses.asl20; - maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.linux; + license = licenses.asl20; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; homepage = http://pallini.di.uniroma1.it/; }; } From 15045e6233838c32847cbd60d267070f078e0262 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Thu, 4 Apr 2019 14:54:31 +0200 Subject: [PATCH 2/3] nauty: add timokau as a maintainer I'm interested in this package as a sage dependency. --- pkgs/applications/science/math/nauty/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/nauty/default.nix b/pkgs/applications/science/math/nauty/default.nix index b16ea82a7af3..35c4fdb829b3 100644 --- a/pkgs/applications/science/math/nauty/default.nix +++ b/pkgs/applications/science/math/nauty/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { inherit version; description = ''Programs for computing automorphism groups of graphs and digraphs''; license = licenses.asl20; - maintainers = with maintainers; [ raskin ]; + maintainers = with maintainers; [ raskin timokau ]; platforms = platforms.linux; homepage = http://pallini.di.uniroma1.it/; }; From 7f22a4297638c6d0ea5cfcbe3b83a011d1286c23 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Thu, 4 Apr 2019 14:50:38 +0200 Subject: [PATCH 3/3] nauty: disable cpu feature detection --- pkgs/applications/science/math/nauty/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/applications/science/math/nauty/default.nix b/pkgs/applications/science/math/nauty/default.nix index 35c4fdb829b3..7351de53cfce 100644 --- a/pkgs/applications/science/math/nauty/default.nix +++ b/pkgs/applications/science/math/nauty/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchurl +, optimize ? false # impure }: stdenv.mkDerivation rec { name = "nauty-${version}"; @@ -10,6 +11,13 @@ stdenv.mkDerivation rec { sha256 = "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y"; }; outputs = [ "out" "dev" ]; + configureFlags = lib.optionals (!optimize) [ + # Prevent nauty from sniffing some cpu features. While those are very + # widely available, it can lead to nasty bugs when they are not available: + # https://groups.google.com/forum/#!topic/sage-packaging/Pe4SRDNYlhA + "--disable-popcnt" + "--disable-clz" + ]; buildInputs = []; installPhase = '' mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty}