summary refs log tree commit diff
path: root/pkgs/development/libraries/protobuf/generic-v3.nix
diff options
context:
space:
mode:
authorAntoine Eiche <lewo@abesis.fr>2016-11-09 21:51:43 +0100
committerAntoine Eiche <lewo@abesis.fr>2016-11-12 09:24:42 +0100
commit2350c543f61259469af0594fe7800c067b258484 (patch)
tree06ee7df9fb3dbffc164842339a086ab7a5d6f186 /pkgs/development/libraries/protobuf/generic-v3.nix
parenta526207a2067bec3a91255ed5c0aa5902eba1f22 (diff)
downloadnixpkgs-2350c543f61259469af0594fe7800c067b258484.tar
nixpkgs-2350c543f61259469af0594fe7800c067b258484.tar.gz
nixpkgs-2350c543f61259469af0594fe7800c067b258484.tar.bz2
nixpkgs-2350c543f61259469af0594fe7800c067b258484.tar.lz
nixpkgs-2350c543f61259469af0594fe7800c067b258484.tar.xz
nixpkgs-2350c543f61259469af0594fe7800c067b258484.tar.zst
nixpkgs-2350c543f61259469af0594fe7800c067b258484.zip
protobuf: refactoring
Versions 3.x use a common derivation such as 2.x versions.
Diffstat (limited to 'pkgs/development/libraries/protobuf/generic-v3.nix')
-rw-r--r--pkgs/development/libraries/protobuf/generic-v3.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/development/libraries/protobuf/generic-v3.nix b/pkgs/development/libraries/protobuf/generic-v3.nix
new file mode 100644
index 00000000000..5a3738564d7
--- /dev/null
+++ b/pkgs/development/libraries/protobuf/generic-v3.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook, zlib, gmock
+, version, sha256
+, ...
+}:
+
+stdenv.mkDerivation rec {
+  name = "protobuf-${version}";
+
+  # make sure you test also -A pythonPackages.protobuf
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "protobuf";
+    rev = "v${version}";
+    inherit sha256;
+  };
+
+  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 ];
+
+  enableParallelBuilding = true;
+
+  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;
+}