From 352ff0be29e9f2784a94bcac4b853703eebca6fc Mon Sep 17 00:00:00 2001 From: Eduard Bachmakov Date: Thu, 14 Jan 2016 20:24:54 -0500 Subject: [PATCH] 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. --- pkgs/development/libraries/gmock/default.nix | 18 ++++----- pkgs/development/libraries/gmock/source.nix | 20 ++++++++++ pkgs/development/libraries/protobuf/3.0.nix | 39 ++++++++++++++++--- .../libraries/protobuf/generic.nix | 2 +- 4 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 pkgs/development/libraries/gmock/source.nix diff --git a/pkgs/development/libraries/gmock/default.nix b/pkgs/development/libraries/gmock/default.nix index 71ac281195b6..23a7ef43625c 100644 --- a/pkgs/development/libraries/gmock/default.nix +++ b/pkgs/development/libraries/gmock/default.nix @@ -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; }; } diff --git a/pkgs/development/libraries/gmock/source.nix b/pkgs/development/libraries/gmock/source.nix new file mode 100644 index 000000000000..c40a7cc5d4da --- /dev/null +++ b/pkgs/development/libraries/gmock/source.nix @@ -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; }; +} diff --git a/pkgs/development/libraries/protobuf/3.0.nix b/pkgs/development/libraries/protobuf/3.0.nix index 900c9dc5a512..f0bc0ca79f2b 100644 --- a/pkgs/development/libraries/protobuf/3.0.nix +++ b/pkgs/development/libraries/protobuf/3.0.nix @@ -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; +} diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index fc41187a931e..51136c31aa13 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -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;