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;