2021-08-12 14:41:47 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "libsodium";
|
|
|
|
version = "1.0.18";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "https://download.libsodium.org/libsodium/releases/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1h9ncvj23qbbni958knzsli8dvybcswcjbx0qjjgi922nf848l3g";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2021-08-12 14:41:47 +00:00
|
|
|
|
|
|
|
patches = lib.optional stdenv.targetPlatform.isMinGW ./mingw-no-fortify.patch;
|
|
|
|
|
|
|
|
nativeBuildInputs = lib.optional stdenv.targetPlatform.isMinGW autoreconfHook;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2021-03-09 03:18:52 +00:00
|
|
|
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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A modern and easy-to-use crypto library";
|
|
|
|
homepage = "http://doc.libsodium.org/";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|