Gentoo Archives: gentoo-commits

From: "Chris Reffett (creffett)" <creffett@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: cmake-utils.eclass
Date: Mon, 01 Jul 2013 23:30:34
Message-Id: 20130701233026.D89E12171C@flycatcher.gentoo.org
1 creffett 13/07/01 23:30:26
2
3 Modified: cmake-utils.eclass
4 Log:
5 Remove support from cmake-utils.eclass for EAPI 0/1, inline base.eclass functions.
6
7 Revision Changes Path
8 1.97 eclass/cmake-utils.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/cmake-utils.eclass?rev=1.97&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/cmake-utils.eclass?rev=1.97&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/cmake-utils.eclass?r1=1.96&r2=1.97
13
14 Index: cmake-utils.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v
17 retrieving revision 1.96
18 retrieving revision 1.97
19 diff -u -r1.96 -r1.97
20 --- cmake-utils.eclass 14 Jun 2013 21:13:43 -0000 1.96
21 +++ cmake-utils.eclass 1 Jul 2013 23:30:26 -0000 1.97
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2013 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.96 2013/06/14 21:13:43 creffett Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.97 2013/07/01 23:30:26 creffett Exp $
27
28 # @ECLASS: cmake-utils.eclass
29 # @MAINTAINER:
30 @@ -12,8 +12,7 @@
31 # Original author: Zephyrus (zephyrus@××××××.it)
32 # @BLURB: common ebuild functions for cmake-based packages
33 # @DESCRIPTION:
34 -# The cmake-utils eclass is base.eclass(5) wrapper that makes creating ebuilds for
35 -# cmake-based packages much easier.
36 +# The cmake-utils eclass makes creating ebuilds for cmake-based packages much easier.
37 # It provides all inherited features (DOCS, HTML_DOCS, PATCHES) along with out-of-source
38 # builds (default), in-source builds and an implementation of the well-known use_enable
39 # and use_with functions for CMake.
40 @@ -60,19 +59,14 @@
41 CMAKEDEPEND+="${WANT_CMAKE}? ( "
42 ;;
43 esac
44 -inherit toolchain-funcs multilib flag-o-matic base
45 +inherit toolchain-funcs multilib flag-o-matic eutils
46
47 CMAKE_EXPF="src_compile src_test src_install"
48 case ${EAPI:-0} in
49 2|3|4|5) CMAKE_EXPF+=" src_prepare src_configure" ;;
50 - 1|0) eqawarn "${CATEGORY}/${PF}: EAPI 0 and 1 support is now deprecated."
51 - eqawarn "If you are the package maintainer, please"
52 - eqawarn "update this package to a newer EAPI."
53 - eqawarn "Support for EAPI 0-1 for 'cmake-utils.eclass'"
54 - eqawarn "will be dropped at the beginning of July."
55 - ;;
56 -
57 - *) die "Unknown EAPI, Bug eclass maintainers." ;;
58 + 1|0) eerror "cmake-utils no longer supports EAPI 0-1." && die
59 + ;;
60 + *) die "Unknown EAPI, bug eclass maintainers." ;;
61 esac
62 EXPORT_FUNCTIONS ${CMAKE_EXPF}
63
64 @@ -258,8 +252,8 @@
65 # @DESCRIPTION:
66 # Based on use_enable. See ebuild(5).
67 #
68 -# `cmake-utils_use_find_package foo FOO` echoes -DCMAKE_DISABLE_FIND_PACKAGE=OFF
69 -# if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE=ON if it is disabled.
70 +# `cmake-utils_use_find_package foo LibFoo` echoes -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=OFF
71 +# if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled.
72 # This can be used to make find_package optional (since cmake-2.8.6).
73 cmake-utils_use_find_package() { _use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; }
74
75 @@ -362,7 +356,16 @@
76 enable_cmake-utils_src_prepare() {
77 debug-print-function ${FUNCNAME} "$@"
78
79 - base_src_prepare
80 + debug-print "$FUNCNAME: PATCHES=$PATCHES"
81 +
82 + pushd "${S}" > /dev/null
83 + [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
84 +
85 + debug-print "$FUNCNAME: applying user patches"
86 + epatch_user
87 +
88 + popd > /dev/null
89 +
90 }
91
92 # @VARIABLE: mycmakeargs
93 @@ -552,12 +555,26 @@
94
95 _check_build_dir
96 pushd "${BUILD_DIR}" > /dev/null
97 -
98 DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || die "died running ${CMAKE_MAKEFILE_GENERATOR} install"
99 - base_src_install_docs
100 -
101 popd > /dev/null
102
103 + pushd "${S}" > /dev/null
104 + #Install docs, copied from base_src_install_docs
105 + local x
106 +
107 + if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then
108 + for x in "${DOCS[@]}"; do
109 + debug-print "$FUNCNAME: docs: creating document from ${x}"
110 + dodoc "${x}" || die "dodoc failed"
111 + done
112 + fi
113 + if [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then
114 + for x in "${HTML_DOCS[@]}"; do
115 + debug-print "$FUNCNAME: docs: creating html document from ${x}"
116 + dohtml -r "${x}" || die "dohtml failed"
117 + done
118 + fi
119 +
120 # Backward compatibility, for non-array variables
121 if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
122 dodoc ${DOCS} || die "dodoc failed"
123 @@ -565,6 +582,8 @@
124 if [[ -n "${HTML_DOCS}" ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
125 dohtml -r ${HTML_DOCS} || die "dohtml failed"
126 fi
127 +
128 + popd > /dev/null
129 }
130
131 enable_cmake-utils_src_test() {