/[gentoo-x86]/eclass/phpconfutils.eclass
Gentoo

Diff of /eclass/phpconfutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.6
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/phpconfutils.eclass,v 1.2 2006/04/18 12:21:14 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/phpconfutils.eclass,v 1.6 2007/09/01 15:58:17 jokey Exp $
4# 4#
5# ######################################################################## 5# ########################################################################
6# 6#
7# eclass/phpconfutils.eclass
8# Utility functions to help with configuring PHP
9#
10# Based on stuart's work on the original confutils eclass 7# Based on Stuart's work on the original confutils eclass
11# 8#
12# Author(s) Luca Longinotti 9# Author(s): Luca Longinotti <chtekk@gentoo.org>
13# <chtekk@gentoo.org>
14# 10#
15# Maintained by the PHP Herd <php-bugs@gentoo.org>
16#
17# ======================================================================== 11# ========================================================================
18 12
19if [[ "${EBUILD_SUPPORTS_SHAREDEXT}" == "1" ]] ; then 13# @ECLASS: phpconfutils.eclass
20 IUSE="sharedext" 14# @MAINTAINER:
21fi 15# Gentoo PHP team <php-bugs@gentoo.org>
16# @BLURB: Provides utility functions to help with configuring PHP.
17# @DESCRIPTION:
18# This eclass provides utility functions to help with configuring PHP.
19# It is only used by other php eclasses currently and the functions
20# are not generally intended for direct use in ebuilds.
21
22 22
23# ======================================================================== 23# ========================================================================
24# List of USE flags that need deps that aren't yet in Portage 24# List of USE flags that need deps that aren't yet in Portage
25# or that can't be (fex. certain commercial apps) 25# or that can't be (fex. certain commercial apps)
26# 26#
27# You must define CONFUTILS_MISSING_DEPS if you need this 27# You must define PHPCONFUTILS_MISSING_DEPS if you need this
28 28
29# ======================================================================== 29# ========================================================================
30# phpconfutils_sort_flags() 30# phpconfutils_sort_flags()
31# 31#
32# Sort and remove duplicates of the auto-enabled USE flags 32# Sort and remove duplicates of the auto-enabled USE flags
44# this eclass first 44# this eclass first
45# 45#
46 46
47phpconfutils_init() { 47phpconfutils_init() {
48 # Define wheter we shall support shared extensions or not 48 # Define wheter we shall support shared extensions or not
49 if [[ "${EBUILD_SUPPORTS_SHAREDEXT}" == "1" ]] && useq "sharedext" ; then 49 if useq "sharedext" ; then
50 shared="=shared" 50 shared="=shared"
51 else 51 else
52 shared="" 52 shared=""
53 fi 53 fi
54 54
91 shift 91 shift
92 local fail_msg="$1" 92 local fail_msg="$1"
93 shift 93 shift
94 94
95 local required_flags="$@" 95 local required_flags="$@"
96 local default_flag="$1"
96 local success="0" 97 local success="0"
97 98
98 while [[ -n "$1" ]] ; do 99 while [[ -n "$1" ]] ; do
99 if useq "$1" ; then 100 if useq "$1" ; then
100 einfo "${success_msg} $1" 101 einfo "${success_msg} $1"
101 success="1" 102 success="1"
102 else 103 else
103 ewarn "${fail_msg} $1" 104 einfo "${fail_msg} $1"
104 fi 105 fi
105 shift 106 shift
106 done 107 done
107 108
108 # Did we find what we are looking for? 109 # Did we find what we are looking for?
110 return 111 return
111 fi 112 fi
112 113
113 # If we get here, then none of the required USE flags were enabled 114 # If we get here, then none of the required USE flags were enabled
114 eerror 115 eerror
115 eerror "You *must* enable one or more of the following USE flags:" 116 eerror "You should enable one or more of the following USE flags:"
116 eerror " ${required_flags}" 117 eerror " ${required_flags}"
117 eerror 118 eerror
118 eerror "You can do this by enabling these flags in /etc/portage/package.use:" 119 eerror "You can do this by enabling these flags in /etc/portage/package.use:"
119 eerror " =${CATEGORY}/${PN}-${PVR} ${required_flags}" 120 eerror " =${CATEGORY}/${PN}-${PVR} ${required_flags}"
120 eerror 121 eerror
121 die "Missing USE flags found" 122 eerror "The ${default_flag} USE flag was automatically enabled now."
123 eerror
124 PHPCONFUTILS_AUTO_USE="${PHPCONFUTILS_AUTO_USE} ${default_flag}"
122} 125}
123 126
124# ======================================================================== 127# ========================================================================
125# phpconfutils_use_conflict() 128# phpconfutils_use_conflict()
126# 129#
391 phpconfutils_sort_flags 394 phpconfutils_sort_flags
392 395
393 local x 396 local x
394 local my_found="0" 397 local my_found="0"
395 398
396 for x in ${CONFUTILS_MISSING_DEPS} ; do 399 for x in ${PHPCONFUTILS_MISSING_DEPS} ; do
397 if useq "${x}" || phpconfutils_usecheck "${x}" ; then 400 if useq "${x}" || phpconfutils_usecheck "${x}" ; then
398 ewarn "USE flag ${x} enables support for software not present in Portage!" 401 ewarn "USE flag ${x} enables support for software not present in Portage!"
399 my_found="1" 402 my_found="1"
400 fi 403 fi
401 done 404 done
407 ewarn "fail to compile later on." 410 ewarn "fail to compile later on."
408 ewarn "*DO NOT* file bugs about compile failures or issues you're having" 411 ewarn "*DO NOT* file bugs about compile failures or issues you're having"
409 ewarn "when using one of those flags, as we aren't able to support them." 412 ewarn "when using one of those flags, as we aren't able to support them."
410 ewarn "|=|=|=|=|=|=| You are on your own if you use them! |=|=|=|=|=|=|" 413 ewarn "|=|=|=|=|=|=| You are on your own if you use them! |=|=|=|=|=|=|"
411 ewarn 414 ewarn
412 sleep 5 415 ebeep 5
413 fi 416 fi
414} 417}
415 418
416# ======================================================================== 419# ========================================================================
417# phpconfutils_built_with_use() 420# phpconfutils_built_with_use()

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20