protobuf: Support both 2.5 and 2.6 and make 2.6 the default

This commit is contained in:
William A. Kennington III 2015-02-06 12:21:57 -08:00
parent f9dcf13b6e
commit 673b18fdd7
4 changed files with 36 additions and 8 deletions

View File

@ -0,0 +1,9 @@
{ callPackage, fetchurl, ... } @ args:
callPackage ./generic.nix (args // rec {
version = "2.5.0";
src = fetchurl {
url = "http://protobuf.googlecode.com/files/${version}.tar.bz2";
sha256 = "0xxn9gxhvsgzz2sgmihzf6pf75clr05mqj6218camwrwajpcbgqk";
};
})

View File

@ -0,0 +1,11 @@
{ callPackage, fetchFromGitHub, ... } @ args:
callPackage ./generic.nix (args // rec {
version = "2.6.1";
src = fetchFromGitHub {
owner = "google";
repo = "protobuf";
rev = "v${version}";
sha256 = "03df8zvx2sry3jz2x4pi3l32qyfqa7w8kj8jdbz30nzy0h7aa070";
};
})

View File

@ -1,14 +1,20 @@
{ fetchurl, stdenv, zlib }:
{ stdenv, version, src
, autoreconfHook, zlib, gtest
, ...
}:
stdenv.mkDerivation rec {
name = "protobuf-2.5.0";
name = "protobuf-${version}";
src = fetchurl {
url = "http://protobuf.googlecode.com/files/${name}.tar.bz2";
sha256 = "0xxn9gxhvsgzz2sgmihzf6pf75clr05mqj6218camwrwajpcbgqk";
};
inherit src;
buildInputs = [ zlib ];
postPatch = ''
rm -rf gtest
cp -r ${gtest.source} gtest
chmod -R a+w gtest
'';
buildInputs = [ autoreconfHook zlib ];
doCheck = true;

View File

@ -6963,7 +6963,9 @@ let
postgis = callPackage ../development/libraries/postgis { };
protobuf = callPackage ../development/libraries/protobuf { };
protobuf = protobuf2_6;
protobuf2_6 = callPackage ../development/libraries/protobuf/2.6.nix { };
protobuf2_5 = callPackage ../development/libraries/protobuf/2.5.nix { };
protobufc = callPackage ../development/libraries/protobufc { };