Sun Mar 21 16:57:13 2010 UTC ()
Add php-intl package, using PECL version 1.1.1, modified to compile with
both PHP 5.3.2 and PHP 5.3.12

compile tested on Mac OS X 10.6.2 and NetBSD 5.0.1

This module is an internationalization extension, enabling PHP programmers
to perform UCA-conformant collation and date/time/number/currency formatting
in their scripts.

It tends to closely follow ICU APIs, so that people having experience
working with ICU in either C/C++ or Java could easily use the PHP
API. Also, this way ICU documentation would be useful to understand
various ICU functions.

Intl consists of several modules, each of them exposes the corresponding ICU
API:
    * Collator: provides string comparison capability with support
      for appropriate locale-sensitive sort orderings.
    * Number Formatter: allows to display number according to the
      localized format or given pattern or set of rules, and to parse
      strings into numbers.
    * Message Formatter: allows to create messages incorporating
      data (such as numbers or dates) formatted according to given
      pattern and locale rules, and parse messages extracting data
      from them.
    * Normalizer: provides a function to transform text into one
      of the Unicode normalization forms, and provides a routine to
      test if a given string is already normalized.
    * Locale: provides interaction with locale identifiers in the
      form of functions to get subtags from locale identifier; parse,
      compose, match(lookup and filter) locale identifiers.

Status:

Vendor Tag:	TNF
Release Tags:	pkgsrc-base


(jdolecek)
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/DESCR
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/distinfo
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/Makefile
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-aa
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-ab
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-ac
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-ad
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-ae
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-af
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-ag
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-ah
diff -r0 -r1.1.1.1 pkgsrc/textproc/php-intl/patches/patch-aj

File Added: pkgsrc/textproc/php-intl/DESCR
PHP is a programming language designed to be embedded into web pages.

This module is an internationalization extension, enabling PHP programmers
to perform UCA-conformant collation and date/time/number/currency formatting
in their scripts.

It tends to closely follow ICU APIs, so that people having experience
working with ICU in either C/C++ or Java could easily use the PHP
API. Also, this way ICU documentation would be useful to understand
various ICU functions.

Intl consists of several modules, each of them exposes the corresponding ICU
API:
    * Collator: provides string comparison capability with support
      for appropriate locale-sensitive sort orderings.
    * Number Formatter: allows to display number according to the
      localized format or given pattern or set of rules, and to parse
      strings into numbers.
    * Message Formatter: allows to create messages incorporating
      data (such as numbers or dates) formatted according to given
      pattern and locale rules, and parse messages extracting data
      from them.
    * Normalizer: provides a function to transform text into one
      of the Unicode normalization forms, and provides a routine to
      test if a given string is already normalized.
    * Locale: provides interaction with locale identifiers in the
      form of functions to get subtags from locale identifier; parse,
      compose, match(lookup and filter) locale identifiers.

File Added: pkgsrc/textproc/php-intl/Attic/distinfo
$NetBSD: distinfo,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

SHA1 (php-intl/intl-1.1.1.tgz) = 052d43b57fea9a3193fe577c9aaa619f6c7508b0
RMD160 (php-intl/intl-1.1.1.tgz) = 74abe4582aafe9f9bc3da41936fd0116c271ef8b
Size (php-intl/intl-1.1.1.tgz) = 142269 bytes
SHA1 (patch-aa) = 7a44fab01351f8f810c8b906f5fcb0ea9dd4160c
SHA1 (patch-ab) = 01b4fa84d71319f29e0869f25e0dd1be869eaad0
SHA1 (patch-ac) = 635ac309125521018a13dbb84d741210e80fe635
SHA1 (patch-ad) = 3e09a48471dcf6fcfdcfca295dac778814fd2bd1
SHA1 (patch-ae) = 750d9284f86a730fce7733ce488cbb4ae13983ce
SHA1 (patch-af) = 815006577c08b1cab7f0e5e601770f786c61c910
SHA1 (patch-ag) = 66db6e293f9eb9e81ccd6f8055aed2e036791247
SHA1 (patch-ah) = 024f97675087d3f282e6cd8af059179ea7faea60
SHA1 (patch-aj) = edb43a597a43db653af7be4d3066bf9bd376e8be

File Added: pkgsrc/textproc/php-intl/Makefile
# $NetBSD: Makefile,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

MODNAME=		intl
PECL_VERSION=		1.1.1
CATEGORIES+=		textproc
COMMENT=		PHP extension for i18n

PHP_VERSIONS_ACCEPTED=	5

PKG_DESTDIR_SUPPORT=	user-destdir

CONFIGURE_ARGS+=	--enable-${MODNAME}=shared,${BUILDLINK_DIR}

USE_LANGUAGES+=		c c++

.include "../../lang/php/ext.mk"
.include "../../textproc/icu/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-aa
$NetBSD: patch-aa,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- php_intl.h.orig	2010-03-15 23:03:31.000000000 +0100
+++ php_intl.h
@@ -65,6 +65,12 @@ PHP_MINFO_FUNCTION(intl);
 
 #define PHP_INTL_VERSION "1.0.3"
 
