hare: modified hook: added support for tools; hare-update: init at 0.26.0.0 (#536666)

This commit is contained in:
Ross Smyth
2026-11-17 17:19:20 +00:00
committed by GitHub
4 changed files with 64 additions and 1 deletions

View File

@@ -27928,6 +27928,12 @@
githubId = 57048005;
name = "snicket2100";
};
snifexx = {
name = "Matteo Bonesoli";
email = "snifex@phnxdev.eu";
githubId = 71451061;
github = "snifexx";
};
sno2wman = {
name = "SnO2WMaN";
email = "me@sno2wman.net";

View File

@@ -0,0 +1,46 @@
{
fetchFromSourcehut,
hareHook,
lib,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hare-update";
version = "0.26.0.0";
strictDeps = true;
__structuredAttrs = true;
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "hare-update";
tag = finalAttrs.version;
hash = "sha256-E6N9UMYdNTgy0tppBgOwT14WUXvjliSh/ps16fPDFN8=";
};
nativeBuildInputs = [
hareHook
];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
meta = {
description = "Tool for assisting in updating Hare codebases affected by breaking changes";
longDescription = ''
hare-update is a Hare add-on which assists in migrating a Hare codebases
to a newer release of Hare by scanning your code, identifying areas
impacted by breaking changes, and suggesting the appropriate fix.
'';
homepage = "https://git.sr.ht/~sircmpwn/hare-update";
license = lib.licenses.eupl12;
maintainers = with lib.maintainers; [ snifexx ];
# Same as the harec package except with added netbsd. harec also supports netbsd, so...
platforms =
with lib.platforms;
lib.intersectLists (netbsd ++ freebsd ++ openbsd ++ linux) (aarch64 ++ x86_64 ++ riscv64);
# Same as the harec package. The harec developers do not explicitly supprt
# MacOS, even if ports exists
badPlatforms = lib.platforms.darwin;
};
})

View File

@@ -175,7 +175,10 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://harelang.org/";
description = "Systems programming language designed to be simple, stable, and robust";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ sikmir ];
maintainers = with lib.maintainers; [
sikmir
snifexx
];
mainProgram = "hare";
inherit (harec.meta) platforms badPlatforms;
};

View File

@@ -7,6 +7,13 @@ addHarepath() {
fi
}
addHareToolpath() {
local -r toolpath="${1-}/libexec/hare"
if [[ -d "$toolpath" ]]; then
addToSearchPath HARE_TOOLPATH "$toolpath"
fi
}
# Hare's stdlib should come after its third party libs, since the latter may
# expand or shadow the former.
readonly hareSetStdlibPhase='
@@ -34,3 +41,4 @@ HARECACHE="$(mktemp -d)"
export HARECACHE
addEnvHooks "$hostOffset" addHarepath
addEnvHooks "$hostOffset" addHareToolpath