fstar: add update script

This commit is contained in:
Lucas Franceschino 2022-12-07 15:39:19 +01:00 committed by Rick van Schijndel
parent 6844c91781
commit 5c3b11677a

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }:
{ lib, stdenv, writeScript, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }:
stdenv.mkDerivation rec {
pname = "fstar";
@ -61,6 +61,15 @@ stdenv.mkDerivation rec {
installShellCompletion --zsh --name _fstar.exe .completion/zsh/__fstar.exe
'';
passthru.updateScript = writeScript "update-fstar" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git gnugrep common-updater-scripts
set -eu -o pipefail
version="$(git ls-remote --tags git@github.com:FStarLang/FStar.git | grep -Po 'v\K\d{4}\.\d{2}\.\d{2}' | sort | tail -n1)"
update-source-version fstar "$version"
'';
meta = with lib; {
description = "ML-like functional programming language aimed at program verification";
homepage = "https://www.fstar-lang.org";