git.iko.soy/typeable/nixpkgs
on master help sign in
protobuf: refactoring

Versions 3.x use a common derivation such as 2.x versions.

commit2350c543f61259469af0594fe7800c067b258484 authorAntoine Eiche <lewo@abesis.fr> dateWed 9 Nov 2016, 21:51 (10 years ago) parenta526207
3 files changed+53−80
pkgs/development/libraries/protobuf/3.0.0-beta-2.nix+3−40 pkgs/development/libraries/protobuf/3.0.nix+3−40 pkgs/development/libraries/protobuf/generic-v3.nix+47
pkgs/development/libraries/protobuf/3.0.0-beta-2.nix+3−40
@@ -1,43 +1,6 @@
1−{ stdenv, fetchFromGitHub , autoreconfHook, zlib, gmock }:
2−
3−stdenv.mkDerivation rec {
4− name = "protobuf-${version}";
1+{ callPackage, ... }:
52
3+callPackage ./generic-v3.nix {
64 version = "3.0.0-beta-2";
7− # make sure you test also -A pythonPackages.protobuf
8− src = fetchFromGitHub {
9− owner = "google";
10− repo = "protobuf";
11− rev = "v${version}";
12− sha256 = "0cbr1glgma5vakabsjwcs41pcnn8yphhn037l0zd121zb9gdaqc1";
13− };
14−
15− postPatch = ''
16− rm -rf gmock
17− cp -r ${gmock.source} gmock
18− chmod -R a+w gmock
19− '' + stdenv.lib.optionalString stdenv.isDarwin ''
20− substituteInPlace src/google/protobuf/testing/googletest.cc \
21− --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
22− '';
23−
24− buildInputs = [ autoreconfHook zlib ];
25−
26− enableParallelBuilding = true;
27−
28− doCheck = true;
29−
30− meta = {
31− description = "Google's data interchange format";
32− longDescription =
33− ''Protocol Buffers are a way of encoding structured data in an efficient
34− yet extensible format. Google uses Protocol Buffers for almost all of
35− its internal RPC protocols and file formats.
36− '';
37− license = stdenv.lib.licenses.bsd3;
38− platforms = stdenv.lib.platforms.unix;
39− homepage = https://developers.google.com/protocol-buffers/;
40− };
41−
42− passthru.version = version;
5+ sha256 = "0cbr1glgma5vakabsjwcs41pcnn8yphhn037l0zd121zb9gdaqc1";
436}
pkgs/development/libraries/protobuf/3.0.nix+3−40
@@ -1,43 +1,6 @@
1−{ stdenv, fetchFromGitHub , autoreconfHook, zlib, gmock }:
2−
3−stdenv.mkDerivation rec {
4− name = "protobuf-${version}";
1+{ callPackage, ... }:
52
3+callPackage ./generic-v3.nix {
64 version = "3.0.0";
7− # make sure you test also -A pythonPackages.protobuf
8− src = fetchFromGitHub {
9− owner = "google";
10− repo = "protobuf";
11− rev = "v${version}";
12− sha256 = "05qkcl96lkdama848m7q3nzzzdckjc158iiyvgmln0zi232xx7g7";
13− };
14−
15− postPatch = ''
16− rm -rf gmock
17− cp -r ${gmock.source} gmock
18− chmod -R a+w gmock
19− '' + stdenv.lib.optionalString stdenv.isDarwin ''
20− substituteInPlace src/google/protobuf/testing/googletest.cc \
21− --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
22− '';
23−
24− buildInputs = [ autoreconfHook zlib ];
25−
26− enableParallelBuilding = true;
27−
28− doCheck = true;
29−
30− meta = {
31− description = "Google's data interchange format";
32− longDescription =
33− ''Protocol Buffers are a way of encoding structured data in an efficient
34− yet extensible format. Google uses Protocol Buffers for almost all of
35− its internal RPC protocols and file formats.
36− '';
37− license = stdenv.lib.licenses.bsd3;
38− platforms = stdenv.lib.platforms.unix;
39− homepage = https://developers.google.com/protocol-buffers/;
40− };
41−
42− passthru.version = version;
5+ sha256 = "05qkcl96lkdama848m7q3nzzzdckjc158iiyvgmln0zi232xx7g7";
436}
pkgs/development/libraries/protobuf/generic-v3.nixnew file+47
@@ -0,0 +1,47 @@
1+{ stdenv
2+, fetchFromGitHub
3+, autoreconfHook, zlib, gmock
4+, version, sha256
5+, ...
6+}:
7+
8+stdenv.mkDerivation rec {
9+ name = "protobuf-${version}";
10+
11+ # make sure you test also -A pythonPackages.protobuf
12+ src = fetchFromGitHub {
13+ owner = "google";
14+ repo = "protobuf";
15+ rev = "v${version}";
16+ inherit sha256;
17+ };
18+
19+ postPatch = ''
20+ rm -rf gmock
21+ cp -r ${gmock.source} gmock
22+ chmod -R a+w gmock
23+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
24+ substituteInPlace src/google/protobuf/testing/googletest.cc \
25+ --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
26+ '';
27+
28+ buildInputs = [ autoreconfHook zlib ];
29+
30+ enableParallelBuilding = true;
31+
32+ doCheck = true;
33+
34+ meta = {
35+ description = "Google's data interchange format";
36+ longDescription =
37+ ''Protocol Buffers are a way of encoding structured data in an efficient
38+ yet extensible format. Google uses Protocol Buffers for almost all of
39+ its internal RPC protocols and file formats.
40+ '';
41+ license = stdenv.lib.licenses.bsd3;
42+ platforms = stdenv.lib.platforms.unix;
43+ homepage = https://developers.google.com/protocol-buffers/;
44+ };
45+
46+ passthru.version = version;
47+}