2021-10-28 06:52:43 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, openmp ? null }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "b2sum";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "20190724";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "BLAKE2";
|
|
|
|
repo = "BLAKE2";
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = finalAttrs.version;
|
|
|
|
sha256 = "sha256-6BVl3Rh+CRPQq3QxcUlk5ArvjIj/IcPCA2/Ok0Zu7UI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
# Use the generic C implementation rather than the SSE optimised version on non-x86 platforms
|
|
|
|
postPatch = lib.optionalString (!stdenv.hostPlatform.isx86) ''
|
|
|
|
substituteInPlace makefile \
|
|
|
|
--replace "#FILES=b2sum.c ../ref/" "FILES=b2sum.c ../ref/" \
|
|
|
|
--replace "FILES=b2sum.c ../sse/" "#FILES=b2sum.c ../sse/"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
sourceRoot = "source/b2sum";
|
|
|
|
|
|
|
|
buildInputs = [ openmp ];
|
|
|
|
|
|
|
|
buildFlags = [ (optional (openmp == null) "NO_OPENMP=1") ];
|
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "The b2sum utility is similar to the md5sum or shasum utilities but for BLAKE2";
|
|
|
|
homepage = "https://blake2.net";
|
|
|
|
license = with licenses; [ asl20 cc0 openssl ];
|
|
|
|
maintainers = with maintainers; [ kirelagin ];
|
2022-11-04 12:27:35 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-11-21 17:40:18 +00:00
|
|
|
})
|