Revision: 76623 http://trac.macports.org/changeset/76623 Author: pixilla@macports.org Date: 2011-03-02 17:27:44 -0800 (Wed, 02 Mar 2011) Log Message: ----------- php5-uuid: new port providing php5 pecl uuid extension Added Paths: ----------- trunk/dports/php/php5-uuid/ trunk/dports/php/php5-uuid/Portfile trunk/dports/php/php5-uuid/files/ trunk/dports/php/php5-uuid/files/patch-osx_build.diff Added: trunk/dports/php/php5-uuid/Portfile =================================================================== --- trunk/dports/php/php5-uuid/Portfile (rev 0) +++ trunk/dports/php/php5-uuid/Portfile 2011-03-03 01:27:44 UTC (rev 76623) @@ -0,0 +1,21 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id$ + +PortSystem 1.0 +PortGroup php5extension 1.0 + +php5extension.setup uuid 1.0.2 pecl +categories-append net www +platforms darwin +maintainers brad + +description A wrapper around libuuid from the ext2utils project. + +long_description ${description} + +checksums sha1 ad936b20fdbeecc803b9770c292e8d763026597d \ + rmd160 50a1a08d34e78fa4f537b3ac6c5eb52382db3df1 + +use_parallel_build yes + +patchfiles patch-osx_build.diff \ No newline at end of file Property changes on: trunk/dports/php/php5-uuid/Portfile ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: trunk/dports/php/php5-uuid/files/patch-osx_build.diff =================================================================== --- trunk/dports/php/php5-uuid/files/patch-osx_build.diff (rev 0) +++ trunk/dports/php/php5-uuid/files/patch-osx_build.diff 2011-03-03 01:27:44 UTC (rev 76623) @@ -0,0 +1,140 @@ +--- config.m4 2008-04-01 08:59:22.000000000 -0700 ++++ config.m4 2008-08-14 10:16:56.000000000 -0700 +@@ -8,16 +8,29 @@ + if test "$PHP_UUID" != "no"; then + PHP_CHECK_FUNC_LIB(uuid_type, uuid) + PHP_CHECK_FUNC_LIB(uuid_variant, uuid) +- ++ PHP_CHECK_FUNC_LIB(uuid_time, uuid) ++ PHP_CHECK_FUNC_LIB(uuid_mac, uuid) + + PHP_ADD_INCLUDE($PHP_UUID_DIR/include) + + export OLD_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_UUID" + AC_CHECK_HEADER([uuid/uuid.h], [], AC_MSG_ERROR('uuid/uuid.h' header not found)) +- PHP_SUBST(UUID_SHARED_LIBADD) + +- PHP_ADD_LIBRARY_WITH_PATH(uuid, $PHP_UUID_DIR/lib, UUID_SHARED_LIBADD) ++ AC_MSG_CHECKING(PHP version) ++ AC_TRY_COMPILE([], [ ++#ifdef __APPLE__ ++#error compiling on darwin ++#endif ++], ++[], ++[export UUID_ON_MAC=true]) ++ ++ ++ if test $UUID_ON_MAC != "true"; then ++ PHP_SUBST(UUID_SHARED_LIBADD) ++ PHP_ADD_LIBRARY_WITH_PATH(uuid, $PHP_UUID_DIR/lib, UUID_SHARED_LIBADD) ++ fi + export CPPFLAGS="$OLD_CPPFLAGS" + + export OLD_CPPFLAGS="$CPPFLAGS" +@@ -35,7 +48,6 @@ + export CPPFLAGS="$OLD_CPPFLAGS" + + +- PHP_SUBST(UUID_SHARED_LIBADD) + AC_DEFINE(HAVE_UUID, 1, [ ]) + + PHP_NEW_EXTENSION(uuid, uuid.c , $ext_shared) +diff -urp uuid-1.0.2/php_uuid.h uuid-1.0.2.mine/php_uuid.h +--- php_uuid.h 2008-04-01 08:59:22.000000000 -0700 ++++ php_uuid.h 2008-08-14 09:00:23.000000000 -0700 +@@ -145,6 +145,8 @@ + #endif + + #endif /* HAVE_UUID_VARIANT */ ++ ++#if HAVE_UUID_TIME + PHP_FUNCTION(uuid_time); + #if (PHP_MAJOR_VERSION >= 5) + ZEND_BEGIN_ARG_INFO_EX(uuid_time_arg_info, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +@@ -153,7 +155,9 @@ + #else /* PHP 4.x */ + #define uuid_time_arg_info NULL + #endif ++#endif /* HAVE_UUID_TIME */ + ++#if HAVE_UUID_MAC + PHP_FUNCTION(uuid_mac); + #if (PHP_MAJOR_VERSION >= 5) + ZEND_BEGIN_ARG_INFO_EX(uuid_mac_arg_info, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +@@ -162,6 +166,7 @@ + #else /* PHP 4.x */ + #define uuid_mac_arg_info NULL + #endif ++#endif /* HAVE_UUID_MAC */ + + PHP_FUNCTION(uuid_parse); + #if (PHP_MAJOR_VERSION >= 5) +@@ -185,6 +190,15 @@ + } // extern "C" + #endif + ++#ifndef UUID_TYPE_DCE_TIME ++#ifdef __APPLE__ ++/* UUID Type definitions */ ++#define UUID_TYPE_DCE_TIME 1 ++#define UUID_TYPE_DCE_RANDOM 4 ++#endif /* __MACOS__ */ ++#endif /* UUID_TYPE_DCE_TIME */ ++ ++ + /* mirrored PHP Constants */ + #define UUID_TYPE_DEFAULT 0 + #define UUID_TYPE_TIME UUID_TYPE_DCE_TIME +@@ -194,7 +208,7 @@ + #define UUID_TYPE_NULL -1 + #define UUID_TYPE_INVALID -42 + +-#endif /* PHP_HAVE_UUID */ ++#endif /* HAVE_UUID */ + + #endif /* PHP_UUID_H */ + +diff -urp uuid-1.0.2/tests/uuid_mac.phpt uuid- +1.0.2.mine/tests/uuid_mac.phpt +--- tests/uuid_mac.phpt 2008-04-01 08:59:22.000000000 -0700 ++++ tests/uuid_mac.phpt 2008-08-14 10:21:57.000000000 -0700 +@@ -5,6 +5,8 @@ + + if(!extension_loaded('uuid')) die('skip '); + ++if(!function_exists('uuid_mac')) die('skip not compiled in (HAVE_UUID_MAC)'); ++ + ?> + --FILE-- + <?php +diff -urp uuid-1.0.2/tests/uuid_time.phpt uuid- +1.0.2.mine/tests/uuid_time.phpt +--- tests/uuid_time.phpt 2008-04-01 08:59:22.000000000 -0700 ++++ tests/uuid_time.phpt 2008-08-14 10:22:50.000000000 -0700 +@@ -5,6 +5,8 @@ + + if(!extension_loaded('uuid')) die('skip '); + ++if(!function_exists('uuid_time')) die('skip not compiled in (HAVE_UUID_TIME)'); ++ + ?> + --FILE-- + <?php +diff -urp uuid-1.0.2/uuid.c uuid-1.0.2.mine/uuid.c +--- uuid.c 2008-04-01 08:59:22.000000000 -0700 ++++ uuid.c 2008-08-14 08:52:05.000000000 -0700 +@@ -40,8 +40,12 @@ + #if HAVE_UUID_VARIANT + PHP_FE(uuid_variant , uuid_variant_arg_info) + #endif /* HAVE_UUID_VARIANT */ ++#if HAVE_UUID_TIME + PHP_FE(uuid_time , uuid_time_arg_info) ++#endif /* HAVE_UUID_TIME */ ++#if HAVE_UUID_MAC + PHP_FE(uuid_mac , uuid_mac_arg_info) ++#endif /* HAVE_UUID_MAC */ + PHP_FE(uuid_parse , uuid_parse_arg_info) + PHP_FE(uuid_unparse , uuid_unparse_arg_info) + { NULL, NULL, NULL }
participants (1)
-
pixilla@macports.org