summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/cmake/Manifest16
-rw-r--r--dev-util/cmake/cmake-3.1.1.ebuild186
-rw-r--r--dev-util/cmake/files/50cmake-gentoo.el4
-rw-r--r--dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch19
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch23
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-libform.patch51
-rw-r--r--dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch24
-rw-r--r--dev-util/cmake/files/cmake-2.8.12.1-FindImageMagick.patch23
-rw-r--r--dev-util/cmake/files/cmake-3.0.0-FindBLAS.patch43
-rw-r--r--dev-util/cmake/files/cmake-3.0.0-FindBoost-python.patch93
-rw-r--r--dev-util/cmake/files/cmake-3.0.0-prefix-dirs.patch142
-rw-r--r--dev-util/cmake/files/cmake-3.0.2-FindLAPACK.patch43
-rw-r--r--dev-util/cmake/files/cmake-3.1.0-FindPythonInterp.patch29
-rw-r--r--dev-util/cmake/files/cmake-3.1.0-darwin-isysroot.patch48
-rw-r--r--dev-util/cmake/files/cmake.vim3
-rw-r--r--dev-util/cmake/metadata.xml5
16 files changed, 752 insertions, 0 deletions
diff --git a/dev-util/cmake/Manifest b/dev-util/cmake/Manifest
new file mode 100644
index 0000000..06ea784
--- /dev/null
+++ b/dev-util/cmake/Manifest
@@ -0,0 +1,16 @@
+AUX 50cmake-gentoo.el 244 SHA256 6010e6df84aa23050fcbc490ae2b22802ede0870ff2e96c43fe541e97e0d6c00 SHA512 70af0b9dd41f08531d3c754dc8af3662df8a22b469b79e8c40b7caae3205be1d4dc81d8b41837d1b6a46f2c348f5407e09e02269823c45c3366777e3bc7a0dcb WHIRLPOOL aa60ffe7e5edd00fdbb32ce2c9aee24fddd6e4d064b8bde55c7ff3b42196c3420596653aade9cc447a3293050c5ab23a27a556f26806e4d67139d264a38d1aaa
+AUX cmake-2.6.3-no-duplicates-in-rpath.patch 794 SHA256 908ea65a9db5ca85b2061ad63de714e59930aafeff010939be4829eb60b301c7 SHA512 13dfb5d1ed271eaf673aa53c40a5a17a89812c7617e840ffd3df962e9ed6e46da7b507121f56314a2ef8b86a80b2453cf327684e2c4e82bb903cd8210807f507 WHIRLPOOL b43a187a6f90590460b6e499630a6f6d550cee09309c4c32c0b7d68189bcd84dac309ae4b80bc345de5b32dcc4ac94f789c1fea8162cea4175847c49dc862ccf
+AUX cmake-2.8.10-darwin-bundle.patch 956 SHA256 8195342561ada36d4e3796a906fc662f9f84cc470809e7596b4376f3fe90dbac SHA512 39f444f592f435fbcc865a903ccb851b6c40ddf5f3b99b986c92af6b8984978d4fa1819808f1365f53887098da8533c31f6ea29e14cb541045ed3f63fcc771e2 WHIRLPOOL c20412508cad6329bebfb152051008c5ff98f0a27657d047992f4523a213d4ee396ea23c009ad2133b283ab4518d359b2b65d5034e06bd5649a6f08d76cb5db8
+AUX cmake-2.8.10-libform.patch 1598 SHA256 8635248bfebe157e545eddc3c16223e4d8c51af51a8d224ef1003a043ce468f4 SHA512 08a0fb45f2b4c1a8ba0e961539d650e38feedd4b2ca3b5acc2fcad3d68fe3fcdb5b114663b1f84b26027e902d28cc2d4f50cc1e3491ba90d6c3c273aa32d62d9 WHIRLPOOL 505231f51be487dd71eb2f17cb65560eb86039673a593e1e76f3d7f27c3cb64dad36ef1c507aa9e97aae28b20f642dfcb4d023537e0a1af361e74c43b88a51e1
+AUX cmake-2.8.10.2-FindPythonLibs.patch 968 SHA256 4a2bbd60a2c526387ac8088d6bbecff1cc4399259d737530f2d55a6afd033b15 SHA512 e42713242202409e06a1b0725c6ea0a89c6d623d143e6c06def9681b72516a760ebddeccdf16e141e6b21ced2fb63e42337536afd6ca799e6d6d8689d48037cb WHIRLPOOL f92e7981f267310e471425b9f6595c54bf6df2af3fd99a0502bebaa39d87dcc14e31389d1c1bd99271718ce6b33f837842a0cdb454de09da60df5252f86cf826
+AUX cmake-2.8.12.1-FindImageMagick.patch 1700 SHA256 042a843bc6204efee071af2cdeb451c5da3da852cba0d522dea1d264ff1014c3 SHA512 4c533e3bf3127eb0696b557fe381bfd88f3ebc70b29a33f04b7bf95fa7c765cb237abe34b6a406b452dd71fbc3d79740d58ae981eedca952f9fae272ea4f5efa WHIRLPOOL 25c5c7c47b2874b32143a9fe14443aa6da8f3abb6c92b0bd94f3848dd7d8114d901a0bc6fbb78547879f5af947f87f070e24cc2deeecd7bb4cc95290a7af7d40
+AUX cmake-3.0.0-FindBLAS.patch 1577 SHA256 25be4e8671eff94b5cb7fe955215d9b97cc39e61f7203b4eb9b28e16977c3842 SHA512 c6239fe3d8b8e437b66399a3ebdf09da94f747dc6c45aaaba43773ce29a106727c7d4f8a570e1fd9603a9cdbade6b9702398c1989267adbcc5aebbeb59d30915 WHIRLPOOL 44366678ff681b3c876c90274d3b6709ad4ef7de051663db03fecdb77baffbd87b02c5edf53126b383680a58ef4c0a0100982240e58db352c781cd204907f2bc
+AUX cmake-3.0.0-FindBoost-python.patch 6481 SHA256 bd8ff52ce3565ab67806e2417d3c1e3c05215dde1da588f65dfc8db061ea3116 SHA512 4eed678c74af89e249de7202c553825cfd0132b84d605d078c388224a1add76acef778f366bb60e52e58e9ca25a23e18f8f6bef7385a9180fb1cab7d7698ffbf WHIRLPOOL ba4965b6e390a30178cd99806eda5d1fd669ccb894ba94d1f8ea358dcfbf10f9559918711912786cc3be16569b87d931d13712bd84a433b561f1092d8c71c416
+AUX cmake-3.0.0-prefix-dirs.patch 4279 SHA256 5f5f544a861c8c79fe668cbe65bbba8c8c83e4eca82503f8e7b193ec476c2225 SHA512 f90b2114aa84509fe3763d5c2d29460c84334aedc48f1856e646d7118a80ece72b57084f9ee7e8669ce59d61337d967e8d01f6a68b7d3580f2230a804a0ab2ee WHIRLPOOL 70761c4b3c7886ebcf1d052237f77eb871b92846a35281c911c6cf5ef867d3df09b563399113ca8f7d6f8e912b9c170b074d296b82a480dcc4c8dd10ebeab245
+AUX cmake-3.0.2-FindLAPACK.patch 1442 SHA256 394388bdf47c995bc540537ad2cb497c719eafc5298a19d41d1a672c02d3b221 SHA512 60b673005bb3cec6830a3f68922c5661bccd8d7d39d77172d1f59383e8f9912e3e74e052d5e632479d1b091357dbabef656049dffaf705cebae9ae99ea35e74e WHIRLPOOL 7b46096381aa9a94e92c9aac80993a3da75b80203050f609adf7672ac238d4dd3ad89ff8261e87bd040a4ba5b4b1b4e73bfdf9ac3ba55b2c33a6f7800315748c
+AUX cmake-3.1.0-FindPythonInterp.patch 1072 SHA256 463c0a681b92ed02f7802153457d530109c6a6ec686d6c02968ea84085134705 SHA512 5e3445f43793fbea561d24cf502d06264f3f27134420d7df18aee678901bb895912a0b7b7f73ec7321155284f821aab5dbd6046bb050c02f58a0bd5188dc85f0 WHIRLPOOL 65aaa246da0230df4ff45a21e398224751d67820153ed5b871ee6095ae97804da98057de114354ec7ff2abb8f438fbcdd5c0b70a718fef6974d39ee69f94ca6e
+AUX cmake-3.1.0-darwin-isysroot.patch 1922 SHA256 05b3f77f8f8a25c809cf0819867fa785a739d3dc9c34e5e9fbbb6b4ad9115710 SHA512 9fcdac45f1c4d8c90839e5f4a6c9f1d28c1767bf6b1767dd7d8d04d332558ef8dc775af65926c3d08a72a6e535c063a85956bf20a10e48016fa13533037979d0 WHIRLPOOL 31ea327e6c41132923a26dfce39b19961b1862e79fcfa3f9c80773f6c3181acbf44ab655a2b837c0ab2165d918c8709aa82321958ca4e0d93277d0a2a47c1127
+AUX cmake.vim 217 SHA256 7366c1d45bdcc93efb1954216a5427a5f9df7e98a1f706c357576d7835aaebc5 SHA512 2f7e9e949f8f3030a0dfcef56f4effea703ee60555c22f6a2d1dfeaf3334f33a3e88910c666f704e4ab60cde4ebb509c7d85d812a3c1627010e52fc757f15cdf WHIRLPOOL 088ae1f0a4f32ea872deaf1d4e8d21d6853d3cecb903ea8abfb06c85de8c200757c2cfb34ec25cd0d8ef2a3c12b3cc9472e9ef0b5ce3f702502100806e0e73fc
+DIST cmake-3.1.1.tar.gz 5959421 SHA256 b58694e545d51cde5756a894f53107e3d9e469360e1d92e7f6892b55ebc0bebf SHA512 9e60f6ae209706a801f17810c8e17a839a779d5d9516f02290922c306b941957245cbc7345371846f98fb9a6ffb52611fb6e1647fa400c1700f1197743c3a22c WHIRLPOOL 37c85d87276b9a2c85f093b114e1bf639164a41b8eb78978973d2c362015c861f2c341529df64ee7901c5a4c495d7e4dc2688ef923d03281f5a0457f1b16cc64
+EBUILD cmake-3.1.1.ebuild 5099 SHA256 b8af207aee127c21224279e8bdbf9a5cf62760f74d3e192c50719bfad0e5a63b SHA512 5ae290035da81569ac4019e327881fbe42aeca31f25bb62740f3afef8ef1b5308e66fabb5a9f5c4159d5065112131efc606d85e1e456bddfcaa60344c2543956 WHIRLPOOL 0fb06a7127411a0ced9eb316dc602714c21b80dd560c3234ec43e4e8bfd21da77c7fd972737ab07f5713f99efa60862a68ae1dce48bed7dc949dbb22bad6e88b
+MISC metadata.xml 157 SHA256 01f6fa4357ce08e8b0f7900a51fa78c7f060fefc7c7da98acaec1e283dd59892 SHA512 657d6b0a31ceb7ac10bedfd5cbd634d4ff47938bd2f321203f0233e53686f7e0fd460e81f82793804895c7e97cfa472c1ca44b93314574262ee8cc5745a3efd0 WHIRLPOOL 785331909f1834cdd5d797ad484ea0e35c3e44c79a8a7517a6fb5de926acd181abd57910c8d960fb2e11ea38ddea336bca309af16fcc2df68fe4b602bca120b3
diff --git a/dev-util/cmake/cmake-3.1.1.ebuild b/dev-util/cmake/cmake-3.1.1.ebuild
new file mode 100644
index 0000000..f9a44ed
--- /dev/null
+++ b/dev-util/cmake/cmake-3.1.1.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/cmake/cmake-3.1.0.ebuild,v 1.1 2015/01/16 20:35:46 johu Exp $
+
+EAPI=5
+
+CMAKE_REMOVE_MODULES="no"
+inherit bash-completion-r1 elisp-common toolchain-funcs eutils versionator cmake-utils virtualx
+
+DESCRIPTION="Cross platform Make"
+HOMEPAGE="http://www.cmake.org/"
+SRC_URI="http://www.cmake.org/files/v$(get_version_component_range 1-2)/${P}.tar.gz"
+
+LICENSE="CMake"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc emacs ncurses qt4 qt5"
+
+REQUIRED_USE="?? ( qt4 qt5 )"
+
+RDEPEND="
+ >=app-arch/libarchive-2.8.0:=
+ >=dev-libs/expat-2.0.1
+ >=net-misc/curl-7.20.0-r1[ssl]
+ sys-libs/zlib
+ virtual/pkgconfig
+ emacs? ( virtual/emacs )
+ ncurses? ( sys-libs/ncurses )
+ qt4? (
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ )
+"
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx )
+"
+
+SITEFILE="50${PN}-gentoo.el"
+
+CMAKE_BINARY="${S}/Bootstrap.cmk/cmake"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.6.3-no-duplicates-in-rpath.patch
+ "${FILESDIR}"/${PN}-2.8.10-darwin-bundle.patch
+ "${FILESDIR}"/${PN}-2.8.10-libform.patch
+ "${FILESDIR}"/${PN}-2.8.10.2-FindPythonLibs.patch
+ "${FILESDIR}"/${PN}-2.8.12.1-FindImageMagick.patch
+ "${FILESDIR}"/${PN}-3.0.0-FindBLAS.patch
+ "${FILESDIR}"/${PN}-3.0.0-FindBoost-python.patch
+ "${FILESDIR}"/${PN}-3.0.0-prefix-dirs.patch
+ "${FILESDIR}"/${PN}-3.0.2-FindLAPACK.patch
+ "${FILESDIR}"/${PN}-3.1.0-darwin-isysroot.patch
+ "${FILESDIR}"/${PN}-3.1.0-FindPythonInterp.patch
+)
+
+cmake_src_bootstrap() {
+ # Cleanup args to extract only JOBS.
+ # Because bootstrap does not know anything else.
+ echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null
+ if [ $? -eq 0 ]; then
+ par_arg=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+')
+ par_arg="--parallel=${par_arg}"
+ else
+ par_arg="--parallel=1"
+ fi
+
+ # execinfo.h on Solaris isn't quite what it is on Darwin
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ sed -i -e 's/execinfo\.h/blablabla.h/' Source/kwsys/CMakeLists.txt || die
+ fi
+
+ tc-export CC CXX LD
+
+ # bootstrap script isn't exactly /bin/sh compatible
+ ${CONFIG_SHELL:-sh} ./bootstrap \
+ --prefix="${T}/cmakestrap/" \
+ ${par_arg} \
+ || die "Bootstrap failed"
+}
+
+cmake_src_test() {
+ # fix OutDir and SelectLibraryConfigurations tests
+ # these are altered thanks to our eclass
+ sed -i -e 's:#IGNORE ::g' \
+ "${S}"/Tests/{OutDir,CMakeOnly/SelectLibraryConfigurations}/CMakeLists.txt \
+ || die
+
+ pushd "${BUILD_DIR}" > /dev/null
+
+ local ctestargs
+ [[ -n ${TEST_VERBOSE} ]] && ctestargs="--extra-verbose --output-on-failure"
+
+ # Excluded tests:
+ # BootstrapTest: we actualy bootstrap it every time so why test it.
+ # CTest.updatecvs, which fails to commit as root
+ # Qt4Deploy, which tries to break sandbox and ignores prefix
+ # TestUpload, which requires network access
+ "${BUILD_DIR}"/bin/ctest ${ctestargs} \
+ -E "(BootstrapTest|CTest.UpdateCVS|Qt4Deploy|TestUpload)" \
+ || die "Tests failed"
+
+ popd > /dev/null
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # disable running of cmake in boostrap command
+ sed -i \
+ -e '/"${cmake_bootstrap_dir}\/cmake"/s/^/#DONOTRUN /' \
+ bootstrap || die "sed failed"
+
+ # Add gcc libs to the default link paths
+ sed -i \
+ -e "s|@GENTOO_PORTAGE_GCCLIBDIR@|${EPREFIX}/usr/${CHOST}/lib/|g" \
+ -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}/|g" \
+ Modules/Platform/{UnixPaths,Darwin}.cmake || die "sed failed"
+
+ cmake_src_bootstrap
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_USE_SYSTEM_LIBRARIES=ON
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}"/usr
+ -DCMAKE_DOC_DIR=/share/doc/${PF}
+ -DCMAKE_MAN_DIR=/share/man
+ -DCMAKE_DATA_DIR=/share/${PN}
+ -DSPHINX_MAN=$(usex doc)
+ -DSPHINX_HTML=$(usex doc)
+ $(cmake-utils_use_build ncurses CursesDialog)
+ )
+
+ if use qt4 || use qt5 ; then
+ mycmakeargs+=(
+ -DBUILD_QtDialog=ON
+ $(cmake-utils_use_find_package qt5 Qt5Widgets)
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ use emacs && elisp-compile Auxiliary/cmake-mode.el
+}
+
+src_test() {
+ VIRTUALX_COMMAND="cmake_src_test" virtualmake
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ if use emacs; then
+ elisp-install ${PN} Auxiliary/cmake-mode.el Auxiliary/cmake-mode.elc
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ insinto /usr/share/vim/vimfiles/syntax
+ doins Auxiliary/cmake-syntax.vim
+
+ insinto /usr/share/vim/vimfiles/indent
+ doins Auxiliary/cmake-indent.vim
+
+ insinto /usr/share/vim/vimfiles/ftdetect
+ doins "${FILESDIR}/${PN}.vim"
+
+ dobashcomp Auxiliary/bash-completion/{${PN},ctest,cpack}
+
+ rm -rf "${D}/usr/share/cmake/{completions,editors}" || die
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/dev-util/cmake/files/50cmake-gentoo.el b/dev-util/cmake/files/50cmake-gentoo.el
new file mode 100644
index 0000000..e4a1a6d
--- /dev/null
+++ b/dev-util/cmake/files/50cmake-gentoo.el
@@ -0,0 +1,4 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'cmake-mode "cmake-mode" "Major mode for editing CMake files." t)
+(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))
+(add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode))
diff --git a/dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch b/dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch
new file mode 100644
index 0000000..ceb205f
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch
@@ -0,0 +1,19 @@
+Patch by Heiko Przybyl
+
+--- Source/cmComputeLinkInformation.cxx
++++ Source/cmComputeLinkInformation.cxx
+@@ -1686,6 +1686,14 @@ std::string cmComputeLinkInformation::Ge
+ for(std::vector<std::string>::const_iterator ri = runtimeDirs.begin();
+ ri != runtimeDirs.end(); ++ri)
+ {
++ // Do not add duplicates.
++ // I'd like to have that check already in the list generation code
++ // but that would need lots of more changes, even in ExpandListArgument().
++ if(*sep != '\0' && (rpath + sep).find(*ri + sep) != std::string::npos)
++ {
++ //std::cerr << "ignoring duplicate: '" << *ri << "' in '" << rpath << "'" << std::endl;
++ continue;
++ }
+ // Separate from previous path.
+ rpath += sep;
+ sep = this->GetRuntimeSep().c_str();
diff --git a/dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch b/dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch
new file mode 100644
index 0000000..9cb4777
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch
@@ -0,0 +1,23 @@
+Don't use .so for modules on darwin/macos. Use .bundle instead.
+Patch by Heiko Przybyl
+
+--- Modules/Platform/Darwin.cmake
++++ Modules/Platform/Darwin.cmake
+@@ -26,7 +26,7 @@
+ set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+ set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+ set(CMAKE_SHARED_MODULE_PREFIX "lib")
+-set(CMAKE_SHARED_MODULE_SUFFIX ".so")
++set(CMAKE_SHARED_MODULE_SUFFIX ".bundle")
+ set(CMAKE_MODULE_EXISTS 1)
+ set(CMAKE_DL_LIBS "")
+
+@@ -48,7 +48,7 @@
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+ set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
+ set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
+-set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
++set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".bundle" ".a")
+
+ # hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
+ # (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
diff --git a/dev-util/cmake/files/cmake-2.8.10-libform.patch b/dev-util/cmake/files/cmake-2.8.10-libform.patch
new file mode 100644
index 0000000..052cc30
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-libform.patch
@@ -0,0 +1,51 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ea1c033..ae479ce 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -395,9 +395,6 @@ macro (CMAKE_BUILD_UTILITIES)
+ else ()
+ set(BUILD_CursesDialog 0)
+ endif ()
+- if(BUILD_CursesDialog)
+- add_subdirectory(Source/CursesDialog/form)
+- endif()
+ endmacro ()
+
+ #-----------------------------------------------------------------------
+diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
+index 96e28b4..4102379 100644
+--- a/Source/CursesDialog/CMakeLists.txt
++++ b/Source/CursesDialog/CMakeLists.txt
+@@ -25,13 +25,16 @@ set( CURSES_SRCS
+ CursesDialog/ccmake
+ )
+
+-include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form
+- ${CMake_BINARY_DIR}/Source/CursesDialog/form)
+ include_directories(${CURSES_INCLUDE_PATH})
+
+
+ add_executable(ccmake ${CURSES_SRCS} )
+ target_link_libraries(ccmake CMakeLib)
+-target_link_libraries(ccmake cmForm)
++TARGET_LINK_LIBRARIES(ccmake form)
++TARGET_LINK_LIBRARIES(ccmake ${CURSES_LIBRARY})
++IF(CURSES_EXTRA_LIBRARY)
++ TARGET_LINK_LIBRARIES(ccmake ${CURSES_EXTRA_LIBRARY})
++ENDIF(CURSES_EXTRA_LIBRARY)
++
+
+ install_targets(/bin ccmake)
+diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h
+index b157a28..f131ea4 100644
+--- a/Source/CursesDialog/cmCursesStandardIncludes.h
++++ b/Source/CursesDialog/cmCursesStandardIncludes.h
+@@ -15,8 +15,6 @@
+ #define _MSE_INT_H
+ #endif
+
+-#include <cmFormConfigure.h>
+-
+ #if defined(__hpux)
+ # define _BOOL_DEFINED
+ # include <sys/time.h>
diff --git a/dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch b/dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch
new file mode 100644
index 0000000..2a83ff7
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch
@@ -0,0 +1,24 @@
+diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
+index bffa9fb..8fc90ee 100644
+--- a/Modules/FindPythonLibs.cmake
++++ b/Modules/FindPythonLibs.cmake
+@@ -74,6 +74,19 @@ set(_Python_VERSIONS
+ ${_PYTHON_FIND_OTHER_VERSIONS}
+ )
+
++# Gentoo portage requires that you use exactly the given python version
++if (CMAKE_BUILD_TYPE STREQUAL Gentoo)
++ execute_process(COMMAND python -c "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
++ OUTPUT_VARIABLE _Gentoo_Python_VERSION)
++ list(FIND _Python_VERSIONS "${_Gentoo_Python_VERSION}" _Gentoo_Python_INDEX)
++ if (_Gentoo_Python_INDEX EQUAL -1)
++ # the current Gentoo python version is not compatible with what is requested
++ set(_Python_VERSIONS)
++ else ()
++ set(_Python_VERSIONS "${_Gentoo_Python_VERSION}")
++ endif ()
++endif()
++
+ unset(_PYTHON_FIND_OTHER_VERSIONS)
+ unset(_PYTHON1_VERSIONS)
+ unset(_PYTHON2_VERSIONS)
diff --git a/dev-util/cmake/files/cmake-2.8.12.1-FindImageMagick.patch b/dev-util/cmake/files/cmake-2.8.12.1-FindImageMagick.patch
new file mode 100644
index 0000000..b094f17
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.12.1-FindImageMagick.patch
@@ -0,0 +1,23 @@
+--- Modules/FindImageMagick.cmake
++++ Modules/FindImageMagick.cmake
+@@ -147,17 +147,17 @@
+ )
+ if(component STREQUAL "Magick++")
+ FIND_IMAGEMAGICK_API(Magick++ Magick++.h
+- Magick++ CORE_RL_Magick++_ Magick++-6.Q16 Magick++-Q16 Magick++-6.Q8 Magick++-Q8 Magick++-6.Q16HDRI Magick++-Q16HDRI Magick++-6.Q8HDRI Magick++-Q8HDRI
++ Magick++ CORE_RL_Magick++_ Magick++-6.Q64 Magick++-6.Q64HDRI Magick++-6.Q32 Magick++-6.Q32HDRI Magick++-6.Q16 Magick++-6.Q16HDRI Magick++-6.Q8 Magick++-6.Q8HDRI
+ )
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_Magick++_LIBRARY)
+ elseif(component STREQUAL "MagickWand")
+ FIND_IMAGEMAGICK_API(MagickWand wand/MagickWand.h
+- Wand MagickWand CORE_RL_wand_ MagickWand-6.Q16 MagickWand-Q16 MagickWand-6.Q8 MagickWand-Q8 MagickWand-6.Q16HDRI MagickWand-Q16HDRI MagickWand-6.Q8HDRI MagickWand-Q8HDRI
++ Wand MagickWand CORE_RL_wand_ MagickWand-6.Q64 MagickWand-6.Q64HDRI MagickWand-6.Q32 MagickWand-6.Q32HDRI MagickWand-6.Q16 MagickWand-6.Q16HDRI MagickWand-6.Q8 MagickWand-6.Q8HDRI
+ )
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY)
+ elseif(component STREQUAL "MagickCore")
+ FIND_IMAGEMAGICK_API(MagickCore magick/MagickCore.h
+- Magick MagickCore CORE_RL_magick_ MagickCore-6.Q16 MagickCore-Q16 MagickCore-6.Q8 MagickCore-Q8 MagickCore-6.Q16HDRI MagickCore-Q16HDRI MagickCore-6.Q8HDRI MagickCore-Q8HDRI
++ Magick MagickCore CORE_RL_magick_ MagickCore-6.Q64 MagickCore-6.Q64HDRI MagickCore-6.Q32 MagickCore-6.Q32HDRI MagickCore-6.Q16 MagickCore-6.Q16HDRI MagickCore-6.Q8 MagickCore-6.Q8HDRI
+ )
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
+ else()
diff --git a/dev-util/cmake/files/cmake-3.0.0-FindBLAS.patch b/dev-util/cmake/files/cmake-3.0.0-FindBLAS.patch
new file mode 100644
index 0000000..86c5dc7
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.0.0-FindBLAS.patch
@@ -0,0 +1,43 @@
+--- Modules/FindBLAS.cmake
++++ Modules/FindBLAS.cmake
+@@ -4,6 +4,10 @@
+ #
+ # Find BLAS library
+ #
++# Version modified for Gentoo Linux.
++# If a valid PkgConfig configuration is found, this overrides and cancels
++# all further checks.
++#
+ # This module finds an installed fortran library that implements the
+ # BLAS linear-algebra interface (see http://www.netlib.org/blas/). The
+ # list of libraries searched for is taken from the autoconf macro file,
+@@ -50,6 +54,23 @@
+ # (To distribute this file outside of CMake, substitute the full
+ # License text for the above reference.)
+
++# first, try PkgConfig
++#
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(PC_BLAS blas)
++if(PC_BLAS_FOUND)
++ foreach(PC_LIB ${PC_BLAS_LIBRARIES})
++ find_library(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_BLAS_LIBRARY_DIRS} )
++ if (NOT ${PC_LIB}_LIBRARY)
++ message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_BLAS_LIBRARY_DIRS}")
++ endif (NOT ${PC_LIB}_LIBRARY)
++ list(APPEND BLAS_LIBRARIES ${${PC_LIB}_LIBRARY})
++ endforeach(PC_LIB)
++ find_package_handle_standard_args(BLAS DEFAULT_MSG BLAS_LIBRARIES)
++ mark_as_advanced(BLAS_LIBRARIES)
++else(PC_BLAS_FOUND)
++message(STATUS "No PkgConfig configuration for BLAS found; starting more extensive search.")
++
+ include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
+ include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
+
+@@ -688,3 +709,5 @@
+ endif()
+
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
++
++endif(PC_BLAS_FOUND)
diff --git a/dev-util/cmake/files/cmake-3.0.0-FindBoost-python.patch b/dev-util/cmake/files/cmake-3.0.0-FindBoost-python.patch
new file mode 100644
index 0000000..a6291d2
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.0.0-FindBoost-python.patch
@@ -0,0 +1,93 @@
+From 934ec9add33d413e4d5c9cec1cb3ebb5cbfd81f4 Mon Sep 17 00:00:00 2001
+From: Michael Palimaka <kensington@gentoo.org>
+Date: Thu, 19 Jun 2014 00:17:48 +1000
+Subject: [PATCH] Fix detection of PYTHON_ABI-versioned Boost Python libraries
+ wrt bug #400969.
+
+---
+ Modules/FindBoost.cmake | 41 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 41 insertions(+)
+
+diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
+index dfd4460..70bfb4f 100644
+--- a/Modules/FindBoost.cmake
++++ b/Modules/FindBoost.cmake
+@@ -952,6 +952,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
+ set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)")
+
++ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
++ # Get version of Python.
++ if (NOT PYTHON_EXECUTABLE)
++ #if a certain version of python was detected by cmake before use that one
++ set(PYTHON_EXECUTABLE "python")
++ endif (NOT PYTHON_EXECUTABLE)
++ execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; sys.stdout.write('.'.join(str(x) for x in sys.version_info[:2]))" OUTPUT_VARIABLE _python_version)
++ endif()
++
+ # Compute component-specific hints.
+ set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
+ if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
+@@ -984,6 +993,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
++ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
++ list(APPEND _boost_RELEASE_NAMES
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version} )
++ endif()
++
+ if(_boost_STATIC_RUNTIME_WORKAROUND)
+ set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
+ list(APPEND _boost_RELEASE_NAMES
+@@ -991,6 +1009,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
++ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
++ list(APPEND _boost_RELEASE_NAMES
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
++ endif()
+ endif()
+ if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
+ _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
+@@ -1020,6 +1045,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
++ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
++ list(APPEND _boost_DEBUG_NAMES
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version} )
++ endif()
+ if(_boost_STATIC_RUNTIME_WORKAROUND)
+ set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
+ list(APPEND _boost_DEBUG_NAMES
+@@ -1027,6 +1061,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
++ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
++ list(APPEND _boost_DEBUG_NAMES
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
++ endif()
+ endif()
+ if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
+ _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
+--
+1.8.5.5
+
diff --git a/dev-util/cmake/files/cmake-3.0.0-prefix-dirs.patch b/dev-util/cmake/files/cmake-3.0.0-prefix-dirs.patch
new file mode 100644
index 0000000..decfb91
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.0.0-prefix-dirs.patch
@@ -0,0 +1,142 @@
+From e7ce3e523f8cfa1bc749118f381753230766827f Mon Sep 17 00:00:00 2001
+From: Michael Palimaka <kensington@gentoo.org>
+Date: Thu, 19 Jun 2014 00:08:13 +1000
+Subject: [PATCH] Set some proper paths to make cmake find our tools.
+
+The ebuild now adds an extra / at the end of $EPREFIX so that it is
+never the empty string (so that CMAKE_SYSTEM_PREFIX_PATH remains
+correct)
+
+Original patch by Heiko Przybyl.
+Updated by Chris Reffett (cmake-2.8.8)
+Updated by Johannes Huber (cmake-2.8.9)
+Updated by Michael Palimaka (cmake-2.8.10)
+Updated by Chris Reffett (cmake-2.8.11)
+Updated by Michael Palimaka (cmake-3.0.0)
+---
+ Modules/Platform/Darwin.cmake | 12 +++++++----
+ Modules/Platform/UnixPaths.cmake | 43 ++++++++++++++++++++--------------------
+ 2 files changed, 29 insertions(+), 26 deletions(-)
+
+diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
+index e25df1e..9b22a6a 100644
+--- a/Modules/Platform/Darwin.cmake
++++ b/Modules/Platform/Darwin.cmake
+@@ -132,9 +132,9 @@ set(CMAKE_C_FRAMEWORK_SEARCH_FLAG -F)
+ set(CMAKE_CXX_FRAMEWORK_SEARCH_FLAG -F)
+ set(CMAKE_Fortran_FRAMEWORK_SEARCH_FLAG -F)
+
+-# default to searching for frameworks first
++# default to searching for frameworks last
+ if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
+- set(CMAKE_FIND_FRAMEWORK FIRST)
++ set(CMAKE_FIND_FRAMEWORK LAST)
+ endif()
+
+ # Older OS X linkers do not report their framework search path
+@@ -156,6 +156,8 @@ endif()
+
+ # set up the default search directories for frameworks
+ set(CMAKE_SYSTEM_FRAMEWORK_PATH
++ @GENTOO_PORTAGE_EPREFIX@Frameworks
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
+ ~/Library/Frameworks
+ )
+ if(_CMAKE_OSX_SYSROOT_PATH)
+@@ -187,13 +189,15 @@ if(CMAKE_OSX_SYSROOT)
+ endif()
+ endif()
+
+-# default to searching for application bundles first
++# default to searching for application bundles last
+ if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
+- set(CMAKE_FIND_APPBUNDLE FIRST)
++ set(CMAKE_FIND_APPBUNDLE LAST)
+ endif()
+ # set up the default search directories for application bundles
+ set(_apps_paths)
+ foreach(_path
++ @GENTOO_PORTAGE_EPREFIX@Applications
++ @GENTOO_PORTAGE_EPREFIX@usr/bin
+ "~/Applications"
+ "/Applications"
+ "${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+
+diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
+index 20ee1d1..3481ca8 100644
+--- a/Modules/Platform/UnixPaths.cmake
++++ b/Modules/Platform/UnixPaths.cmake
+@@ -33,6 +33,7 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+ # search types.
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ # Standard
++ @GENTOO_PORTAGE_EPREFIX@usr/local @GENTOO_PORTAGE_EPREFIX@usr @GENTOO_PORTAGE_EPREFIX@
+ /usr/local /usr /
+
+ # CMake install location
+@@ -53,43 +54,41 @@ endif()
+
+ # List common include file locations not under the common prefixes.
+ list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+- # Windows API on Cygwin
+- /usr/include/w32api
+-
+- # X11
+- /usr/X11R6/include /usr/include/X11
+-
+- # Other
+- /usr/pkg/include
+- /opt/csw/include /opt/include
+- /usr/openwin/include
++ @GENTOO_PORTAGE_EPREFIX@usr/include
+ )
+
+ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+- # Windows API on Cygwin
+- /usr/lib/w32api
+-
+- # X11
+- /usr/X11R6/lib /usr/lib/X11
+-
+- # Other
+- /usr/pkg/lib
+- /opt/csw/lib /opt/lib
+- /usr/openwin/lib
++ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
++ @GENTOO_PORTAGE_GCCLIBDIR@
++ @GENTOO_PORTAGE_EPREFIX@usr/lib64
++ @GENTOO_PORTAGE_EPREFIX@usr/libx32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
++ @GENTOO_PORTAGE_EPREFIX@lib
+ )
+
+ list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+- /usr/pkg/bin
++ @GENTOO_PORTAGE_EPREFIX@usr/bin
++ @GENTOO_PORTAGE_EPREFIX@bin
+ )
+
+ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
++ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
++ @GENTOO_PORTAGE_GCCLIBDIR@
++ @GENTOO_PORTAGE_EPREFIX@usr/lib64
++ @GENTOO_PORTAGE_EPREFIX@usr/libx32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
++ @GENTOO_PORTAGE_EPREFIX@lib
++ /lib /usr/lib /usr/lib32 /usr/lib64 /usr/libx32
+ )
+
+ list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
++ GENTOO_PORTAGE_EPREFIX@usr/include
+ /usr/include
+ )
+ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
++ @GENTOO_PORTAGE_EPREFIX@usr/include
+ /usr/include
+ )
+
+--
+1.8.5.5
+
diff --git a/dev-util/cmake/files/cmake-3.0.2-FindLAPACK.patch b/dev-util/cmake/files/cmake-3.0.2-FindLAPACK.patch
new file mode 100644
index 0000000..57250e4
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.0.2-FindLAPACK.patch
@@ -0,0 +1,43 @@
+--- Modules/FindLAPACK.cmake.orig 2014-09-15 23:50:11.377111987 +0200
++++ Modules/FindLAPACK.cmake 2014-09-15 23:52:54.734388375 +0200
+@@ -4,6 +4,10 @@
+ #
+ # Find LAPACK library
+ #
++# Version modified for Gentoo Linux.
++# If a valid PkgConfig configuration is found, this overrides and cancels
++# all further checks.
++#
+ # This module finds an installed fortran library that implements the
+ # LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
+ #
+@@ -140,6 +144,23 @@
+
+ endmacro()
+
++#
++# first, try PkgConfig
++#
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(PC_LAPACK lapack)
++if(PC_LAPACK_FOUND)
++ foreach(PC_LIB ${PC_LAPACK_LIBRARIES})
++ find_library(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_LAPACK_LIBRARY_DIRS} )
++ if (NOT ${PC_LIB}_LIBRARY)
++ message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_LAPACK_LIBRARY_DIRS}")
++ endif (NOT ${PC_LIB}_LIBRARY)
++ list(APPEND LAPACK_LIBRARIES ${${PC_LIB}_LIBRARY})
++ endforeach(PC_LIB)
++ find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARIES)
++ mark_as_advanced(LAPACK_LIBRARIES)
++else(PC_LAPACK_FOUND)
++message(STATUS "No PkgConfig configuration for LAPACK found; starting more extensive search.")
+
+ set(LAPACK_LINKER_FLAGS)
+ set(LAPACK_LIBRARIES)
+@@ -348,3 +369,5 @@
+ endif()
+
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
++
++endif(PC_LAPACK_FOUND)
diff --git a/dev-util/cmake/files/cmake-3.1.0-FindPythonInterp.patch b/dev-util/cmake/files/cmake-3.1.0-FindPythonInterp.patch
new file mode 100644
index 0000000..78f622d
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.1.0-FindPythonInterp.patch
@@ -0,0 +1,29 @@
+--- Modules/FindPythonInterp.cmake.orig 2015-01-06 11:50:03.376357898 +0100
++++ Modules/FindPythonInterp.cmake 2015-01-06 12:25:48.614989290 +0100
+@@ -75,6 +75,11 @@
+ else()
+ set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
+ endif()
++
++if (CMAKE_BUILD_TYPE STREQUAL Gentoo)
++ set(_Python_NAMES python)
++endif()
++
+ find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
+
+ # Set up the versions we know about, in the order we will search. Always add
+@@ -99,12 +104,13 @@
+ unset(_PYTHON3_VERSIONS)
+
+ # Search for newest python version if python executable isn't found
+-if(NOT PYTHON_EXECUTABLE)
++if(NOT PYTHON_EXECUTABLE AND NOT CMAKE_BUILD_TYPE STREQUAL Gentoo)
+ foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
+ set(_Python_NAMES python${_CURRENT_VERSION})
+ if(WIN32)
+ list(APPEND _Python_NAMES python)
+ endif()
++
+ find_program(PYTHON_EXECUTABLE
+ NAMES ${_Python_NAMES}
+ PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]
diff --git a/dev-util/cmake/files/cmake-3.1.0-darwin-isysroot.patch b/dev-util/cmake/files/cmake-3.1.0-darwin-isysroot.patch
new file mode 100644
index 0000000..119001a
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.1.0-darwin-isysroot.patch
@@ -0,0 +1,48 @@
+Do not detect Xcode and set -isysroot for its SDK, since that messes up
+our toolchain, and hence makes any compilation fail, bug #445308
+
+--- Modules/Platform/Darwin-Initialize.cmake
++++ Modules/Platform/Darwin-Initialize.cmake
+@@ -1,16 +1,16 @@
+ # Ask xcode-select where to find /Developer or fall back to ancient location.
+-execute_process(COMMAND xcode-select -print-path
+- OUTPUT_VARIABLE _stdout
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- ERROR_VARIABLE _stderr
+- RESULT_VARIABLE _failed)
+-if(NOT _failed AND IS_DIRECTORY ${_stdout})
+- set(OSX_DEVELOPER_ROOT ${_stdout})
+-elseif(IS_DIRECTORY "/Developer")
+- set(OSX_DEVELOPER_ROOT "/Developer")
+-else()
++#execute_process(COMMAND xcode-select -print-path
++# OUTPUT_VARIABLE _stdout
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# ERROR_VARIABLE _stderr
++# RESULT_VARIABLE _failed)
++#if(NOT _failed AND IS_DIRECTORY ${_stdout})
++# set(OSX_DEVELOPER_ROOT ${_stdout})
++#elseif(IS_DIRECTORY "/Developer")
++# set(OSX_DEVELOPER_ROOT "/Developer")
++#else()
+ set(OSX_DEVELOPER_ROOT "")
+-endif()
++#endif()
+
+ execute_process(COMMAND sw_vers -productVersion
+ OUTPUT_VARIABLE CURRENT_OSX_VERSION
+@@ -91,10 +91,10 @@
+ # CMAKE_OSX_DEPLOYMENT_TARGET
+
+ # Set cache variable - end user may change this during ccmake or cmake-gui configure.
+-if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+- set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
+- "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
+-endif()
++#if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
++# set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
++# "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
++#endif()
+
+ #----------------------------------------------------------------------------
+ # CMAKE_OSX_SYSROOT
diff --git a/dev-util/cmake/files/cmake.vim b/dev-util/cmake/files/cmake.vim
new file mode 100644
index 0000000..5cecd7d
--- /dev/null
+++ b/dev-util/cmake/files/cmake.vim
@@ -0,0 +1,3 @@
+autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in runtime! indent/cmake.vim
+autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in setf cmake
+autocmd BufRead,BufNewFile *.ctest,*.ctest.in setf cmake
diff --git a/dev-util/cmake/metadata.xml b/dev-util/cmake/metadata.xml
new file mode 100644
index 0000000..a23f444
--- /dev/null
+++ b/dev-util/cmake/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kde</herd>
+</pkgmetadata>