From c68630b06d3782bf9547818ed0aea56054bd0616 Mon Sep 17 00:00:00 2001 From: "imad.nyc" Date: Wed, 4 Sep 2024 12:52:02 -0400 Subject: [PATCH] libcpucycles: add update script --- pkgs/by-name/li/libcpucycles/package.nix | 2 ++ pkgs/by-name/li/libcpucycles/update.sh | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100755 pkgs/by-name/li/libcpucycles/update.sh diff --git a/pkgs/by-name/li/libcpucycles/package.nix b/pkgs/by-name/li/libcpucycles/package.nix index 4e88903de66d..2d6db4aabcd9 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" +