Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: mysql.eclass
Date: Mon, 06 Jul 2009 18:58:43
Message-Id: E1MNtOj-0004ts-3J@stork.gentoo.org
1 robbat2 09/07/06 18:58:41
2
3 Modified: mysql.eclass
4 Log:
5 Take mysql.eclass into the realm of EAPI2.
6
7 Revision Changes Path
8 1.112 eclass/mysql.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mysql.eclass?rev=1.112&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mysql.eclass?rev=1.112&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mysql.eclass?r1=1.111&r2=1.112
13
14 Index: mysql.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v
17 retrieving revision 1.111
18 retrieving revision 1.112
19 diff -p -w -b -B -u -u -r1.111 -r1.112
20 --- mysql.eclass 6 Jul 2009 18:21:18 -0000 1.111
21 +++ mysql.eclass 6 Jul 2009 18:58:41 -0000 1.112
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2007 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.111 2009/07/06 18:21:18 robbat2 Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.112 2009/07/06 18:58:41 robbat2 Exp $
27
28 # Author: Francesco Riosa (Retired) <vivo@g.o>
29 # Maintainer: MySQL Team <mysql-bugs@g.o>
30 @@ -132,8 +132,24 @@ mysql_version_is_at_least "5.1.12" \
31 [ "${MYSQL_COMMUNITY_FEATURES}" == "1" ] \
32 && IUSE="${IUSE} community profiling"
33
34 -EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \
35 - pkg_postinst pkg_config pkg_postrm
36 +case "${EAPI:-0}" in
37 + 2)
38 + EXPORT_FUNCTIONS pkg_setup \
39 + src_unpack src_prepare \
40 + src_configure src_compile \
41 + src_install \
42 + pkg_preinst pkg_postinst \
43 + pkg_config pkg_postrm
44 + ;;
45 + *)
46 + EXPORT_FUNCTIONS pkg_setup \
47 + src_unpack \
48 + src_compile \
49 + src_install \
50 + pkg_preinst pkg_postinst \
51 + pkg_config pkg_postrm
52 + ;;
53 +esac
54
55 #
56 # HELPER FUNCTIONS:
57 @@ -411,7 +427,7 @@ configure_51() {
58 myconf="${myconf} --with-plugins=${plugins}"
59 }
60
61 -pbxt_src_compile() {
62 +pbxt_src_configure() {
63 mysql_init_vars
64
65 pushd "${WORKDIR}/pbxt-${PBXT_VERSION}" &>/dev/null
66 @@ -424,6 +440,13 @@ pbxt_src_compile() {
67 use debug && myconf="${myconf} --with-debug=full"
68 # TODO: is it safe/needed to use econf here ?
69 ./configure ${myconf} || die "Problem configuring PBXT storage engine"
70 +}
71 +
72 +pbxt_src_compile() {
73 + # Be backwards compatible for now
74 + if [[ $EAPI != 2 ]]; then
75 + pbxt_src_configure
76 + fi
77 # TODO: is it safe/needed to use emake here ?
78 make || die "Problem making PBXT storage engine (${myconf})"
79
80 @@ -488,6 +511,14 @@ mysql_src_unpack() {
81 [[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git_src_unpack
82
83 mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}"
84 +
85 + # Be backwards compatible for now
86 + if [[ $EAPI != 2 ]]; then
87 + mysql_src_prepare
88 + fi
89 +}
90 +
91 +mysql_src_prepare() {
92 cd "${S}"
93
94 # Apply the patches for this MySQL version
95 @@ -558,7 +589,7 @@ mysql_src_unpack() {
96 fi
97 }
98
99 -mysql_src_compile() {
100 +mysql_src_configure() {
101 # Make sure the vars are correctly initialized
102 mysql_init_vars
103
104 @@ -613,6 +644,17 @@ mysql_src_compile() {
105 | xargs -0 -n100 sed -i \
106 -e 's|^pkglibdir *= *$(libdir)/mysql|pkglibdir = $(libdir)|;s|^pkgincludedir *= *$(includedir)/mysql|pkgincludedir = $(includedir)|'
107
108 + if [[ $EAPI == 2 ]]; then
109 + mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_configure
110 + fi
111 +}
112 +
113 +mysql_src_compile() {
114 + # Be backwards compatible for now
115 + if [[ $EAPI != 2 ]]; then
116 + mysql_src_configure
117 + fi
118 +
119 emake || die "emake failed"
120
121 mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_compile