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 lib, 4 python3, 5 fetchzip, 6 librandombytes, 7 libcpucycles, 8 }: 9 stdenv.mkDerivation (finalAttrs: { 10 pname = "lib25519"; 11 - version = "20240321"; 12 13 src = fetchzip { 14 url = "https://lib25519.cr.yp.to/lib25519-${finalAttrs.version}.tar.gz"; 15 - hash = "sha256-R10Q803vCjIZCS4Z/uErsx547RaXfAELGQm9NuNhw+I="; 16 }; 17 18 patches = [ ./environment-variable-tools.patch ]; ··· 31 runHook postConfigure 32 ''; 33 34 - nativeBuildInputs = [ python3 ]; 35 buildInputs = [ 36 librandombytes 37 libcpucycles ··· 51 $out/bin/lib25519-test 52 runHook postInstallCheck 53 ''; 54 55 meta = { 56 homepage = "https://randombytes.cr.yp.to/";
··· 3 lib, 4 python3, 5 fetchzip, 6 + testers, 7 + valgrind, 8 librandombytes, 9 libcpucycles, 10 + lib25519, 11 }: 12 + let 13 + version = "20241004"; 14 + in 15 stdenv.mkDerivation (finalAttrs: { 16 pname = "lib25519"; 17 + inherit version; 18 19 src = fetchzip { 20 url = "https://lib25519.cr.yp.to/lib25519-${finalAttrs.version}.tar.gz"; 21 + hash = "sha256-gKLMk+yZ/nDlwohZiCFurSZwHExX3Ge2W1O0JoGQf8M="; 22 }; 23 24 patches = [ ./environment-variable-tools.patch ]; ··· 37 runHook postConfigure 38 ''; 39 40 + nativeBuildInputs = [ 41 + python3 42 + valgrind 43 + ]; 44 buildInputs = [ 45 librandombytes 46 libcpucycles ··· 60 $out/bin/lib25519-test 61 runHook postInstallCheck 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 + }; 72 73 meta = { 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"