aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsunpoet <sunpoet@FreeBSD.org>2012-07-12 04:11:48 +0800
committersunpoet <sunpoet@FreeBSD.org>2012-07-12 04:11:48 +0800
commitf08f8687e6eb3c26fb83a1372850b1b0e57e15ed (patch)
treecba16029fcf900c14262727a3b010f91c753f11a
parent6418ffdb3970b47b8d972a8269bf70340e785749 (diff)
downloadfreebsd-ports-gnome-f08f8687e6eb3c26fb83a1372850b1b0e57e15ed.tar.gz
freebsd-ports-gnome-f08f8687e6eb3c26fb83a1372850b1b0e57e15ed.tar.zst
freebsd-ports-gnome-f08f8687e6eb3c26fb83a1372850b1b0e57e15ed.zip
- Fix build with lang/php5 (PHP 5.4)
- Convert to new options framework - Cosmetic change - Take maintainership Obtained from: http://svn.php.net/viewvc?view=revision&revision=319585
-rw-r--r--databases/pecl-memcache/Makefile19
-rw-r--r--databases/pecl-memcache/files/patch-memcache.c74
-rw-r--r--databases/pecl-memcache/files/patch-php_memcache.h20
3 files changed, 104 insertions, 9 deletions
diff --git a/databases/pecl-memcache/Makefile b/databases/pecl-memcache/Makefile
index ec36214a4a13..9107a58466c2 100644
--- a/databases/pecl-memcache/Makefile
+++ b/databases/pecl-memcache/Makefile
@@ -13,23 +13,24 @@ PKGNAMEPREFIX= pecl-
EXTRACT_SUFX= .tgz
DIST_SUBDIR= PECL
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Memcached extension
+OPTIONS_DEFINE= EXAMPLES
+
+CONFIGURE_ARGS= --with-zlib-dir=/usr
+USE_DOS2UNIX= yes
USE_PHP= zlib session
USE_PHP_BUILD= yes
-USE_PHPIZE= yes
USE_PHPEXT= yes
-PHP_MODNAME= memcache
-
-USE_DOS2UNIX= yes
+USE_PHPIZE= yes
-CONFIGURE_ARGS= --with-zlib-dir=/usr
+.include <bsd.port.options.mk>
-.if !defined(NOPORTEXAMPLES)
post-install:
- @${MKDIR} ${EXAMPLESDIR}
- ${INSTALL_DATA} ${WRKSRC}/example.php ${EXAMPLESDIR}
+.if ${PORT_OPTIONS:MEXAMPLES}
+ ${MKDIR} ${EXAMPLESDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/example.php ${EXAMPLESDIR}/
.endif
.include <bsd.port.mk>
diff --git a/databases/pecl-memcache/files/patch-memcache.c b/databases/pecl-memcache/files/patch-memcache.c
new file mode 100644
index 000000000000..a7c75dff2253
--- /dev/null
+++ b/databases/pecl-memcache/files/patch-memcache.c
@@ -0,0 +1,74 @@
+--- memcache.c.orig 2011-04-11 12:56:53.000000000 +0800
++++ memcache.c 2012-05-17 02:00:58.108724781 +0800
+@@ -718,7 +718,7 @@
+ mmc_server_free(mmc TSRMLS_CC);
+ mmc = NULL;
+ } else {
+- zend_list_insert(mmc, le_memcache_server);
++ MEMCACHE_LIST_INSERT(mmc, le_memcache_server);
+ }
+ }
+ else if (le->type != le_memcache_server || le->ptr == NULL) {
+@@ -735,7 +735,7 @@
+ mmc = NULL;
+ }
+ else {
+- zend_list_insert(mmc, le_memcache_server);
++ MEMCACHE_LIST_INSERT(mmc, le_memcache_server);
+ }
+ }
+ else {
+@@ -775,7 +775,7 @@
+ if (zend_hash_find(Z_OBJPROP_P(mmc_object), "connection", sizeof("connection"), (void **)&connection) == FAILURE) {
+ pool = mmc_pool_new(TSRMLS_C);
+ pool->failure_callback = &php_mmc_failure_callback;
+- list_id = zend_list_insert(pool, le_memcache_pool);
++ list_id = MEMCACHE_LIST_INSERT(pool, le_memcache_pool);
+ add_property_resource(mmc_object, "connection", list_id);
+ }
+ else {
+@@ -836,7 +836,7 @@
+ int list_id;
+ mmc_pool_t *pool = mmc_pool_new(TSRMLS_C);
+ pool->failure_callback = &php_mmc_failure_callback;
+- list_id = zend_list_insert(pool, le_memcache_pool);
++ list_id = MEMCACHE_LIST_INSERT(pool, le_memcache_pool);
+ mmc_object = return_value;
+ object_init_ex(mmc_object, memcache_ce);
+ add_property_resource(mmc_object, "connection", list_id);
+@@ -986,7 +986,7 @@
+
+ /* check for userspace callback */
+ if (param != NULL && zend_hash_find(Z_OBJPROP_P((zval *)param), "_failureCallback", sizeof("_failureCallback"), (void **)&callback) == SUCCESS && Z_TYPE_PP(callback) != IS_NULL) {
+- if (IS_CALLABLE(*callback, 0, NULL)) {
++ if (MEMCACHE_IS_CALLABLE(*callback, 0, NULL)) {
+ zval *retval = NULL;
+ zval *host, *tcp_port, *udp_port, *error, *errnum;
+ zval **params[5];
+@@ -1213,7 +1213,7 @@
+ }
+
+ if (failure_callback != NULL && Z_TYPE_P(failure_callback) != IS_NULL) {
+- if (!IS_CALLABLE(failure_callback, 0, NULL)) {
++ if (!MEMCACHE_IS_CALLABLE(failure_callback, 0, NULL)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid failure callback");
+ RETURN_FALSE;
+ }
+@@ -1275,7 +1275,7 @@
+ }
+
+ if (failure_callback != NULL && Z_TYPE_P(failure_callback) != IS_NULL) {
+- if (!IS_CALLABLE(failure_callback, 0, NULL)) {
++ if (!MEMCACHE_IS_CALLABLE(failure_callback, 0, NULL)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid failure callback");
+ RETURN_FALSE;
+ }
+@@ -1340,7 +1340,7 @@
+ }
+
+ if (Z_TYPE_P(failure_callback) != IS_NULL) {
+- if (!IS_CALLABLE(failure_callback, 0, NULL)) {
++ if (!MEMCACHE_IS_CALLABLE(failure_callback, 0, NULL)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid failure callback");
+ RETURN_FALSE;
+ }
diff --git a/databases/pecl-memcache/files/patch-php_memcache.h b/databases/pecl-memcache/files/patch-php_memcache.h
new file mode 100644
index 000000000000..8d9b73cda41d
--- /dev/null
+++ b/databases/pecl-memcache/files/patch-php_memcache.h
@@ -0,0 +1,20 @@
+--- php_memcache.h.orig 2012-05-17 02:01:32.293725097 +0800
++++ php_memcache.h 2012-05-17 02:03:47.294725872 +0800
+@@ -72,9 +72,15 @@
+ #define MMC_DEFAULT_CACHEDUMP_LIMIT 100 /* number of entries */
+
+ #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3)
+-# define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC)
++# define MEMCACHE_IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC)
+ #else
+-# define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp))
++# define MEMCACHE_IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp))
++#endif
++
++#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 4)
++# define MEMCACHE_LIST_INSERT(item, list) zend_list_insert(item, list TSRMLS_CC);
++#else
++# define MEMCACHE_LIST_INSERT(item, list) zend_list_insert(item, list);
+ #endif
+
+ /* internal functions */