1 { lib, stdenv, fetchurl, autoreconfHook
5 stdenv.mkDerivation (finalAttrs: {
10 url = "https://download.libsodium.org/libsodium/releases/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
11 sha256 = "1h9ncvj23qbbni958knzsli8dvybcswcjbx0qjjgi922nf848l3g";
14 outputs = [ "out" "dev" ];
16 patches = lib.optional stdenv.hostPlatform.isMinGW ./mingw-no-fortify.patch;
18 nativeBuildInputs = lib.optional stdenv.hostPlatform.isMinGW autoreconfHook;
20 separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
22 enableParallelBuilding = true;
23 hardeningDisable = lib.optional (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32) "stackprotector";
25 # FIXME: the hardeingDisable attr above does not seems effective, so
26 # the need to disable stackprotector via configureFlags
27 configureFlags = lib.optional (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32) "--disable-ssp";
31 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
34 description = "A modern and easy-to-use crypto library";
35 homepage = "https://doc.libsodium.org/";
36 license = licenses.isc;
37 maintainers = with maintainers; [ raskin ];
38 pkgConfigModules = [ "libsodium" ];
39 platforms = platforms.all;