clang-uml: fix --version output

by setting cmake flag GIT_VERSION:
https://github.com/bkryza/clang-uml/issues/211
Enable `versionCheckHook` and set `meta.mainProgram`.
This commit is contained in:
zi3m5f 2024-10-23 01:30:05 +02:00
parent 7dc45cf38c
commit d74ae64fbb
No known key found for this signature in database

View File

@ -11,6 +11,7 @@
yaml-cpp,
elfutils,
libunwind,
versionCheckHook,
enableLibcxx ? false,
debug ? false,
}:
@ -43,6 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = [
"-DCUSTOM_COMPILE_OPTIONS=-Wno-error=sign-compare"
"-DGIT_VERSION=${finalAttrs.version}"
];
buildInputs = [
@ -72,6 +74,10 @@ stdenv.mkDerivation (finalAttrs: {
dontFixup = debug;
dontStrip = debug;
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
versionCheckProgramArg = "--version";
meta = {
description = "Customizable automatic UML diagram generator for C++ based on Clang";
longDescription = ''
@ -84,5 +90,6 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://clang-uml.github.io/";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
mainProgram = "clang-uml";
};
})