diff options
| author | Tomas Chvatal <scarabeus@gentoo.org> | 2009-04-04 14:38:38 +0200 |
|---|---|---|
| committer | Tomas Chvatal <scarabeus@gentoo.org> | 2009-04-04 14:39:54 +0200 |
| commit | bb7b2bc4fac028642b6021662393b37e44d8e71a (patch) | |
| tree | 7b39e86885666d1bc3e19a94e929f08078ccce6f | |
| parent | 787c8708cddb735c1b895bbd7b633d3b1fda8d48 (diff) | |
| download | kde-bb7b2bc4fac028642b6021662393b37e44d8e71a.tar.gz kde-bb7b2bc4fac028642b6021662393b37e44d8e71a.tar.bz2 kde-bb7b2bc4fac028642b6021662393b37e44d8e71a.zip | |
remove cmake stuff. it is in the tree.
| -rw-r--r-- | dev-util/cmake/ChangeLog | 10 | ||||
| -rw-r--r-- | dev-util/cmake/Manifest | 8 | ||||
| -rw-r--r-- | dev-util/cmake/cmake-2.6.3-r1.ebuild | 131 | ||||
| -rw-r--r-- | dev-util/cmake/files/50cmake-gentoo.el | 4 | ||||
| -rw-r--r-- | dev-util/cmake/files/cmake-FindJNI.patch | 71 | ||||
| -rw-r--r-- | dev-util/cmake/files/cmake-FindPythonInterp.patch | 12 | ||||
| -rw-r--r-- | dev-util/cmake/files/cmake-FindPythonLibs.patch | 13 | ||||
| -rw-r--r-- | dev-util/cmake/files/cmake.vim | 3 | ||||
| -rw-r--r-- | eclass/cmake-utils.eclass | 359 |
9 files changed, 0 insertions, 611 deletions
diff --git a/dev-util/cmake/ChangeLog b/dev-util/cmake/ChangeLog deleted file mode 100644 index f7689dddc21..00000000000 --- a/dev-util/cmake/ChangeLog +++ /dev/null @@ -1,10 +0,0 @@ -# ChangeLog for dev-util/cmake -# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: $ - - 25 Mar 2009; Maciej Mrozowski (reavertm) <reavertm@poczta.fm> - +files/cmake-FindJNI.patch, cmake-2.6.3-r1.ebuild: - Added FindJNI.cmake patch - to find ibj jdk, fixed Qt4 deps a bit, - reordered variables to ease merging in tools like kdiff3/kompare (SLOT is - usually invariant os let's place it between KEYWORDS and IUSE) - diff --git a/dev-util/cmake/Manifest b/dev-util/cmake/Manifest deleted file mode 100644 index 11703fb313a..00000000000 --- a/dev-util/cmake/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -AUX 50cmake-gentoo.el 244 RMD160 effb4416a5170ed7c99ea74084f2598e2482fdf0 SHA1 c34102f3343980275169144b40af6ec69a87d7fc SHA256 6010e6df84aa23050fcbc490ae2b22802ede0870ff2e96c43fe541e97e0d6c00 -AUX cmake-FindJNI.patch 2020 RMD160 4fcb9714de65eb146a2696cd6613357684515b2d SHA1 c463daa6e7d3a1d7065607f97993b5da3486e7e1 SHA256 c5390550c192aea18415087ed891f7e5192b2a385c9c72f4cda0c19b13f6bfbb -AUX cmake-FindPythonInterp.patch 689 RMD160 77d7bb6e85fff6c54650de68ee241c28f2092bde SHA1 674f9a3ed0fcc2b92f2972cf0856ee2c88d59172 SHA256 b30f9f1d6f3c6100db7e98905f8d919fbb77b8c8bc5528d2f3874cb42eb28065 -AUX cmake-FindPythonLibs.patch 530 RMD160 3e012fbf78d649d6c8111d72d384da3b1b838268 SHA1 0576f44f61465b8403471f0648653226f843d3bd SHA256 1e7bff2a1e999ac877ffeac1414e54e1685c5ef303d698db50d81201029204ab -AUX cmake.vim 217 RMD160 3ac23077646d31e9c29ff32ae2eba20b63c07809 SHA1 527b989aec74eb260c16f93baf189c2e6794b3d8 SHA256 7366c1d45bdcc93efb1954216a5427a5f9df7e98a1f706c357576d7835aaebc5 -DIST cmake-2.6.3.tar.gz 3594959 RMD160 14f0e878844f55a1b3d02837e98087dcaabb16be SHA1 bf34e1661954d808ac3a3eb9d394b69e4d3b1a98 SHA256 3c3af80526a32bc2afed616e8f486b847144f2fa3a8e441908bd39c38b146450 -EBUILD cmake-2.6.3-r1.ebuild 3067 RMD160 8df8b114ba8b1b776959b55e42e56eaf7d75ad23 SHA1 be5665f5b91c29070c3784bc5218069ecdaf2c32 SHA256 1b5846072630a72fb76ba8b57715a0145704d18582340f57ba2046e84b26857f -MISC ChangeLog 443 RMD160 d7b5ff49316832dbe1341ee1b0205029ebc99b83 SHA1 decf83ed748e09bd156b362b10e68da8033ed353 SHA256 e9d9a5b982bad238d273c23893719cc299df2650f596c009e79a382f6949556a diff --git a/dev-util/cmake/cmake-2.6.3-r1.ebuild b/dev-util/cmake/cmake-2.6.3-r1.ebuild deleted file mode 100644 index 11acac9c391..00000000000 --- a/dev-util/cmake/cmake-2.6.3-r1.ebuild +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-util/cmake/cmake-2.6.3.ebuild,v 1.1 2009/03/01 13:13:40 scarabeus Exp $ - -EAPI="2" - -inherit elisp-common toolchain-funcs eutils versionator flag-o-matic cmake-utils - -MY_PV="${PV/rc/RC-}" -MY_P="${PN}-$(replace_version_separator 3 - ${MY_PV})" - -DESCRIPTION="Cross platform Make" -HOMEPAGE="http://www.cmake.org/" -SRC_URI="http://www.cmake.org/files/v$(get_version_component_range 1-2)/${MY_P}.tar.gz" - -LICENSE="CMake" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" -SLOT="0" -IUSE="emacs qt4 vim-syntax" - -DEPEND=" - >=net-misc/curl-7.16.4 - >=dev-libs/expat-2.0.1 - >=dev-libs/libxml2-2.6.28 - >=dev-libs/xmlrpc-c-1.06.09[curl] - emacs? ( virtual/emacs ) - qt4? ( x11-libs/qt-gui:4 ) - vim-syntax? ( - || ( - app-editors/vim - app-editors/gvim - ) - ) -" -RDEPEND="${DEPEND}" - -SITEFILE="50${PN}-gentoo.el" -VIMFILE="${PN}.vim" - -S="${WORKDIR}/${MY_P}" - -CMAKE_IN_SOURCE_BUILD=1 - -PATCHES=( - "${FILESDIR}/${PN}-FindJNI.patch" - "${FILESDIR}/${PN}-FindPythonLibs.patch" - "${FILESDIR}/${PN}-FindPythonInterp.patch" -) - -src_configure() { - local qt_arg par_arg - - if [[ "$(gcc-major-version)" -eq "3" ]] ; then - append-flags "-fno-stack-protector" - fi - - if ! has_version ">=dev-util/cmake-2.4.1" ; then - tc-export CC CXX LD - - if use qt4; then - qt_arg="--qt-gui" - else - qt_arg="--no-qt-gui" - fi - - echo $MAKEOPTS | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null - if [ $? -eq 0 ]; then - par_arg=$(echo $MAKEOPTS | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | egrep -o '[[:digit:]]+') - par_arg="--parallel=${par_arg}" - else - par_arg="--parallel=1" - fi - - ./bootstrap \ - --system-libs \ - --prefix=/usr \ - --docdir=/share/doc/${PF} \ - --datadir=/share/${PN} \ - --mandir=/share/man \ - "$qt_arg" \ - "$par_arg" || die "./bootstrap failed" - else - # this is way much faster so we should preffer it if some cmake is - # around. - use qt4 && qt_arg="ON" || qt_arg="OFF" - mycmakeargs="-DCMAKE_USE_SYSTEM_LIBRARIES=ON - -DCMAKE_DOC_DIR=/share/doc/${PF} - -DCMAKE_MAN_DIR=/share/man - -DCMAKE_DATA_DIR=/share/${PN} - -DBUILD_CursesDialog=ON - -DBUILD_QtDialog=${qt_arg}" - cmake-utils_src_configure - fi -} - -src_compile() { - cmake-utils_src_compile - if use emacs; then - elisp-compile Docs/cmake-mode.el || die "elisp compile failed" - fi -} - -src_test() { - emake test -} - -src_install() { - cmake-utils_src_install - if use emacs; then - elisp-install ${PN} Docs/cmake-mode.el Docs/cmake-mode.elc || die "elisp-install failed" - elisp-site-file-install "${FILESDIR}/${SITEFILE}" - fi - if use vim-syntax; then - insinto /usr/share/vim/vimfiles/syntax - doins "${S}"/Docs/cmake-syntax.vim - - insinto /usr/share/vim/vimfiles/indent - doins "${S}"/Docs/cmake-indent.vim - - insinto /usr/share/vim/vimfiles/ftdetect - doins "${FILESDIR}/${VIMFILE}" - fi -} - -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 deleted file mode 100644 index e4a1a6d47cb..00000000000 --- a/dev-util/cmake/files/50cmake-gentoo.el +++ /dev/null @@ -1,4 +0,0 @@ -(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-FindJNI.patch b/dev-util/cmake/files/cmake-FindJNI.patch deleted file mode 100644 index af723c52919..00000000000 --- a/dev-util/cmake/files/cmake-FindJNI.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff -ru ./Modules/FindJNI.cmake ../a/Modules/FindJNI.cmake ---- ./Modules/FindJNI.cmake 2009-02-21 21:36:50.000000000 +0100 -+++ ../a/Modules/FindJNI.cmake 2008-11-24 04:44:06.000000000 +0100 -@@ -2,7 +2,7 @@ - # This module finds if Java is installed and determines where the - # include files and libraries are. It also determines what the name of - # the library is. This code sets the following variables: --# -+# - # JNI_INCLUDE_DIRS = the include dirs to use - # JNI_LIBRARIES = the libraries to use - # JAVA_AWT_LIBRARY = the path to the jawt library -@@ -51,6 +51,8 @@ - "${dir}" - "${dir}/client" - "${dir}/server" -+ "${dir}/j9vm" -+ "${dir}/classic" - ) - ENDFOREACH(dir) - -@@ -60,7 +62,7 @@ - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include" - $ENV{JAVA_HOME}/include -- /usr/include -+ /usr/include - /usr/local/include - /usr/lib/java/include - /usr/local/lib/java/include -@@ -126,7 +128,7 @@ - ) - ENDIF(JAVA_HAVE_FRAMEWORK) - ELSE(APPLE) -- FIND_LIBRARY(JAVA_AWT_LIBRARY jawt -+ FIND_LIBRARY(JAVA_AWT_LIBRARY jawt - PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES} - ) - FIND_LIBRARY(JAVA_JVM_LIBRARY NAMES jvm JavaVM -@@ -134,18 +136,23 @@ - ) - ENDIF(APPLE) - --# add in the include path --FIND_PATH(JAVA_INCLUDE_PATH jni.h -+# add in the include path -+FIND_PATH(JAVA_INCLUDE_PATH jni.h - ${JAVA_AWT_INCLUDE_DIRECTORIES} - ) - --FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h -+FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h - ${JAVA_AWT_INCLUDE_DIRECTORIES} - ${JAVA_INCLUDE_PATH}/win32 - ${JAVA_INCLUDE_PATH}/linux - ${JAVA_INCLUDE_PATH}/freebsd - ) - -+FIND_PATH(JAVA_INCLUDE_PATH2 jniport.h -+ ${JAVA_AWT_INCLUDE_DIRECTORIES} -+ ${JAVA_INCLUDE_PATH} -+) -+ - FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h - ${JAVA_AWT_INCLUDE_DIRECTORIES} - ${JAVA_INCLUDE_PATH} -@@ -169,4 +176,3 @@ - ${JAVA_INCLUDE_PATH2} - ${JAVA_AWT_INCLUDE_PATH} - ) -- diff --git a/dev-util/cmake/files/cmake-FindPythonInterp.patch b/dev-util/cmake/files/cmake-FindPythonInterp.patch deleted file mode 100644 index f70d4f83d35..00000000000 --- a/dev-util/cmake/files/cmake-FindPythonInterp.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur cmake-2.6.2.orig/Modules/FindPythonInterp.cmake cmake-2.6.2/Modules/FindPythonInterp.cmake ---- cmake-2.6.2.orig/Modules/FindPythonInterp.cmake 2008-09-24 20:34:34.000000000 +0200 -+++ cmake-2.6.2/Modules/FindPythonInterp.cmake 2009-01-03 19:54:21.000000000 +0100 -@@ -7,7 +7,7 @@ - # - - FIND_PROGRAM(PYTHON_EXECUTABLE -- NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python -+ NAMES python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 - PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] diff --git a/dev-util/cmake/files/cmake-FindPythonLibs.patch b/dev-util/cmake/files/cmake-FindPythonLibs.patch deleted file mode 100644 index f473cffd9d1..00000000000 --- a/dev-util/cmake/files/cmake-FindPythonLibs.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- Modules/FindPythonLibs.cmake 2008-05-08 11:18:22.000000000 -0400 -+++ Modules/FindPythonLibs.cmake 2008-05-08 11:18:40.000000000 -0400 -@@ -27,10 +27,6 @@ - NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} - PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs -- PATH_SUFFIXES -- python${_CURRENT_VERSION}/config -- # Avoid finding the .dll in the PATH. We want the .lib. -- NO_SYSTEM_ENVIRONMENT_PATH - ) - - SET(PYTHON_FRAMEWORK_INCLUDES) diff --git a/dev-util/cmake/files/cmake.vim b/dev-util/cmake/files/cmake.vim deleted file mode 100644 index 5cecd7d05b6..00000000000 --- a/dev-util/cmake/files/cmake.vim +++ /dev/null @@ -1,3 +0,0 @@ -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/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass deleted file mode 100644 index 0a22fd65ea7..00000000000 --- a/eclass/cmake-utils.eclass +++ /dev/null @@ -1,359 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.22 2009/03/19 09:12:41 scarabeus Exp $ - -# @ECLASS: cmake-utils.eclass -# @MAINTAINER: -# kde@gentoo.org -# @AUTHORS: -# Tomáš Chvátal <scarabeus@gentoo.org> -# Maciej Mrozowski <reavertm@poczta.fm> -# (undisclosed contributors) -# Original author: Zephyrus (zephyrus@mirach.it) -# @BLURB: common ebuild functions for cmake-based packages -# @DESCRIPTION: -# The cmake-utils eclass contains functions that make creating ebuilds for -# cmake-based packages much easier. -# Its main features are support of out-of-source builds as well as in-source -# builds and an implementation of the well-known use_enable and use_with -# functions for CMake. - -inherit toolchain-funcs multilib flag-o-matic base - -EXPF="src_compile src_test src_install" -case ${EAPI:-0} in - 2) EXPF="${EXPF} src_configure" - ;; - 1|0) ;; - *) die "Unknown EAPI, Bug eclass maintainers." ;; -esac -EXPORT_FUNCTIONS ${EXPF} - -: ${DESCRIPTION:="Based on the ${ECLASS} eclass"} - -if [[ ${PN} != cmake ]]; then - CMAKEDEPEND=">=dev-util/cmake-2.6.2-r1" -fi - -DEPEND="${CMAKEDEPEND} - userland_GNU? ( >=sys-apps/findutils-4.4.0 ) -" - -# Internal functions used by cmake-utils_use_* -_use_me_now() { - debug-print-function ${FUNCNAME} "$@" - - local uper capitalised x - [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" - if [[ ! -z $3 ]]; then - # user specified the use name so use it - echo "-D$1$3=$(use $2 && echo ON || echo OFF)" - else - # use all various most used combinations - uper=$(echo ${2} | tr '[:lower:]' '[:upper:]') - capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g') - for x in $2 $uper $capitalised; do - echo "-D$1$x=$(use $2 && echo ON || echo OFF) " - done - fi -} -_use_me_now_inverted() { - debug-print-function ${FUNCNAME} "$@" - - local uper capitalised x - [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" - if [[ ! -z $3 ]]; then - # user specified the use name so use it - echo "-D$1$3=$(use $2 && echo OFF || echo ON)" - else - # use all various most used combinations - uper=$(echo ${2} | tr '[:lower:]' '[:upper:]') - capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g') - for x in $2 $uper $capitalised; do - echo "-D$1$x=$(use $2 && echo OFF || echo ON) " - done - fi -} - -# @ECLASS-VARIABLE: DOCS -# @DESCRIPTION: -# Documents passed to dodoc command. - -# @ECLASS-VARIABLE: HTML_DOCS -# @DESCRIPTION: -# Documents passed to dohtml command. - -# @ECLASS-VARIABLE: PREFIX -# @DESCRIPTION -# Eclass respects PREFIX variable, though it's not recommended way to set -# install/lib/bin prefixes. -# Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead. - -# @ECLASS-VARIABLE: CMAKE_IN_SOURCE_BUILD -# @DESCRIPTION: -# Set to enable in-source build. - -# @ECLASS-VARIABLE: CMAKE_NO_COLOR -# @DESCRIPTION: -# Set to disable cmake output coloring. - -# @ECLASS-VARIABLE: CMAKE_VERBOSE -# @DESCRIPTION: -# Set to enable verbose messages during compilation. - -# @ECLASS-VARIABLE: CMAKE_BUILD_TYPE -# @DESCRIPTION: -# Set to override default CMAKE_BUILD_TYPE. Only useful for packages -# known to make use of "if (CMAKE_BUILD_TYPE MATCHES xxx)". -# If about to be set - needs to be set before invoking cmake-utils_src_configure. -# You usualy do *NOT* want nor need to set it as it pulls CMake default build-type -# specific compiler flags overriding make.conf. -: ${CMAKE_BUILD_TYPE:=Gentoo} - -# @FUNCTION: _check_build_dir -# @DESCRIPTION: -# Determine using IN or OUT source build -_check_build_dir() { - # in/out source build - if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then - CMAKE_BUILD_DIR="${S}" - else - CMAKE_BUILD_DIR="${WORKDIR}/${PN}_build" - fi - echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\"" -} -# @FUNCTION: cmake-utils_use_with -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on use_with. See ebuild(5). -# -# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled -# and -DWITH_FOO=OFF if it is disabled. -cmake-utils_use_with() { _use_me_now WITH_ "$@" ; } - -# @FUNCTION: cmake-utils_use_enable -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on use_enable. See ebuild(5). -# -# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled -# and -DENABLE_FOO=OFF if it is disabled. -cmake-utils_use_enable() { _use_me_now ENABLE_ "$@" ; } - -# @FUNCTION: cmake-utils_use_disable -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on inversion of use_enable. See ebuild(5). -# -# `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled -# and -DDISABLE_FOO=ON if it is disabled. -cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; } - -# @FUNCTION: cmake-utils_use_no -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on use_disable. See ebuild(5). -# -# `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled -# and -DNO_FOO=ON if it is disabled. -cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; } - -# @FUNCTION: cmake-utils_use_want -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on use_enable. See ebuild(5). -# -# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled -# and -DWANT_FOO=OFF if it is disabled. -cmake-utils_use_want() { _use_me_now WANT_ "$@" ; } - -# @FUNCTION: cmake-utils_use_build -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on use_enable. See ebuild(5). -# -# `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled -# and -DBUILD_FOO=OFF if it is disabled. -cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; } - -# @FUNCTION: cmake-utils_use_has -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on use_enable. See ebuild(5). -# -# `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled -# and -DHAVE_FOO=OFF if it is disabled. -cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; } - -# @FUNCTION: cmake-utils_has -# @DESCRIPTION: -# Deprecated, use cmake-utils_use_has, kept now for backcompat. -cmake-utils_has() { ewarn "QA notice: using deprecated ${FUNCNAME} call, use cmake-utils_use_has instead." ; _use_me_now HAVE_ "$@" ; } - -# @FUNCTION: cmake-utils_use -# @USAGE: <USE flag> [flag name] -# @DESCRIPTION: -# Based on use_enable. See ebuild(5). -# -# `cmake-utils_use foo FOO` echoes -DFOO=ON if foo is enabled -# and -DFOO=OFF if it is disabled. -cmake-utils_use() { _use_me_now "" "$@" ; } - -# Internal function for modifying hardcoded definitions. -# Removes dangerous definitionts that override Gentoo settings. -_modify-cmakelists() { - debug-print-function ${FUNCNAME} "$@" - - # Comment out all set (<some_should_be_user_defined_variable> value) - # TODO Add QA checker - inform when variable being checked for below is set in CMakeLists.txt - find "${S}" -name CMakeLists.txt \ - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE.*)/{s/^/#IGNORE /g}' {} + \ - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX.*)/{s/^/#IGNORE /g}' {} + \ - || die "${LINENO}: failed to disable hardcoded settings" - - # NOTE Append some useful summary here - echo ' -MESSAGE(STATUS "<<< Gentoo configuration >>> -Build type: ${CMAKE_BUILD_TYPE} -Install path: ${CMAKE_INSTALL_PREFIX}\n")' >> CMakeLists.txt -} - -# @FUNCTION: cmake-utils_src_configure -# @DESCRIPTION: -# General function for configuring with cmake. Default behaviour is to start an -# out-of-source build. -cmake-utils_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - # Remove dangerous things. - _modify-cmakelists - - # @SEE CMAKE_BUILD_TYPE - if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then - # Handle release builds - if ! has debug ${IUSE//+} || ! use debug; then - append-cppflags -DNDEBUG - fi - fi - - # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS) - local build_rules="${TMPDIR}"/gentoo_rules.cmake -cat > ${build_rules} << _EOF_ -SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE) -SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE) -SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE) -SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE) -_EOF_ - - # Common configure parameters (overridable) - # NOTE CMAKE_BUILD_TYPE can be only overriden via CMAKE_BUILD_TYPE eclass variable - # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect. - local cmakeargs=" - -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr} - ${mycmakeargs} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_DO_STRIP=OFF - -DCMAKE_USER_MAKE_RULES_OVERRIDE=${build_rules}" - - # Common configure parameters (invariants) - local common_config="${TMPDIR}"/gentoo_common_config.cmake - local libdir=$(get_libdir) -cat > ${common_config} << _EOF_ -SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE) -_EOF_ - [[ -n ${CMAKE_NO_COLOR} ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> ${common_config} - cmakeargs="-C ${common_config} ${cmakeargs}" - - _check_build_dir - mkdir -p "${CMAKE_BUILD_DIR}" - pushd "${CMAKE_BUILD_DIR}" > /dev/null - debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is $cmakeargs" - cmake ${cmakeargs} "${S}" || die "cmake failed" - - popd > /dev/null -} - -# @FUNCTION: cmake-utils_src_compile -# @DESCRIPTION: -# General function for compiling with cmake. Default behaviour is to check for -# EAPI and respectively to configure as well or just compile. -cmake-utils_src_compile() { - debug-print-function ${FUNCNAME} "$@" - - has src_configure ${EXPF} || cmake-utils_src_configure - cmake-utils_src_make "$@" -} - -# @FUNCTION: cmake-utils_src_configurein -# @DESCRIPTION: -# Deprecated -cmake-utils_src_configurein() { - ewarn "QA notice: using deprecated ${FUNCNAME} call, set CMAKE_IN_SOURCE_BUILD=1 instead." - cmake-utils_src_configure -} - -# @FUNCTION: cmake-utils_src_configureout -# @DESCRIPTION: -# Deprecated -cmake-utils_src_configureout() { - ewarn "QA notice: using deprecated ${FUNCNAME} call, out of source build is enabled by default." - cmake-utils_src_configure -} - -# @FUNCTION: cmake-utils_src_make -# @DESCRIPTION: -# Function for building the package. Automatically detects the build type. -# All arguments are passed to emake: -cmake-utils_src_make() { - debug-print-function ${FUNCNAME} "$@" - - _check_build_dir - pushd "${CMAKE_BUILD_DIR}" > /dev/null - if [[ -n ${CMAKE_VERBOSE} ]]; then - emake VERBOSE=1 "$@" || die "Make failed!" - else - emake "$@" || die "Make failed!" - fi - popd > /dev/null -} - -# @FUNCTION: cmake-utils_src_install -# @DESCRIPTION: -# Function for installing the package. Automatically detects the build type. -cmake-utils_src_install() { - debug-print-function ${FUNCNAME} "$@" - - _check_build_dir - pushd "${CMAKE_BUILD_DIR}" > /dev/null - emake install DESTDIR="${D}" || die "Make install failed" - popd > /dev/null - - # Manual document installation - [[ -n "${DOCS}" ]] && { dodoc ${DOCS} || die "dodoc failed" ; } - [[ -n "${HTML_DOCS}" ]] && { dohtml -r ${HTML_DOCS} || die "dohtml failed" ; } -} - -# @FUNCTION: cmake-utils_src_test -# @DESCRIPTION: -# Function for testing the package. Automatically detects the build type. -cmake-utils_src_test() { - debug-print-function ${FUNCNAME} "$@" - - _check_build_dir - pushd "${CMAKE_BUILD_DIR}" > /dev/null - # Standard implementation of src_test - if emake -j1 check -n &> /dev/null; then - einfo ">>> Test phase [check]: ${CATEGORY}/${PF}" - if ! emake -j1 check; then - die "Make check failed. See above for details." - fi - elif emake -j1 test -n &> /dev/null; then - einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" - if ! emake -j1 test; then - die "Make test failed. See above for details." - fi - else - einfo ">>> Test phase [none]: ${CATEGORY}/${PF}" - fi - popd > /dev/null -} |
