From 22924b6cbd7813ff722ee7a8a73f90e30c345606 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 29 Nov 2024 10:57:04 +0100 Subject: [PATCH] protobuf: add versionCheckHook --- pkgs/development/libraries/protobuf/generic.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index 447202dff539..89d86bd2b20d 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -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;