depot/third_party/nixpkgs/pkgs/development/libraries/libsodium/default.nix
Default email dae973cb59 Project import generated by Copybara.
GitOrigin-RevId: c90c4025bb6e0c4eaf438128a3b2640314b1c58d
2023-03-08 18:32:21 +02:00

41 lines
1.4 KiB
Nix

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