commit:     16bc156fe66e38628bca0158cadb6d479bacb171
Author:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 17:08:20 2016 +0000
Commit:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 17:30:22 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16bc156f

sci-chemistry/votca-csg: fix cmake-3.4 build (bug #588834)

Package-Manager: portage-2.2.28

 .../votca-csg/files/votca-csg-1.3-cmake-3.4.patch  | 62 ++++++++++++++++++++++
 ...otca-csg-1.3.ebuild => votca-csg-1.3-r1.ebuild} |  9 ++--
 2 files changed, 67 insertions(+), 4 deletions(-)

diff --git a/sci-chemistry/votca-csg/files/votca-csg-1.3-cmake-3.4.patch 
b/sci-chemistry/votca-csg/files/votca-csg-1.3-cmake-3.4.patch
new file mode 100644
index 0000000..59d83ca
--- /dev/null
+++ b/sci-chemistry/votca-csg/files/votca-csg-1.3-cmake-3.4.patch
@@ -0,0 +1,62 @@
+From 34d55f6d771bcf026f453457f45d787391910598 Mon Sep 17 00:00:00 2001
+From: Christoph Junghans <[email protected]>
+Date: Tue, 2 Feb 2016 13:56:50 -0700
+Subject: [PATCH] cmake: fixed CheckCXXLibraryExists() with >=cmake-3.4
+
+---
+ CMakeModules/CheckCXXLibraryExists.cmake |  6 +-----
+ CMakeModules/CheckFunctionExists.cpp     | 23 +++++++++++++++++++++++
+ 2 files changed, 24 insertions(+), 5 deletions(-)
+ create mode 100644 CMakeModules/CheckFunctionExists.cpp
+
+diff --git a/CMakeModules/CheckCXXLibraryExists.cmake 
b/CMakeModules/CheckCXXLibraryExists.cmake
+index 9c76fe2..d84aea7 100644
+--- a/CMakeModules/CheckCXXLibraryExists.cmake
++++ b/CMakeModules/CheckCXXLibraryExists.cmake
+@@ -54,13 +54,9 @@ macro(CHECK_CXX_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION 
VARIABLE)
+       set(CHECK_LIBRARY_EXISTS_LIBRARIES
+         ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
+     endif()
+-    if(NOT EXISTS 
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.cpp)
+-      file(COPY ${CMAKE_ROOT}/Modules/CheckFunctionExists.c DESTINATION 
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
+-      file(RENAME 
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.c 
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.cpp)
+-    endif()
+     try_compile(${VARIABLE}
+       ${CMAKE_BINARY_DIR}
+-      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.cpp
++      ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/CheckFunctionExists.cpp
+       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+       LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
+       CMAKE_FLAGS
+diff --git a/CMakeModules/CheckFunctionExists.cpp 
b/CMakeModules/CheckFunctionExists.cpp
+new file mode 100644
+index 0000000..607b3e8
+--- /dev/null
++++ b/CMakeModules/CheckFunctionExists.cpp
+@@ -0,0 +1,23 @@
++#ifdef CHECK_FUNCTION_EXISTS
++
++char CHECK_FUNCTION_EXISTS();
++#ifdef __CLASSIC_C__
++int main(){
++  int ac;
++  char*av[];
++#else
++int main(int ac, char*av[]){
++#endif
++  CHECK_FUNCTION_EXISTS();
++  if(ac > 1000)
++    {
++    return *av[0];
++    }
++  return 0;
++}
++
++#else  /* CHECK_FUNCTION_EXISTS */
++
++#  error "CHECK_FUNCTION_EXISTS has to specify the function"
++
++#endif /* CHECK_FUNCTION_EXISTS */
+-- 
+2.7.3
+

diff --git a/sci-chemistry/votca-csg/votca-csg-1.3.ebuild 
b/sci-chemistry/votca-csg/votca-csg-1.3-r1.ebuild
similarity index 95%
rename from sci-chemistry/votca-csg/votca-csg-1.3.ebuild
rename to sci-chemistry/votca-csg/votca-csg-1.3-r1.ebuild
index 87883b4..5f6435b 100644
--- a/sci-chemistry/votca-csg/votca-csg-1.3.ebuild
+++ b/sci-chemistry/votca-csg/votca-csg-1.3-r1.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 
 CMAKE_MAKEFILE_GENERATOR="ninja"
 
@@ -16,6 +16,7 @@ if [ "${PV}" != "9999" ]; then
                examples? (     
https://github.com/${PN/-//}-tutorials/archive/v${PV}.tar.gz -> 
${PN}-tutorials-${PV}.tar.gz )"
        KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-macos"
        S="${WORKDIR}/${P#votca-}"
+       PATCHES=( "${FILESDIR}/${P}-cmake-3.4.patch" )
 else
        inherit git-r3
        EGIT_REPO_URI="git://github.com/${PN/-//}.git 
https://github.com/${PN/-//}.git";
@@ -69,8 +70,8 @@ src_unpack() {
 
 src_configure() {
        mycmakeargs=(
-               $(cmake-utils_use_with gromacs GMX)
-               $(cmake-utils_use_with hdf5 H5MD)
+               -DWITH_GMX=$(usex gromacs)
+               -DWITH_H5MD=$(usex hdf5)
                -DWITH_RC_FILES=OFF
                -DLIB=$(get_libdir)
        )
@@ -95,7 +96,7 @@ src_install() {
                        dodoc "${DISTDIR}/${PN}-manual-${PV}.pdf"
                fi
                cmake-utils_src_make -C "${CMAKE_BUILD_DIR}" html
-               dohtml -r "${CMAKE_BUILD_DIR}"/share/doc/html/*
+               dodoc -r "${CMAKE_BUILD_DIR}"/share/doc/html
        fi
        if use examples; then
                insinto "/usr/share/doc/${PF}/tutorials"

Reply via email to