+#if (PHP_VERSION_ID >= 50300)
+#  define PHP_INTL_ZEND_ARG_STATIC
+#else
+#  define PHP_INTL_ZEND_ARG_STATIC static
+#  define Z_DELREF_P(object)	(object)->refcount--
+#endif
 #endif  /* PHP_INTL_H */
 
 /*

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-ab
$NetBSD: patch-ab,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- collator/collator_class.c.orig	2010-03-11 00:13:52.000000000 +0100
+++ collator/collator_class.c
@@ -88,22 +88,22 @@ zend_object_value Collator_object_create
        modify approptiate 'collator_XX_args' for
        the procedural API.
 */
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( collator_0_args, 0, 0, 0 )
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( collator_1_arg, 0, 0, 1 )
 	ZEND_ARG_INFO( 0, arg1 )
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( collator_2_args, 0, 0, 2 )
 	ZEND_ARG_INFO( 0, arg1 )
 	ZEND_ARG_INFO( 0, arg2 )
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( collator_sort_args, 0, 0, 1 )
 	ZEND_ARG_ARRAY_INFO( 1, arr, 0 )
 	ZEND_ARG_INFO( 0, flags )

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-ac
$NetBSD: patch-ac,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- dateformat/dateformat_class.c.orig	2010-03-11 00:19:56.000000000 +0100
+++ dateformat/dateformat_class.c
@@ -84,42 +84,43 @@ zend_object_value IntlDateFormatter_obje
  */
 
 /* {{{ arginfo */
-static ZEND_BEGIN_ARG_INFO_EX(datefmt_parse_args, 0, 0, 1)
+PHP_INTL_ZEND_ARG_STATIC
+ZEND_BEGIN_ARG_INFO_EX(datefmt_parse_args, 0, 0, 1)
 		ZEND_ARG_INFO(0, string)
 		ZEND_ARG_INFO(1, position)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_intldateformatter_format, 0, 0, 0)
 	ZEND_ARG_INFO(0, args)
 	ZEND_ARG_INFO(0, array)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO(arginfo_intldateformatter_getdatetype, 0)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_intldateformatter_settimezoneid, 0, 0, 1)
 	ZEND_ARG_INFO(0, zone)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_intldateformatter_setpattern, 0, 0, 1)
 	ZEND_ARG_INFO(0, pattern)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_intldateformatter_setlenient, 0, 0, 1)
 	ZEND_ARG_INFO(0, lenient)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_intldateformatter_setcalendar, 0, 0, 1)
 	ZEND_ARG_INFO(0, which)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_intldateformatter___construct, 0, 0, 3)
 	ZEND_ARG_INFO(0, locale)
 	ZEND_ARG_INFO(0, datetype)

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-ad
$NetBSD: patch-ad,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- formatter/formatter_class.c.orig	2010-03-11 00:17:19.000000000 +0100
+++ formatter/formatter_class.c
@@ -80,63 +80,65 @@ zend_object_value NumberFormatter_object
  */
 
 /* {{{ arginfo */
-static ZEND_BEGIN_ARG_INFO_EX(number_parse_arginfo, 0, 0, 1)
+PHP_INTL_ZEND_ARG_STATIC
+ZEND_BEGIN_ARG_INFO_EX(number_parse_arginfo, 0, 0, 1)
 	ZEND_ARG_INFO(0, string)
 	ZEND_ARG_INFO(0, type)
 	ZEND_ARG_INFO(1, position)
 ZEND_END_ARG_INFO()
 
