protobuf: 3.0.0-alpha-3.1 -> 3.0.0-beta-2

Also split out gmock's source so that it can be copied into protobuf's
source. Hopefull this hack can be removed again once gmock is replaced
by gtest.

This does not include python bindings.
This commit is contained in:
Eduard Bachmakov 2016-01-14 20:24:54 -05:00
parent dcd428db08
commit 352ff0be29
4 changed files with 64 additions and 15 deletions

View File

@ -1,15 +1,13 @@
{ stdenv, fetchurl, unzip, cmake}:
{ stdenv, cmake, callPackage }:
let
source = callPackage ./source.nix { };
in
stdenv.mkDerivation rec {
version = "1.7.0";
name = "gmock-${version}";
name = "gmock-${source.version}";
src = fetchurl {
url = "https://googlemock.googlecode.com/files/${name}.zip";
sha256="26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b";
};
src = source;
buildInputs = [ unzip cmake ];
buildInputs = [ cmake ];
buildPhase = ''
# avoid building gtest
@ -29,4 +27,6 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.bsd3;
maintainers = [ stdenv.lib.maintainers.auntie ];
};
passthru = { inherit source; };
}

View File

@ -0,0 +1,20 @@
{ fetchzip, stdenv, unzip, ... }:
stdenv.mkDerivation rec {
name = "gmock-src-${version}";
version = "1.7.0";
src = fetchzip {
url = "https://googlemock.googlecode.com/files/gmock-${version}.zip";
sha256="04n9p6pf3mrqsabrsncv32d3fqvd86zmcdq3gyni7liszgfk0paz";
};
buildInputs = [ unzip ];
installPhase = ''
mkdir $out
cp -r * $out
'';
passthru = { inherit version; };
}

View File

@ -1,12 +1,41 @@
{ callPackage, fetchFromGitHub, ... } @ args:
{ stdenv, fetchFromGitHub , autoreconfHook, zlib, gmock }:
callPackage ./generic.nix (args // rec {
version = "3.0.0-alpha-3.1";
stdenv.mkDerivation rec {
name = "protobuf-${version}";
version = "3.0.0-beta-2";
# make sure you test also -A pythonPackages.protobuf
src = fetchFromGitHub {
owner = "google";
repo = "protobuf";
rev = "v${version}";
sha256 = "0vzw20ymjmjrrmg84f822qslclsb2q0wf0qdj2da198gmkkbrw45";
sha256 = "0cbr1glgma5vakabsjwcs41pcnn8yphhn037l0zd121zb9gdaqc1";
};
})
postPatch = ''
rm -rf gmock
cp -r ${gmock.source} gmock
chmod -R a+w gmock
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace src/google/protobuf/testing/googletest.cc \
--replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
'';
buildInputs = [ autoreconfHook zlib ];
doCheck = true;
meta = {
description = "Google's data interchange format";
longDescription =
''Protocol Buffers are a way of encoding structured data in an efficient
yet extensible format. Google uses Protocol Buffers for almost all of
its internal RPC protocols and file formats.
'';
license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.unix;
homepage = https://developers.google.com/protocol-buffers/;
};
passthru.version = version;
}

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
license = "mBSD";
homepage = http://code.google.com/p/protobuf/;
homepage = https://developers.google.com/protocol-buffers/;
};
passthru.version = version;