commit:     0fa97fd6f71bb38beb26c4015a1bf6b02d6207d3
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 20 14:14:56 2018 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Mar 20 14:15:23 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fa97fd6

sci-physics/root: have root6 compile on Prefix.

  1. DEFAULT_SYSROOT of bundled llvm points to EPREFIX, so that system
     headers inside EPREFIX is used.
  2. prefixify the CMakeList system headers copies.
  3. disable ftgl search when USE=opengl is not set.

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../root/files/root-6.12.06-disable-ftgl.patch     | 45 ++++++++++++++++++++++
 sci-physics/root/root-6.12.06-r1.ebuild            |  6 ++-
 2 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/sci-physics/root/files/root-6.12.06-disable-ftgl.patch 
b/sci-physics/root/files/root-6.12.06-disable-ftgl.patch
new file mode 100644
index 00000000000..89d8d550d30
--- /dev/null
+++ b/sci-physics/root/files/root-6.12.06-disable-ftgl.patch
@@ -0,0 +1,45 @@
+Forwarded: https://sft.its.cern.ch/jira/browse/ROOT-9315
+
+Index: root-6.12.06/cmake/modules/SearchInstalledSoftware.cmake
+===================================================================
+--- root-6.12.06.orig/cmake/modules/SearchInstalledSoftware.cmake
++++ root-6.12.06/cmake/modules/SearchInstalledSoftware.cmake
+@@ -1075,22 +1075,24 @@ if(globus)
+ endif()
+ 
+ #---Check for ftgl if 
needed----------------------------------------------------------
+-if(NOT builtin_ftgl)
+-  find_package(FTGL)
+-  if(NOT FTGL_FOUND)
+-    if(fail-on-missing)
+-      message(FATAL_ERROR "ftgl library not found and is required 
('builtin_ftgl' is OFF). Set varible FTGL_ROOT_DIR to installation location")
+-    else()
+-      message(STATUS "ftgl library not found. Set variable FTGL_ROOT_DIR to 
point to your installation")
+-      message(STATUS "For the time being switching ON 'builtin_ftgl' option")
+-      set(builtin_ftgl ON CACHE BOOL "" FORCE)
++if(buildgl)
++  if(NOT builtin_ftgl)
++    find_package(FTGL)
++    if(NOT FTGL_FOUND)
++      if(fail-on-missing)
++        message(FATAL_ERROR "ftgl library not found and is required 
('builtin_ftgl' is OFF). Set varible FTGL_ROOT_DIR to installation location")
++      else()
++        message(STATUS "ftgl library not found. Set variable FTGL_ROOT_DIR to 
point to your installation")
++        message(STATUS "For the time being switching ON 'builtin_ftgl' 
option")
++        set(builtin_ftgl ON CACHE BOOL "" FORCE)
++      endif()
+     endif()
+   endif()
+-endif()
+-if(builtin_ftgl)
+-  set(FTGL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/graf3d/ftgl/inc)
+-  set(FTGL_CFLAGS -DBUILTIN_FTGL)
+-  set(FTGL_LIBRARIES FTGL)
++  if(builtin_ftgl)
++    set(FTGL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/graf3d/ftgl/inc)
++    set(FTGL_CFLAGS -DBUILTIN_FTGL)
++    set(FTGL_LIBRARIES FTGL)
++  endif()
+ endif()
+ 
+ #---Check for 
chirp--------------------------------------------------------------------

diff --git a/sci-physics/root/root-6.12.06-r1.ebuild 
b/sci-physics/root/root-6.12.06-r1.ebuild
index c0815302e7d..6f44ce517b4 100644
--- a/sci-physics/root/root-6.12.06-r1.ebuild
+++ b/sci-physics/root/root-6.12.06-r1.ebuild
@@ -9,7 +9,7 @@ CMAKE_MAKEFILE_GENERATOR=emake
 FORTRAN_NEEDED="fortran"
 PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
 
-inherit cmake-utils elisp-common eutils fortran-2 gnome2-utils \
+inherit cmake-utils elisp-common eutils fortran-2 gnome2-utils prefix \
        python-single-r1 toolchain-funcs user versionator xdg-utils
 
 DESCRIPTION="C++ data analysis framework and interpreter from CERN"
@@ -115,6 +115,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-6.11.02-hsimple.patch
        "${FILESDIR}"/${PN}-6.12.04-no-ocaml.patch
        "${FILESDIR}"/${PN}-6.12.04-z3.patch
+       "${FILESDIR}"/${PN}-6.12.06-disable-ftgl.patch
 )
 
 pkg_setup() {
@@ -151,6 +152,8 @@ src_prepare() {
 
        # CSS should use local images
        sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
+
+       hprefixify build/CMakeLists.txt core/clingutils/CMakeLists.txt
 }
 
 # Note: ROOT uses bundled LLVM, because it is patched and API-incompatible 
with system LLVM.
@@ -162,6 +165,7 @@ src_configure() {
                -DCMAKE_C_FLAGS="${CFLAGS}"
                -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
                -DCMAKE_INSTALL_PREFIX="${EPREFIX}/${MY_PREFIX}"
+               -DDEFAULT_SYSROOT="${EPREFIX}" # for llvm system headers
                -Dexplicitlink=ON
                -Dexceptions=ON
                -Dfail-on-missing=ON

Reply via email to