gz-cmake: add passthru.updateScript

This commit is contained in:
Benjamin Sparks
2025-05-05 00:50:15 +02:00
parent ee0bd44d55
commit b4e52b4124

View File

@@ -6,15 +6,20 @@
doxygen,
graphviz,
pkg-config,
nix-update-script,
}:
let
version = "4.1.1";
versionPrefix = "gz-cmake${lib.versions.major version}";
in
stdenv.mkDerivation (finalAttrs: {
pname = "gz-cmake";
version = "4.1.1";
inherit version;
src = fetchFromGitHub {
owner = "gazebosim";
repo = "gz-cmake";
tag = "gz-cmake${lib.versions.major finalAttrs.version}_${finalAttrs.version}";
tag = "${versionPrefix}_${finalAttrs.version}";
hash = "sha256-BWgRm+3UW65Cu7TqXtFFG05JlYF52dbpAsIE8aDnJM0=";
};
@@ -25,6 +30,11 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config
];
# Extract the version by matching the tag's prefix.
passthru.updateScript = nix-update-script {
extraArgs = [ "--version-regex=${versionPrefix}_([\\d\\.]+)" ];
};
meta = {
description = "CMake modules to build Gazebo projects";
homepage = "https://github.com/gazebosim/gz-cmake";