about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gtest
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/gtest
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gtest')
-rw-r--r--nixpkgs/pkgs/development/libraries/gtest/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch30
2 files changed, 62 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gtest/default.nix b/nixpkgs/pkgs/development/libraries/gtest/default.nix
new file mode 100644
index 000000000000..9ceb571983e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtest/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, cmake, ninja, fetchFromGitHub
+, static ? false }:
+
+stdenv.mkDerivation rec {
+  name = "gtest-${version}";
+  version = "1.8.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "googletest";
+    rev = "release-${version}";
+    sha256 = "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk";
+  };
+
+  patches = [
+    ./fix-cmake-config-includedir.patch
+  ];
+
+  nativeBuildInputs = [ cmake ninja ];
+
+  cmakeFlags = stdenv.lib.optional (!static) "-DBUILD_SHARED_LIBS=ON";
+
+  meta = with stdenv.lib; {
+    description = "Google's framework for writing C++ tests";
+    homepage = https://github.com/google/googletest;
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ zoomulator ivan-tkatchev ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch b/nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch
new file mode 100644
index 000000000000..c05e3a9326ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch
@@ -0,0 +1,30 @@
+--- a/googlemock/CMakeLists.txt
++++ b/googlemock/CMakeLists.txt
+@@ -106,10 +106,10 @@
+ if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+   target_include_directories(gmock SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+   target_include_directories(gmock_main SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+ endif()
+ 
+ ########################################################################
+--- a/googletest/CMakeLists.txt
++++ b/googletest/CMakeLists.txt
+@@ -126,10 +126,10 @@
+ if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+   target_include_directories(gtest SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+   target_include_directories(gtest_main SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+ endif()
+ target_link_libraries(gtest_main PUBLIC gtest)
+