···
assert withGf2x -> gf2x != null;
16
-
stdenv.mkDerivation rec {
16
+
stdenv.mkDerivation (finalAttrs: {
21
-
url = "http://www.shoup.net/ntl/ntl-${version}.tar.gz";
22
-
sha256 = "sha256-IQ0GwxMGy8bq9oFEU8Vsd22djo3zbXTrMG9qUj0caoo=";
21
+
url = "http://www.shoup.net/ntl/ntl-${finalAttrs.version}.tar.gz";
22
+
hash = "sha256-IQ0GwxMGy8bq9oFEU8Vsd22djo3zbXTrMG9qUj0caoo=";
27
+
perl # needed for ./configure
29
-
nativeBuildInputs = [
30
-
perl # needed for ./configure
33
-
sourceRoot = "${pname}-${version}/src";
33
+
sourceRoot = "ntl-${finalAttrs.version}/src";
enableParallelBuilding = true;
···
configurePlatforms = [ ];
# reference: http://shoup.net/ntl/doc/tour-unix.html
45
+
dontAddStaticConfigureFlags = true; # perl config doesn't understand it.
47
-
"SHARED=on" # genereate a shared library (as well as static)
"NATIVE=off" # don't target code to current hardware (reproducibility, portability)
···
"generic" # "chooses options that should be OK for most platforms"
"CXX=${stdenv.cc.targetPrefix}c++"
58
+
"AR=${stdenv.cc.targetPrefix}ar"
60
+
++ lib.optionals (!stdenv.hostPlatform.isStatic) [
61
+
"SHARED=on" # genereate a shared library
++ lib.optionals withGf2x [
68
+
enableParallelChecking = true;
doCheck = true; # takes some time
description = "Library for doing Number Theory";
NTL is a high-performance, portable C++ library providing data
···
homepage = "http://www.shoup.net/ntl/";
# also locally at "${src}/doc/tour-changes.html";
changelog = "https://www.shoup.net/ntl/doc/tour-changes.html";
79
-
teams = [ teams.sage ];
80
-
license = licenses.gpl2Plus;
81
-
platforms = platforms.all;
84
+
teams = [ lib.teams.sage ];
85
+
license = lib.licenses.gpl2Plus;
86
+
platforms = lib.platforms.all;
# https://github.com/libntl/ntl/issues/8
broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform);