nixpkgs-suyu/pkgs/development/libraries/protobuf/generic-v3.nix
Orivej Desh fda26c8476 Merge branch 'master' into staging
* master: (271 commits)
  pysmbc: clarify license
  pysmbc: fix license
  bazel: 0.5.4 -> 0.6.0 (#29990)
  googler: init at 3.3
  go: declare support for aarch64
  firefox-beta-bin: 56.0b5 -> 57.0b4
  spotify: 1.0.64.401.g9d720389-21 -> 1.0.64.407.g9bd02c2d-26
  gogs: 0.11.19 -> 0.11.29
  grafana: 4.5.1 -> 4.5.2
  mopidy-iris: 3.4.1 -> 3.4.9
  nextcloud: 12.0.2 -> 12.0.3
  haskell-json-autotype: jailbreak to fix build within LTS 9.x
  kore: fix up
  kore: init at 2.0.0
  glusterfs service: fix issues with useRpcbind
  tig: 2.2.2 -> 2.3.0
  haskell-hspec-core: enable test suite again
  hackage-packages.nix: automatic Haskell package set update
  librsvg: fix thumbnailer path
  awscli: 1.11.108 -> 1.11.162
  ...
2017-10-02 00:22:12 +00:00

57 lines
1.5 KiB
Nix

{ 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.src}/googlemock gmock
cp -r ${gmock.src}/googletest googletest
chmod -R a+w gmock
chmod -R a+w googletest
ln -s ../googletest gmock/gtest
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace src/google/protobuf/testing/googletest.cc \
--replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
'';
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ zlib ];
enableParallelBuilding = true;
doCheck = true;
dontDisableStatic = true;
NIX_CFLAGS_COMPILE = with stdenv.lib;
# gcc before 6 doesn't know this option
optionalString (hasPrefix "gcc-6" stdenv.cc.cc.name) "-Wno-error=misleading-indentation";
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;
}