diff --git a/pkgs/by-name/li/libcpucycles/package.nix b/pkgs/by-name/li/libcpucycles/package.nix index 84292201640b..728795aa7f6d 100644 --- a/pkgs/by-name/li/libcpucycles/package.nix +++ b/pkgs/by-name/li/libcpucycles/package.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation (finalAttrs: { install_name_tool -change "libcpucycles.1.dylib" "$out/lib/libcpucycles.1.dylib" "$out/bin/cpucycles-info" ''; + passthru.updateScript = ./update.sh; + meta = { homepage = "https://cpucycles.cr.yp.to/"; description = "Microlibrary for counting CPU cycles"; diff --git a/pkgs/by-name/li/libcpucycles/update.sh b/pkgs/by-name/li/libcpucycles/update.sh new file mode 100755 index 000000000000..9010edce7bc0 --- /dev/null +++ b/pkgs/by-name/li/libcpucycles/update.sh @@ -0,0 +1,11 @@ +#!/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://cpucycles.cr.yp.to/libcpucycles-latest-version.txt)" + +update-source-version libcpucycles "$version" +