xc: 0.8.0 -> 0.8.5, tweak, add update script and sanity checks (#369830)

This commit is contained in:
Arne Keller
2025-01-11 19:27:10 +01:00
committed by GitHub
2 changed files with 31 additions and 7 deletions
+9
View File
@@ -0,0 +1,9 @@
# Tasks
## example
Tests if xc works
```sh
touch ./test
```
+22 -7
View File
@@ -2,17 +2,19 @@
lib,
buildGoModule,
fetchFromGitHub,
gitUpdater,
versionCheckHook,
}:
buildGoModule rec {
pname = "xc";
version = "0.8.0";
version = "0.8.5";
src = fetchFromGitHub {
owner = "joerdav";
repo = pname;
rev = "v${version}";
sha256 = "sha256-vTyCS85xbJnAgbasWD6LFxij9EezzlJ1pyvCJptqmOU=";
tag = "v${version}";
sha256 = "sha256-eaFHK7VsfLSgSJehv4urxq8qMPT+zzs2tRypz4q+MLc=";
};
vendorHash = "sha256-EbIuktQ2rExa2DawyCamTrKRC1yXXMleRB8/pcKFY5c=";
@@ -23,13 +25,26 @@ buildGoModule rec {
"-X=main.version=${version}"
];
meta = with lib; {
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
postInstallCheck = ''
cp ${./example.md} example.md
$out/bin/xc -file ./example.md example
if ! [[ -f test ]] then
echo "example.md didn't do anything" >&2
return 1
fi
'';
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
meta = {
description = "Markdown defined task runner";
mainProgram = "xc";
homepage = "https://xcfile.dev/";
changelog = "https://github.com/joerdav/xc/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [
changelog = "https://github.com/joerdav/xc/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
figsoda
joerdav
];