Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, autoreconfHook 2, testers 3}: 4 5stdenv.mkDerivation (finalAttrs: { 6 pname = "libsodium"; 7 version = "1.0.18"; 8 9 src = fetchurl { 10 url = "https://download.libsodium.org/libsodium/releases/${finalAttrs.pname}-${finalAttrs.version}.tar.gz"; 11 sha256 = "1h9ncvj23qbbni958knzsli8dvybcswcjbx0qjjgi922nf848l3g"; 12 }; 13 14 outputs = [ "out" "dev" ]; 15 16 patches = lib.optional stdenv.targetPlatform.isMinGW ./mingw-no-fortify.patch; 17 18 nativeBuildInputs = lib.optional stdenv.targetPlatform.isMinGW autoreconfHook; 19 20 separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl"; 21 22 enableParallelBuilding = true; 23 hardeningDisable = lib.optional (stdenv.targetPlatform.isMusl && stdenv.targetPlatform.isx86_32) "stackprotector"; 24 25 # FIXME: the hardeingDisable attr above does not seems effective, so 26 # the need to disable stackprotector via configureFlags 27 configureFlags = lib.optional (stdenv.targetPlatform.isMusl && stdenv.targetPlatform.isx86_32) "--disable-ssp"; 28 29 doCheck = true; 30 31 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 32 33 meta = with lib; { 34 description = "A modern and easy-to-use crypto library"; 35 homepage = "http://doc.libsodium.org/"; 36 license = licenses.isc; 37 maintainers = with maintainers; [ raskin ]; 38 pkgConfigModules = [ "libsodium" ]; 39 platforms = platforms.all; 40 }; 41})