commit:     fb0a0e645db8b5066be7bfcfdda8f3545637b2f9
Author:     Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
AuthorDate: Sat Jan 10 17:07:51 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sat Jan 10 17:07:51 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=fb0a0e64

Download gtest instead of using svn during compile

---
 sci-libs/arrayfire/arrayfire-9999.ebuild   | 18 +++++++++--
 sci-libs/arrayfire/files/build_gtest.patch | 51 ++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/sci-libs/arrayfire/arrayfire-9999.ebuild 
b/sci-libs/arrayfire/arrayfire-9999.ebuild
index 667ca0b..c055da7 100644
--- a/sci-libs/arrayfire/arrayfire-9999.ebuild
+++ b/sci-libs/arrayfire/arrayfire-9999.ebuild
@@ -4,11 +4,12 @@
 
 EAPI=5
 
-inherit cmake-utils git-r3
+inherit cmake-utils git-r3 unpacker
 
 DESCRIPTION="A general purpose GPU library."
 HOMEPAGE="http://www.arrayfire.com/";
 EGIT_REPO_URI="https://github.com/arrayfire/arrayfire.git";
+SRC_URI="test? ( https://googletest.googlecode.com/files/gtest-1.7.0.zip )"
 KEYWORDS="~amd64"
 
 LICENSE="ArrayFire"
@@ -22,15 +23,28 @@ RDEPEND="
        cuda? ( >=dev-util/nvidia-cuda-toolkit-6.0 )
        sci-libs/fftw:3.0"
 DEPEND="${RDEPEND}
-       test? ( dev-vcs/subversion )"
+       test? ( app-arch/unzip )"
 
+BUILD_DIR="${S}/build"
 CMAKE_BUILD_TYPE=Release
 
 PATCHES=(
        "${FILESDIR}"/FindCBLAS.patch
        "${FILESDIR}"/CMakeLists_examples.patch
+    "${FILESDIR}"/build_gtest.patch
 )
 
+src_unpack() {
+    git-r3_src_unpack
+
+       if use test; then
+               mkdir -p "${BUILD_DIR}"/third_party/src/ || die
+               cd "${BUILD_DIR}"/third_party/src/ || die
+               unpack_zip "${DISTDIR}/"gtest-1.7.0.zip
+               mv "${BUILD_DIR}"/third_party/src/gtest-1.7.0 
"${BUILD_DIR}"/third_party/src/googletest || die
+       fi
+}
+
 src_configure() {
        if use cuda; then
                addwrite /dev/nvidiactl

diff --git a/sci-libs/arrayfire/files/build_gtest.patch 
b/sci-libs/arrayfire/files/build_gtest.patch
new file mode 100644
index 0000000..24e4b07
--- /dev/null
+++ b/sci-libs/arrayfire/files/build_gtest.patch
@@ -0,0 +1,51 @@
+--- CMakeModules/build_gtest.cmake     2015-01-10 11:27:52.007076159 +0100
++++ CMakeModules/build_gtest.cmake     2015-01-10 17:36:23.000000000 +0100
+@@ -1,27 +1,4 @@
+-#Downloads and installs GTest into the third_party directory
+-
+-# We apply a patch to subversion, thus we need to find it.
+-FIND_PACKAGE(Subversion REQUIRED)
+-
+-# Create patch file for gtest with MSVC 2012
+-if(MSVC_VERSION EQUAL 1700)
+-  file(WRITE  "${CMAKE_BINARY_DIR}/gtest.patch" "Index: 
cmake/internal_utils.cmake\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" 
"===================================================================\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "--- 
cmake/internal_utils.cmake   (revision 660)\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+++ 
cmake/internal_utils.cmake   (working copy)\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "@@ -66,6 +66,9 @@\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "       # Resolved overload 
was found by argument-dependent lookup.\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "       set(cxx_base_flags 
\"\${cxx_base_flags} -wd4675\")\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "     endif()\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+    if (MSVC_VERSION EQUAL 
1700)\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+      set(cxx_base_flags 
\"\${cxx_base_flags} -D_VARIADIC_MAX=10\")\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+    endif ()\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "     set(cxx_base_flags 
\"\${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32\")\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "     set(cxx_base_flags 
\"\${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN\")\n")
+-  file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "     set(cxx_exception_flags 
\"-EHsc -D_HAS_EXCEPTIONS=1\")\n")
+-else()
+-  file(WRITE  "${CMAKE_BINARY_DIR}/gtest.patch" "")
+-endif()
++#Installs GTest into the third_party directory
+ 
+ # Enable ExternalProject CMake module
+ include(ExternalProject)
+@@ -37,10 +14,6 @@ set_directory_properties(PROPERTIES EP_P
+ # Add gtest
+ ExternalProject_Add(
+     googletest
+-    SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
+-    SVN_REVISION -r 660
+-    TIMEOUT 10
+-    PATCH_COMMAND "${Subversion_SVN_EXECUTABLE}" patch 
"${CMAKE_BINARY_DIR}/gtest.patch" 
"${CMAKE_BINARY_DIR}/third_party/src/googletest"
+     # Force separate output paths for debug and release builds to allow easy
+     # identification of correct lib in subsequent TARGET_LINK_LIBRARIES 
commands
+     CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+@@ -54,8 +27,6 @@ ExternalProject_Add(
+     # Disable install step
+     INSTALL_COMMAND ""
+     # Wrap download, configure and build steps in a script to log output
+-    LOG_DOWNLOAD 0
+-    LOG_UPDATE 0
+     LOG_CONFIGURE 0
+     LOG_BUILD 0)
+ 

Reply via email to