gtest: Use native cmake/ninja builder
Clean up the expression and add pkgconfig support
This commit is contained in:
parent
e5ce19f6ab
commit
9ac64e5bb6
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, cmake, fetchFromGitHub }:
|
{ stdenv, cmake, ninja, fetchFromGitHub }:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "gtest-${version}";
|
name = "gtest-${version}";
|
||||||
version = "1.8.1";
|
version = "1.8.1";
|
||||||
@ -10,24 +10,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk";
|
sha256 = "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ninja ];
|
||||||
|
|
||||||
configurePhase = ''
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake ../ -DCMAKE_INSTALL_PREFIX=$out
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/lib
|
|
||||||
cp -v googlemock/gtest/libgtest.a googlemock/gtest/libgtest_main.a googlemock/libgmock.a googlemock/libgmock_main.a $out/lib
|
|
||||||
ln -s $out/lib/libgmock.a $out/lib/libgoogletest.a
|
|
||||||
mkdir -p $out/include
|
|
||||||
cp -v -r ../googlemock/include/gmock $out/include
|
|
||||||
cp -v -r ../googletest/include/gtest $out/include
|
|
||||||
mkdir -p $out/src
|
|
||||||
cp -v -r ../googlemock/src/* ../googletest/src/* $out/src
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Google's framework for writing C++ tests";
|
description = "Google's framework for writing C++ tests";
|
||||||
|
Loading…
Reference in New Issue
Block a user