From 5c3b11677ab72bcfa2ce11c301c34630be881235 Mon Sep 17 00:00:00 2001 From: Lucas Franceschino Date: Wed, 7 Dec 2022 15:39:19 +0100 Subject: [PATCH] fstar: add update script --- pkgs/development/compilers/fstar/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/fstar/default.nix b/pkgs/development/compilers/fstar/default.nix index a269edd6668a..020cacad6717 100644 --- a/pkgs/development/compilers/fstar/default.nix +++ b/pkgs/development/compilers/fstar/default.nix @@ -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";