lib25519: 20240321 -> 20241004, add update script, add version test script (#350211)

This commit is contained in:
misuzu
2024-12-31 16:32:14 +02:00
committed by GitHub
2 changed files with 31 additions and 3 deletions
+21 -3
View File
@@ -3,16 +3,22 @@
lib,
python3,
fetchzip,
testers,
valgrind,
librandombytes,
libcpucycles,
lib25519,
}:
let
version = "20241004";
in
stdenv.mkDerivation (finalAttrs: {
pname = "lib25519";
version = "20240321";
inherit version;
src = fetchzip {
url = "https://lib25519.cr.yp.to/lib25519-${finalAttrs.version}.tar.gz";
hash = "sha256-R10Q803vCjIZCS4Z/uErsx547RaXfAELGQm9NuNhw+I=";
hash = "sha256-gKLMk+yZ/nDlwohZiCFurSZwHExX3Ge2W1O0JoGQf8M=";
};
patches = [ ./environment-variable-tools.patch ];
@@ -31,7 +37,10 @@ stdenv.mkDerivation (finalAttrs: {
runHook postConfigure
'';
nativeBuildInputs = [ python3 ];
nativeBuildInputs = [
python3
valgrind
];
buildInputs = [
librandombytes
libcpucycles
@@ -52,6 +61,15 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstallCheck
'';
passthru = {
updateScript = ./update.sh;
tests.version = testers.testVersion {
package = lib25519;
command = "lib25519-test | head -n 2 | grep version";
version = "lib25519 version ${version}";
};
};
meta = {
homepage = "https://randombytes.cr.yp.to/";
description = "A simple API for applications generating fresh randomness";
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl cacert nix common-updater-scripts --pure
#shellcheck shell=bash
set -eu -o pipefail
# upstream doesn't use git, but has this file specifically for versioning
version="$(curl https://lib25519.cr.yp.to/lib25519-latest-version.txt)"
update-source-version lib25519 "$version"