-static ZEND_BEGIN_ARG_INFO_EX(number_parse_currency_arginfo, 0, 0, 2)
+PHP_INTL_ZEND_ARG_STATIC
+ZEND_BEGIN_ARG_INFO_EX(number_parse_currency_arginfo, 0, 0, 2)
 	ZEND_ARG_INFO(0, string)
 	ZEND_ARG_INFO(1, currency)
 	ZEND_ARG_INFO(1, position)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter_getattribute, 0, 0, 1)
 	ZEND_ARG_INFO(0, attr)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter_setattribute, 0, 0, 2)
 	ZEND_ARG_INFO(0, attr)
 	ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter_setsymbol, 0, 0, 2)
 	ZEND_ARG_INFO(0, attr)
 	ZEND_ARG_INFO(0, symbol)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO(arginfo_numberformatter_getpattern, 0)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter_setpattern, 0, 0, 1)
 	ZEND_ARG_INFO(0, pattern)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter_getlocale, 0, 0, 0)
 	ZEND_ARG_INFO(0, type)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter___construct, 0, 0, 2)
 	ZEND_ARG_INFO(0, locale)
 	ZEND_ARG_INFO(0, style)
 	ZEND_ARG_INFO(0, pattern)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter_formatcurrency, 0, 0, 2)
 	ZEND_ARG_INFO(0, num)
 	ZEND_ARG_INFO(0, currency)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_numberformatter_format, 0, 0, 1)
 	ZEND_ARG_INFO(0, num)
 	ZEND_ARG_INFO(0, type)

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-ae
$NetBSD: patch-ae,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- locale/locale_class.c.orig	2010-03-11 00:19:03.000000000 +0100
+++ locale/locale_class.c
@@ -35,29 +35,29 @@ zend_class_entry *Locale_ce_ptr = NULL;
  *        approptiate 'locale_XX_args' for the procedural API!
  */
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( locale_0_args, 0, 0, 0 )
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( locale_1_arg, 0, 0, 1 )
 	ZEND_ARG_INFO( 0, arg1 )
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 2 )
 	ZEND_ARG_INFO( 0, arg1 )
 	ZEND_ARG_INFO( 0, arg2 )
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( locale_3_args, 0, 0, 3 )
         ZEND_ARG_INFO( 0, arg1 )
         ZEND_ARG_INFO( 0, arg2 )
         ZEND_ARG_INFO( 0, arg3 )
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( locale_4_args, 0, 0, 4 )
         ZEND_ARG_INFO( 0, arg1 )
         ZEND_ARG_INFO( 0, arg2 )

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-af
$NetBSD: patch-af,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- msgformat/msgformat_class.c.orig	2010-03-11 00:20:56.000000000 +0100
+++ msgformat/msgformat_class.c
@@ -77,34 +77,34 @@ zend_object_value MessageFormatter_objec
  */
 
 /* {{{ arginfo */
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_messageformatter___construct, 0, 0, 2)
 	ZEND_ARG_INFO(0, locale)
 	ZEND_ARG_INFO(0, pattern)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO(arginfo_messageformatter_geterrormessage, 0)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_messageformatter_formatmessage, 0, 0, 3)
 	ZEND_ARG_INFO(0, locale)
 	ZEND_ARG_INFO(0, pattern)
 	ZEND_ARG_INFO(0, args)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_messageformatter_format, 0, 0, 1)
 	ZEND_ARG_INFO(0, args)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_messageformatter_setpattern, 0, 0, 1)
 	ZEND_ARG_INFO(0, pattern)
 ZEND_END_ARG_INFO()
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX(arginfo_messageformatter_parse, 0, 0, 1)
 	ZEND_ARG_INFO(0, source)
 ZEND_END_ARG_INFO()

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-ag
$NetBSD: patch-ag,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- normalizer/normalizer_class.c.orig	2010-03-11 00:18:31.000000000 +0100
+++ normalizer/normalizer_class.c
@@ -29,7 +29,7 @@ zend_class_entry *Normalizer_ce_ptr = NU
 
 /* {{{ Normalizer methods arguments info */
 
-static
+PHP_INTL_ZEND_ARG_STATIC
 ZEND_BEGIN_ARG_INFO_EX( normalizer_3_args, 0, 0, 3 )
 	ZEND_ARG_INFO( 0, arg1 )
 	ZEND_ARG_INFO( 0, arg2 )

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-ah
$NetBSD: patch-ah,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- resourcebundle/resourcebundle_class.c.orig	2010-03-21 16:45:18.000000000 +0100
+++ resourcebundle/resourcebundle_class.c
@@ -212,7 +212,7 @@ zval *resourcebundle_array_get(zval *obj
 	MAKE_STD_ZVAL(retval);
 
 	resourcebundle_array_fetch(object, offset, retval, 1 TSRMLS_CC);
-	retval->refcount--;
+	Z_DELREF_P(retval);
 	return retval;
 }
 /* }}} */

File Added: pkgsrc/textproc/php-intl/patches/Attic/patch-aj
$NetBSD: patch-aj,v 1.1.1.1 2010/03/21 16:57:13 jdolecek Exp $

--- resourcebundle/resourcebundle_iterator.c.orig	2010-03-15 23:03:30.000000000 +0100
+++ resourcebundle/resourcebundle_iterator.c
@@ -18,6 +18,8 @@
 #include <zend.h>
 #include <zend_API.h>
 
+#include "php_intl.h"
+
 #include "resourcebundle/resourcebundle.h"
 #include "resourcebundle/resourcebundle_class.h"
 #include "resourcebundle/resourcebundle_iterator.h"
@@ -75,7 +77,7 @@ static void resourcebundle_iterator_dtor
 
 	resourcebundle_iterator_invalidate( iter TSRMLS_CC );
 
-	object->refcount--;
+	Z_DELREF_P(object);
 
 	efree(iterator);
 }
@@ -162,7 +164,7 @@ zend_object_iterator *resourcebundle_get
 	     php_error( E_ERROR, "ResourceBundle does not support writable iterators" );
 	}
 
-	object->refcount++;
+	Z_DELREF_P(object);
 	iterator->intern.data = (void *) object;
 	iterator->intern.funcs = &resourcebundle_iterator_funcs;