From 669443f5c1b75a4c74b4ff19716a8b66af5db8e7 Mon Sep 17 00:00:00 2001 From: Jonathan Glines Date: Fri, 8 Aug 2014 11:16:03 -0600 Subject: [PATCH] Added gmock (Google Mock) package to complement gtest package. --- pkgs/development/libraries/gmock/default.nix | 38 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/libraries/gmock/default.nix diff --git a/pkgs/development/libraries/gmock/default.nix b/pkgs/development/libraries/gmock/default.nix new file mode 100644 index 000000000000..33c6e00ef650 --- /dev/null +++ b/pkgs/development/libraries/gmock/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchurl, unzip, cmake}: + +stdenv.mkDerivation rec { + version = "1.7.0"; + name = "gmock-${version}"; + + src = fetchurl { + url = "https://googlemock.googlecode.com/files/${name}.zip"; + sha256="26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b"; + }; + + buildInputs = [ unzip cmake ]; + + configurePhase = '' + mkdir build + cd build + cmake ../ -DCMAKE_INSTALL_PREFIX=$out + ''; + + buildPhase = '' + # avoid building gtest + make gmock gmock_main + ''; + + installPhase = '' + mkdir -p $out/lib + cp -v libgmock.a libgmock_main.a $out/lib + cp -v -r ../include $out + cp -v -r ../src $out + ''; + + meta = { + description = "Google mock: Google's framework for writing C++ mock classes."; + homepage = https://code.google.com/p/googlemock/; + license = stdenv.lib.licenses.bsd3; + maintainers = [ stdenv.lib.maintainers.auntie ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8590aa747421..e894507b12a9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1229,6 +1229,7 @@ let gt5 = callPackage ../tools/system/gt5 { }; gtest = callPackage ../development/libraries/gtest {}; + gmock = callPackage ../development/libraries/gmock {}; gtkdatabox = callPackage ../development/libraries/gtkdatabox {};