protobuf: add versionCheckHook

This commit is contained in:
Gaetan Lepage
2024-12-06 08:34:17 +01:00
parent 17e1b9dfda
commit 22924b6cbd
@@ -13,6 +13,7 @@
zlib,
version,
hash,
versionCheckHook,
# downstream dependencies
python3,
@@ -31,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
src = fetchFromGitHub {
owner = "protocolbuffers";
repo = "protobuf";
rev = "refs/tags/v${version}";
tag = "v${version}";
inherit hash;
};
@@ -94,6 +95,13 @@ stdenv.mkDerivation (finalAttrs: {
# https://github.com/protocolbuffers/protobuf/issues/8460
&& !stdenv.hostPlatform.is32bit;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgram = [ "${placeholder "out"}/bin/protoc" ];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = true;
passthru = {
tests = {
pythonProtobuf = python3.pkgs.protobuf;