Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 76 lines 2.3 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPackages, 5 gmp, 6 gnum4, 7 8 # Version specific args 9 version, 10 src, 11}: 12 13stdenv.mkDerivation { 14 pname = "nettle"; 15 16 inherit version src; 17 18 outputs = [ 19 "out" 20 "dev" 21 ]; 22 outputBin = "dev"; 23 24 depsBuildBuild = [ buildPackages.stdenv.cc ]; 25 nativeBuildInputs = [ gnum4 ]; 26 propagatedBuildInputs = [ gmp ]; 27 28 configureFlags = 29 # runtime selection of HW-accelerated code; it's default since 3.7 30 [ "--enable-fat" ] 31 # Make sure the right <gmp.h> is found, and not the incompatible 32 # /usr/include/mp.h from OpenSolaris. See 33 # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html> 34 # for details. 35 ++ lib.optional stdenv.hostPlatform.isSunOS "--with-include-path=${gmp.dev}/include"; 36 37 doCheck = (stdenv.hostPlatform.system != "i686-cygwin" && !stdenv.hostPlatform.isDarwin); 38 39 enableParallelBuilding = true; 40 41 patches = lib.optional (stdenv.hostPlatform.system == "i686-cygwin") ./cygwin.patch; 42 43 meta = with lib; { 44 description = "Cryptographic library"; 45 46 longDescription = '' 47 Nettle is a cryptographic library that is designed to fit 48 easily in more or less any context: In crypto toolkits for 49 object-oriented languages (C++, Python, Pike, ...), in 50 applications like LSH or GNUPG, or even in kernel space. In 51 most contexts, you need more than the basic cryptographic 52 algorithms, you also need some way to keep track of available 53 algorithms, their properties and variants. You often have 54 some algorithm selection process, often dictated by a protocol 55 you want to implement. 56 57 And as the requirements of applications differ in subtle and 58 not so subtle ways, an API that fits one application well can 59 be a pain to use in a different context. And that is why 60 there are so many different cryptographic libraries around. 61 62 Nettle tries to avoid this problem by doing one thing, the 63 low-level crypto stuff, and providing a simple but general 64 interface to it. In particular, Nettle doesn't do algorithm 65 selection. It doesn't do memory allocation. It doesn't do any 66 I/O. 67 ''; 68 69 license = licenses.gpl2Plus; 70 71 homepage = "https://www.lysator.liu.se/~nisse/nettle/"; 72 73 platforms = platforms.all; 74 maintainers = [ maintainers.vcunat ]; 75 }; 76}