commit:     8832b24a0a8ea41f7d649decfae22168ca253588
Author:     Harald Weiner <harald.weiner <AT> jku <DOT> at>
AuthorDate: Thu Oct 15 17:25:38 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Thu Oct 15 17:27:24 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=8832b24a

sci-mathematics/gismo: added installation of documentation

 sci-mathematics/gismo/files/doc-install.patch | 46 +++++++++++++++++++++++++++
 sci-mathematics/gismo/gismo-0.8.1.ebuild      | 10 ++++--
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/sci-mathematics/gismo/files/doc-install.patch 
b/sci-mathematics/gismo/files/doc-install.patch
new file mode 100644
index 0000000..6f730bd
--- /dev/null
+++ b/sci-mathematics/gismo/files/doc-install.patch
@@ -0,0 +1,46 @@
+--- cmake/gsInstall.cmake      2015-08-08 12:39:45.000000000 +0200
++++ cmake/gsInstall.cmake      2015-10-15 19:08:34.735776106 +0200
+@@ -1,6 +1,15 @@
+-## #################################################################
++######################################################################
++## gsIntall.cmake ---
++## This file is part of the G+Smo library.
++## 
++## Author: Angelos Mantzaflaris 
++## Author: Harald Weiner
++## Copyright (C) 2012-2015 - RICAM-Linz.
++######################################################################
++
++######################################################################
+ ## Installation
+-## #################################################################
++######################################################################
+ 
+ message ("  CMAKE_INSTALL_PREFIX    ${CMAKE_INSTALL_PREFIX}")
+ 
+@@ -128,3 +137,25 @@
+    message ("Configure with -DGISMO_BUILD_LIB=ON to compile the library")
+ endif(GISMO_BUILD_LIB)
+ 
++# Install docs (if available)
++set(DOC_SRC_DIR "${PROJECT_BINARY_DIR}/doc/html/")
++#message("DOC_SRC_DIR='${DOC_SRC_DIR}'")
++
++set(TMP_VERSION "${gismo_VERSION}")
++string(REGEX REPLACE "[a-zA-Z]+" "" TMP_VERSION ${TMP_VERSION})
++#message("TMP_VERSION='${TMP_VERSION}'")
++set(DOC_INSTALL_DIR share/doc/gismo-${TMP_VERSION} CACHE PATH 
++                       "Installation directory for documentation")
++#message("DOC_INSTALL_DIR='${DOC_INSTALL_DIR}'")
++
++install(DIRECTORY "${DOC_SRC_DIR}"
++               DESTINATION "${DOC_INSTALL_DIR}/"
++               USE_SOURCE_PERMISSIONS
++               OPTIONAL 
++               FILES_MATCHING
++                       PATTERN "*.css"
++                       PATTERN "*.html"
++                       PATTERN "*.js"
++                       PATTERN "*.jpg"
++                       PATTERN "*.png"
++)

diff --git a/sci-mathematics/gismo/gismo-0.8.1.ebuild 
b/sci-mathematics/gismo/gismo-0.8.1.ebuild
index ff9f443..f5494c6 100644
--- a/sci-mathematics/gismo/gismo-0.8.1.ebuild
+++ b/sci-mathematics/gismo/gismo-0.8.1.ebuild
@@ -17,9 +17,12 @@ IUSE="doc examples"
 
 # Unbundling in progress, 
 # preparing local changes to get upstream
+DEPEND="
+       doc? ( >=app-doc/doxygen-1.8 )"
 
 src_prepare() {
        epatch "${FILESDIR}/examples-CMakeLists.patch"
+       epatch "${FILESDIR}/doc-install.patch"
 }
 
 src_configure() {
@@ -31,6 +34,9 @@ src_configure() {
 
 src_compile() {
        cmake-utils_src_compile
-       cd "${S}_build" || die "could not find cmake build folder"
-       emake doc
+       if use doc ; then
+               # explicitly call optional target doc
+               cd "${S}_build" || die "could not find cmake build folder"
+               emake doc
+       fi
 }

Reply via email to