btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libsodium / package.nix
bloba9de633d46d7edf52dd2c71ef9fdcbb10321226c
1 { lib, stdenv, fetchurl, autoreconfHook
2 , testers
3 }:
5 stdenv.mkDerivation (finalAttrs: {
6   pname = "libsodium";
7   version = "1.0.20";
9   src = fetchurl {
10     url = "https://download.libsodium.org/libsodium/releases/libsodium-${finalAttrs.version}.tar.gz";
11     hash = "sha256-67Ze9spDkzPCu0GgwZkFhyiNoH9sf9B8s6GMwY0wzhk=";
12   };
14   outputs = [ "out" "dev" ];
16   nativeBuildInputs = [ autoreconfHook ];
18   separateDebugInfo = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "musl";
20   enableParallelBuilding = true;
21   hardeningDisable = lib.optional (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32) "stackprotector";
23   # FIXME: the hardeingDisable attr above does not seems effective, so
24   # the need to disable stackprotector via configureFlags
25   configureFlags = lib.optional (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32) "--disable-ssp";
27   doCheck = true;
29   passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
31   meta = with lib; {
32     description = "Modern and easy-to-use crypto library";
33     homepage = "https://doc.libsodium.org/";
34     license = licenses.isc;
35     maintainers = with maintainers; [ raskin ];
36     pkgConfigModules = [ "libsodium" ];
37     platforms = platforms.all;
38   };