summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2018-08-18 13:37:48 +0200
committerTimo Kaufmann <timokau@zoho.com>2018-08-18 13:37:48 +0200
commit73aaad493636a9e740051efb553c3fbf86c034e8 (patch)
treefe4e5c2ab6aa03fa42c98ef33a247a30c74df60f /pkgs/development
parent6f8fe25ccfb138d716d3b1c0cea25e6f11208d45 (diff)
downloadnixpkgs-73aaad493636a9e740051efb553c3fbf86c034e8.tar
nixpkgs-73aaad493636a9e740051efb553c3fbf86c034e8.tar.gz
nixpkgs-73aaad493636a9e740051efb553c3fbf86c034e8.tar.bz2
nixpkgs-73aaad493636a9e740051efb553c3fbf86c034e8.tar.lz
nixpkgs-73aaad493636a9e740051efb553c3fbf86c034e8.tar.xz
nixpkgs-73aaad493636a9e740051efb553c3fbf86c034e8.tar.zst
nixpkgs-73aaad493636a9e740051efb553c3fbf86c034e8.zip
gf2x: disable hardware-specific code
This was causing "Illegal instruction" issues in the ntl testsuite when
it was executed on a different cpu than the one gf2x was built on
(43679).
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/gf2x/default.nix24
1 files changed, 19 insertions, 5 deletions
diff --git a/pkgs/development/libraries/gf2x/default.nix b/pkgs/development/libraries/gf2x/default.nix
index 8c2e29231dc..a00e07376c7 100644
--- a/pkgs/development/libraries/gf2x/default.nix
+++ b/pkgs/development/libraries/gf2x/default.nix
@@ -1,19 +1,33 @@
-{stdenv, fetchurl}:
+{ stdenv
+, lib
+, fetchurl
+, optimize ? false # impure hardware optimizations
+}:
 stdenv.mkDerivation rec {
   name = "gf2x-${version}";
-  version = "1.2";
+  version = "1.2"; # remember to also update the url
 
   src = fetchurl {
     # find link to latest version (with file id) here: https://gforge.inria.fr/projects/gf2x/
-    url = "https://gforge.inria.fr/frs/download.php/file/36934/gf2x-1.2.tar.gz";
+    # Requested a predictable link:
+    # https://gforge.inria.fr/tracker/index.php?func=detail&aid=21704&group_id=1874&atid=6982
+    url = "https://gforge.inria.fr/frs/download.php/file/36934/gf2x-${version}.tar.gz";
     sha256 = "0d6vh1mxskvv3bxl6byp7gxxw3zzpkldrxnyajhnl05m0gx7yhk1";
   };
 
-  meta = with stdenv.lib; {
+  # no actual checks present yet (as of 1.2), but can't hurt trying
+  # for an indirect test, run ntl's test suite
+  doCheck = true;
+
+  configureFlags = lib.optionals (!optimize) [
+    "--disable-hardware-specific-code"
+  ];
+
+  meta = with lib; {
     description = ''Routines for fast arithmetic in GF(2)[x]'';
     homepage = http://gf2x.gforge.inria.fr;
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ raskin ];
+    maintainers = with maintainers; [ raskin timokau ];
     platforms = platforms.unix;
   };
 }