public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: remove php4 from depend.php and others
@ 2010-07-09 22:22 Matti Bickel
  2010-07-10  6:30 ` Petteri Räty
  0 siblings, 1 reply; 15+ messages in thread
From: Matti Bickel @ 2010-07-09 22:22 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 397 bytes --]

Hi,

yet another patch from Ole in a bid to rid the php eclasses from some
long forgotten code. The patches should be self-explanatory - just rip
out everything related to dev-php4 :)

Comments welcome.

All the work will go into our overlay (slotting branch:
http://git.overlays.gentoo.org/gitweb/?p=proj/php.git;a=tree;h=refs/heads/slotting;hb=slotting)
before migration to the tree.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 02_remov_php4_from_depend.php.patch --]
[-- Type: text/x-patch; name="02_remov_php4_from_depend.php.patch", Size: 4081 bytes --]

diff --git a/eclass/depend.php.eclass b/eclass/depend.php.eclass
index 681e6dd..c194449 100644
--- a/eclass/depend.php.eclass
+++ b/eclass/depend.php.eclass
@@ -18,57 +18,6 @@
 
 inherit eutils phpconfutils
 
-# PHP4-only depend functions
-
-# @FUNCTION: need_php4_cli
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP4
-# with cli SAPI.
-need_php4_cli() {
-	DEPEND="${DEPEND} =dev-lang/php-4*[cli]"
-	RDEPEND="${RDEPEND} =dev-lang//php-4*[cli]"
-	PHP_VERSION="4"
-}
-
-# @FUNCTION: need_php4_httpd
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP4
-# with either cgi or apache2 SAPI.
-need_php4_httpd() {
-	DEPEND="${DEPEND} =virtual/httpd-php-4*"
-	RDEPEND="${RDEPEND} =virtual/httpd-php-4*"
-	PHP_VERSION="4"
-}
-
-# @FUNCTION: need_php4
-# @DESCRIPTION:
-# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP4
-# (with any SAPI).
-need_php4() {
-	DEPEND="${DEPEND} =dev-lang/php-4*"
-	RDEPEND="${RDEPEND} =dev-lang/php-4*"
-	PHP_VERSION="4"
-	PHP_SHARED_CAT="php4"
-}
-
-# common settings go in here
-uses_php4() {
-	# cache this
-	libdir=$(get_libdir)
-
-	PHPIZE="/usr/${libdir}/php4/bin/phpize"
-	PHPCONFIG="/usr/${libdir}/php4/bin/php-config"
-	PHPCLI="/usr/${libdir}/php4/bin/php"
-	PHPCGI="/usr/${libdir}/php4/bin/php-cgi"
-	PHP_PKG="$(best_version =dev-lang/php-4*)"
-	PHPPREFIX="/usr/${libdir}/php4"
-	EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
-
-	einfo
-	einfo "Using ${PHP_PKG}"
-	einfo
-}
-
 # PHP5-only depend functions
 
 # @FUNCTION: need_php5_cli
@@ -158,7 +107,6 @@ need_php() {
 need_php_by_category() {
 	case "${CATEGORY}" in
 		dev-php) need_php ;;
-		dev-php4) need_php4 ;;
 		dev-php5) need_php5 ;;
 		*) die "Version of PHP required by packages in category ${CATEGORY} unknown"
 	esac
@@ -174,8 +122,6 @@ has_php() {
 	# Detect which PHP version we have installed
 	if has_version '=dev-lang/php-5*' ; then
 		PHP_VERSION="5"
-	elif has_version '=dev-lang/php-4*' ; then
-		PHP_VERSION="4"
 	else
 		die "Unable to find an installed dev-lang/php package"
 	fi
@@ -396,17 +342,6 @@ has_concurrentmodphp() {
 require_pdo() {
 	has_php
 
-	# Do we have PHP5 installed?
-	if [[ "${PHP_VERSION}" == "4" ]] ; then
-		eerror
-		eerror "This package requires PDO."
-		eerror "PDO is only available for PHP 5."
-		eerror "You must install >=dev-lang/php-5.1 with USE=\"pdo\"."
-		eerror "pdo USE flags turned on."
-		eerror
-		die "PHP 5 not installed"
-	fi
-
 	# Was PHP5 compiled with internal PDO support?
 	if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then
 		return
@@ -436,15 +371,6 @@ require_php_cli() {
 
 	local PHP_PACKAGE_FOUND=""
 
-	# Detect which PHP version we have installed
-	if has_version '=dev-lang/php-4*' ; then
-		PHP_PACKAGE_FOUND="1"
-		pkg="$(best_version '=dev-lang/php-4*')"
-		if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then
-			PHP_VERSION="4"
-		fi
-	fi
-
 	if has_version '=dev-lang/php-5*' ; then
 		PHP_PACKAGE_FOUND="1"
 		pkg="$(best_version '=dev-lang/php-5*')"
@@ -480,15 +406,6 @@ require_php_cgi() {
 
 	local PHP_PACKAGE_FOUND=""
 
-	# Detect which PHP version we have installed
-	if has_version '=dev-lang/php-4*' ; then
-		PHP_PACKAGE_FOUND="1"
-		pkg="$(best_version '=dev-lang/php-4*')"
-		if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then
-			PHP_VERSION="4"
-		fi
-	fi
-
 	if has_version '=dev-lang/php-5*' ; then
 		PHP_PACKAGE_FOUND="1"
 		pkg="$(best_version '=dev-lang/php-5*')"
@@ -522,13 +439,6 @@ require_sqlite() {
 		return
 	fi
 
-	# Do we have pecl-sqlite installed for PHP4?
-	if [[ "${PHP_VERSION}" == "4" ]] ; then
-		if has_version 'dev-php4/pecl-sqlite' ; then
-			return
-		fi
-	fi
-
 	# If we get here, then we don't have any SQLite support for PHP installed
 	eerror
 	eerror "No SQLite extension for PHP found."

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 03_removed_all_traces_of_php4.patch --]
[-- Type: text/x-patch; name="03_removed_all_traces_of_php4.patch", Size: 1532 bytes --]

diff --git a/eclass/php-pear-lib-r1.eclass b/eclass/php-pear-lib-r1.eclass
index 5c58dce..f5fdd7f 100644
--- a/eclass/php-pear-lib-r1.eclass
+++ b/eclass/php-pear-lib-r1.eclass
@@ -33,17 +33,7 @@ php-pear-lib-r1_src_install() {
 	addpredict /var/lib/net-snmp/
 	addpredict /session_mm_cli0.sem
 
-	case "${CATEGORY}" in
-		dev-php)
-			if has_version '=dev-lang/php-5*' ; then
-				PHP_BIN="/usr/$(get_libdir)/php5/bin/php"
-			else
-				PHP_BIN="/usr/$(get_libdir)/php4/bin/php"
-			fi ;;
-		dev-php4) PHP_BIN="/usr/$(get_libdir)/php4/bin/php" ;;
-		dev-php5) PHP_BIN="/usr/$(get_libdir)/php5/bin/php" ;;
-		*) die "Version of PHP required by packages in category ${CATEGORY} unknown"
-	esac
+	PHP_BIN="/usr/$(get_libdir)/php5/bin/php"
 
 	cd "${S}"
 
diff --git a/eclass/php-pear-r1.eclass b/eclass/php-pear-r1.eclass
index f1b1c55..d1bb86f 100644
--- a/eclass/php-pear-r1.eclass
+++ b/eclass/php-pear-r1.eclass
@@ -60,17 +60,7 @@ php-pear-r1_src_install() {
 	addpredict /var/lib/net-snmp/
 	addpredict /session_mm_cli0.sem
 
-	case "${CATEGORY}" in
-		dev-php)
-			if has_version '=dev-lang/php-5*' ; then
-				PHP_BIN="/usr/$(get_libdir)/php5/bin/php"
-			else
-				PHP_BIN="/usr/$(get_libdir)/php4/bin/php"
-			fi ;;
-		dev-php4) PHP_BIN="/usr/$(get_libdir)/php4/bin/php" ;;
-		dev-php5) PHP_BIN="/usr/$(get_libdir)/php5/bin/php" ;;
-		*) die "Version of PHP required by packages in category ${CATEGORY} unknown"
-	esac
+	PHP_BIN="/usr/$(get_libdir)/php5/bin/php"
 
 	cd "${S}"
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-07-13  3:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-09 22:22 [gentoo-dev] RFC: remove php4 from depend.php and others Matti Bickel
2010-07-10  6:30 ` Petteri Räty
2010-07-10  8:34   ` Brian Harring
2010-07-10  9:45     ` Allow eclasses to have fluid APIs (was: [gentoo-dev] RFC: remove php4 from depend.php and others) Matti Bickel
2010-07-11  3:02     ` [gentoo-dev] Re: RFC: remove php4 from depend.php and others Ryan Hill
2010-07-11  5:02       ` Doug Goldstein
2010-07-11 12:49         ` Petteri Räty
2010-07-11 16:03           ` Doug Goldstein
2010-07-11 16:37             ` Jorge Manuel B. S. Vicetto
2010-07-11 16:47               ` Petteri Räty
2010-07-11 21:33                 ` Brian Harring
2010-07-11 21:56               ` Doug Goldstein
2010-07-11 23:49                 ` Jorge Manuel B. S. Vicetto
2010-07-12  8:54                 ` Petteri Räty
2010-07-13  3:05                   ` Doug Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox