git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #58961 from timokau/nauty-features

nauty: disable cpu feature detection

commit6662fbc822fed290922238819b658ea70cf27317 authorTimo Kaufmann <timokau@zoho.com> dateFri 5 Apr 2019, 13:12 (8 years ago) parente1294047f22a42
1 file changed+17−6
pkgs/applications/science/math/nauty/default.nix+17−6
pkgs/applications/science/math/nauty/default.nix+17−6
@@ -1,4 +1,8 @@
1−{stdenv, fetchurl}:
1+{ stdenv
2+, lib
3+, fetchurl
4+, optimize ? false # impure
5+}:
26stdenv.mkDerivation rec {
37 name = "nauty-${version}";
48 version = "26r11";
@@ -7,6 +11,13 @@ stdenv.mkDerivation rec {
711 sha256 = "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y";
812 };
913 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+ ];
1021 buildInputs = [];
1122 installPhase = ''
1223 mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty}
@@ -14,18 +25,18 @@ stdenv.mkDerivation rec {
1425 find . -type f -perm -111 \! -name '*.*' \! -name configure -exec cp '{}' "$out/bin" \;
1526 cp [Rr][Ee][Aa][Dd]* COPYRIGHT This* [Cc]hange* "$out/share/doc/nauty"
1627
17− cp *.h $dev/include/nauty
28+ cp *.h "$dev/include/nauty"
1829 for i in *.a; do
1930 cp "$i" "$dev/lib/lib$i";
2031 done
2132 '';
2233 checkTarget = "checks";
23− meta = {
34+ meta = with lib; {
2435 inherit version;
2536 description = ''Programs for computing automorphism groups of graphs and digraphs'';
26− license = stdenv.lib.licenses.asl20;
27− maintainers = [stdenv.lib.maintainers.raskin];
28− platforms = stdenv.lib.platforms.linux;
37+ license = licenses.asl20;
38+ maintainers = with maintainers; [ raskin timokau ];
39+ platforms = platforms.linux;
2940 homepage = http://pallini.di.uniroma1.it/;
3041 };
3142}