2024-06-20 14:57:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook
|
2023-03-08 16:32:21 +00:00
|
|
|
, testers
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "libsodium";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.0.20";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-03-08 16:32:21 +00:00
|
|
|
url = "https://download.libsodium.org/libsodium/releases/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-67Ze9spDkzPCu0GgwZkFhyiNoH9sf9B8s6GMwY0wzhk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2021-08-12 14:41:47 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2021-08-12 14:41:47 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2024-01-02 11:29:13 +00:00
|
|
|
hardeningDisable = lib.optional (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32) "stackprotector";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
# FIXME: the hardeingDisable attr above does not seems effective, so
|
|
|
|
# the need to disable stackprotector via configureFlags
|
2024-01-02 11:29:13 +00:00
|
|
|
configureFlags = lib.optional (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32) "--disable-ssp";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Modern and easy-to-use crypto library";
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://doc.libsodium.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
2023-03-08 16:32:21 +00:00
|
|
|
pkgConfigModules = [ "libsodium" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2023-03-08 16:32:21 +00:00
|
|
|
})
|