lib25519: add update script

Co-Authored-By: imad.nyc <me@imad.nyc>

lib25519: 20240321 -> 20241004

lib25519: add version test script

+31 -3
+21 -3
pkgs/by-name/li/lib25519/package.nix
··· 3 3 lib, 4 4 python3, 5 5 fetchzip, 6 + testers, 7 + valgrind, 6 8 librandombytes, 7 9 libcpucycles, 10 + lib25519, 8 11 }: 12 + let 13 + version = "20241004"; 14 + in 9 15 stdenv.mkDerivation (finalAttrs: { 10 16 pname = "lib25519"; 11 - version = "20240321"; 17 + inherit version; 12 18 13 19 src = fetchzip { 14 20 url = "https://lib25519.cr.yp.to/lib25519-${finalAttrs.version}.tar.gz"; 15 - hash = "sha256-R10Q803vCjIZCS4Z/uErsx547RaXfAELGQm9NuNhw+I="; 21 + hash = "sha256-gKLMk+yZ/nDlwohZiCFurSZwHExX3Ge2W1O0JoGQf8M="; 16 22 }; 17 23 18 24 patches = [ ./environment-variable-tools.patch ]; ··· 31 37 runHook postConfigure 32 38 ''; 33 39 34 - nativeBuildInputs = [ python3 ]; 40 + nativeBuildInputs = [ 41 + python3 42 + valgrind 43 + ]; 35 44 buildInputs = [ 36 45 librandombytes 37 46 libcpucycles ··· 51 60 $out/bin/lib25519-test 52 61 runHook postInstallCheck 53 62 ''; 63 + 64 + passthru = { 65 + updateScript = ./update.sh; 66 + tests.version = testers.testVersion { 67 + package = lib25519; 68 + command = "lib25519-test | head -n 2 | grep version"; 69 + version = "lib25519 version ${version}"; 70 + }; 71 + }; 54 72 55 73 meta = { 56 74 homepage = "https://randombytes.cr.yp.to/";
+10
pkgs/by-name/li/lib25519/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl cacert nix common-updater-scripts --pure 3 + #shellcheck shell=bash 4 + 5 + set -eu -o pipefail 6 + 7 + # upstream doesn't use git, but has this file specifically for versioning 8 + version="$(curl https://lib25519.cr.yp.to/lib25519-latest-version.txt)" 9 + 10 + update-source-version lib25519 "$version"