Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2025-04-10 21:48:33 +02:00
{
lib,
stdenv,
fetchFromGitHub,
cmake,
doxygen,
graphviz,
pkg-config,
2025-05-13 02:22:46 +02:00
python3,
2025-05-05 00:50:15 +02:00
nix-update-script,
2025-04-10 21:48:33 +02:00
}:
2025-05-05 00:50:15 +02:00
let
2025-05-04 22:45:58 +00:00
version = "4.2.0";
2025-05-05 00:50:15 +02:00
versionPrefix = "gz-cmake${lib.versions.major version}";
in
2025-04-10 21:48:33 +02:00
stdenv.mkDerivation (finalAttrs: {
pname = "gz-cmake";
2025-05-05 00:50:15 +02:00
inherit version;
2025-04-10 21:48:33 +02:00
src = fetchFromGitHub {
owner = "gazebosim";
repo = "gz-cmake";
2025-05-05 00:50:15 +02:00
tag = "${versionPrefix}_${finalAttrs.version}";
2025-05-04 22:45:58 +00:00
hash = "sha256-+bMOcGWfcwPhxR9CBp4iH02CZC4oplCjsTDpPDsDnSs=";
2025-04-10 21:48:33 +02:00
};
2025-05-13 13:48:12 +02:00
postPatch = ''
patchShebangs examples/test_c_child_requires_c_no_deps.bash
substituteInPlace examples/CMakeLists.txt --replace-fail \
"$""{CMAKE_INSTALL_LIBDIR}" "${if stdenv.hostPlatform.isDarwin then "lib" else "lib64"}"
2025-05-13 13:48:12 +02:00
'';
2025-04-10 21:48:33 +02:00
nativeBuildInputs = [
cmake
doxygen
graphviz
pkg-config
];
2025-05-13 02:22:46 +02:00
cmakeFlags = [
(lib.cmakeBool "BUILDSYSTEM_TESTING" finalAttrs.doCheck)
];
nativeCheckInputs = [ python3 ];
2025-05-13 13:48:12 +02:00
doCheck = true;
2025-05-13 02:22:46 +02:00
2025-05-05 00:50:15 +02:00
# Extract the version by matching the tag's prefix.
passthru.updateScript = nix-update-script {
extraArgs = [ "--version-regex=${versionPrefix}_([\\d\\.]+)" ];
};
2025-04-10 21:48:33 +02:00
meta = {
description = "CMake modules to build Gazebo projects";
homepage = "https://github.com/gazebosim/gz-cmake";
changelog = "https://github.com/gazebosim/gz-cmake/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ guelakais ];
};
})