pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/php-ming Switch to use ming distribution's ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/426ef73074b8
branches:  trunk
changeset: 603739:426ef73074b8
user:      obache <obache%pkgsrc.org@localhost>
date:      Sat May 12 08:49:26 2012 +0000

description:
Switch to use ming distribution's one, instead of PHP distribution bundled one.

This extension is no longer bundled with PHP as of PHP 5.3.0,
so this change let to allow php53.
For php5(52), set PECL_LEGACY_VERSION_SCHEME=yes to avoid version downgrade.

diffstat:

 multimedia/php-ming/Makefile        |   22 +++++-
 multimedia/php-ming/files/config.m4 |  115 ++++++++++++++++++++++++++++++++++++
 2 files changed, 133 insertions(+), 4 deletions(-)

diffs (160 lines):

diff -r ad90dde8e34a -r 426ef73074b8 multimedia/php-ming/Makefile
--- a/multimedia/php-ming/Makefile      Sat May 12 08:27:16 2012 +0000
+++ b/multimedia/php-ming/Makefile      Sat May 12 08:49:26 2012 +0000
@@ -1,19 +1,33 @@
-# $NetBSD: Makefile,v 1.13 2011/11/01 06:02:14 sbd Exp $
+# $NetBSD: Makefile,v 1.14 2012/05/12 08:49:26 obache Exp $
 
+.include "../../multimedia/ming/Makefile.common"
+PECL_VERSION=          ${MING_VERSION}
 MODNAME=               ming
-PKGREVISION=           2
 CATEGORIES+=           multimedia
+DIST_SUBDIR?=          #empty
 
 MAINTAINER=            obache%NetBSD.org@localhost
 COMMENT=               PHP extension for Ming library
+LICENSE=               php
 
 PKG_DESTDIR_SUPPORT=   user-destdir
 
 CONFLICTS=     php-ming-[0-9]*
 
-PHP_VERSIONS_ACCEPTED= 52
+CONFIGURE_ARGS+=       --with-${MODNAME}=${BUILDLINK_PREFIX.ming}
+PHPSETUPSUBDIR=                php_ext
+MODULESDIR=            ${WRKSRC}/${PHPSETUPSUBDIR}/modules
+CONFIGURE_DIRS=                ${PHPSETUPSUBDIR}
 
-CONFIGURE_ARGS+=       --with-${MODNAME}=${BUILDLINK_PREFIX.ming}
+# missing in 0.4.4 release tarball.
+post-extract:
+               ${CP} ${FILESDIR}/config.m4 ${WRKSRC}/${PHPSETUPSUBDIR}
+
+# to avoid downgrade version
+.include "../../lang/php/phpversion.mk"
+.if ${PKG_PHP_VERSION} == "5"
+PECL_LEGACY_VERSION_SCHEME=    yes
+.endif
 
 .include "../../lang/php/ext.mk"
 .include "../../multimedia/ming/buildlink3.mk"
diff -r ad90dde8e34a -r 426ef73074b8 multimedia/php-ming/files/config.m4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/php-ming/files/config.m4       Sat May 12 08:49:26 2012 +0000
@@ -0,0 +1,115 @@
+dnl
+dnl $NetBSD: config.m4,v 1.1 2012/05/12 08:49:26 obache Exp $
+dnl based on taken from upstream git repository at release 0.4.4
+dnl
+
+PHP_ARG_WITH(ming, for MING support,
+[  --with-ming[=DIR]       Include MING support])
+
+if test "$PHP_MING" != "no"; then
+  AC_CHECK_LIB(m, sin)
+
+  for i in $PHP_MING ../../src /usr/local /usr; do
+    if test -e $i/$PHP_LIBDIR/libming.$SHLIB_SUFFIX_NAME || test -e $i/$PHP_LIBDIR/libming.a; then
+      MING_DIR=$i
+      break
+    fi
+  done
+
+  if test -z "$MING_DIR"; then
+    AC_MSG_ERROR(Please reinstall ming distribution. libming.(a|so) not found.)
+  fi
+
+  for i in ../../src $MING_DIR/include $MING_DIR/include/ming $MING_DIR/ming/include; do
+    if test -f $i/ming.h; then
+      MING_INC_DIR=$i
+    fi
+  done
+
+  if test -z "$MING_INC_DIR"; then
+    AC_MSG_ERROR(Please reinstall ming distribution. ming.h not found.)
+  fi
+
+  PHP_CHECK_LIBRARY(ming, Ming_useSWFVersion, [
+    AC_DEFINE(HAVE_MING,1,[ ])
+  ],[
+    AC_MSG_ERROR([Ming library 0.2a or greater required.])
+  ],[
+    -L$MING_DIR/$PHP_LIBDIR
+  ])
+  
+  PHP_ADD_INCLUDE($MING_INC_DIR)
+  PHP_ADD_LIBRARY_WITH_PATH(ming, $MING_DIR/$PHP_LIBDIR, MING_SHARED_LIBADD)
+
+  old_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS=-I$MING_INC_DIR
+  AC_MSG_CHECKING([for destroySWFBlock])
+  AC_TRY_RUN([
+#include "ming.h"
+int destroySWFBlock(int a, int b) {
+       return a+b;
+}
+int main() {
+       return destroySWFBlock(-1,1); /* returns 0 only if function is not yet defined */
+}
+  ],[
+    AC_MSG_RESULT([missing])
+  ],[
+    AC_DEFINE(HAVE_DESTROY_SWF_BLOCK,1,[ ])
+    AC_MSG_RESULT([ok])
+  ],[
+    AC_MSG_RESULT([unknown])
+  ]) 
+
+dnl Check Ming version (FIXME: if/when ming has some better way to detect the version..)
+  AC_EGREP_CPP(yes, [
+#include <ming.h>
+#ifdef SWF_SOUND_COMPRESSION
+yes
+#endif
+  ], [
+    AC_DEFINE(HAVE_NEW_MING,  1, [ ]) 
+    dnl FIXME: This is now unconditional..better check coming later.
+  ])
+
+  dnl Check if SWFVideoStream_setFrameMode() is available
+  AC_TRY_COMPILE([
+#include <ming.h>
+  ], [
+int main(void) { SWFVideoStream_setFrameMode(0, 0); return 0; }
+  ], [
+    AC_DEFINE(HAVE_SWFVIDEOSTREAM_SETFRAMEMODE, 1, [Have SWFVideoStream_setFrameMode(SWFVideoStream, int)])
+  ], [])
+
+  dnl Check if SWFVideoStream_nextFrame() is available
+  AC_TRY_COMPILE([
+#include <ming.h>
+  ], [
+int main(void) { SWFVideoStream_nextFrame(0); return 0; }
+  ], [
+    AC_DEFINE(HAVE_SWFVIDEOSTREAM_NEXTFRAME, 1, [Have SWFVideoStream_nextFrame(SWFVideoStream)])
+  ], [])
+
+  dnl Check if SWFVideoStream_seek() is available
+  AC_TRY_COMPILE([
+#include <ming.h>
+  ], [
+int main(void) { SWFVideoStream_seek(0, 0, 0); return 0; }
+  ], [
+    AC_DEFINE(HAVE_SWFVIDEOSTREAM_SEEK, 1, [Have SWFVideoStream_seek(SWFVideoStream, int frame, int whence)])
+  ], [])
+
+
+  dnl Check if SWFMovie_output() accepts the 4th parameter
+  AC_TRY_COMPILE([
+#include <ming.h>
+  ], [
+int main(void) { SWFMovie_output(NULL, NULL, NULL, 0); return 0; }
+  ], [
+    AC_DEFINE(HAVE_MING_MOVIE_LEVEL, 1, [ ])
+  ], [])
+  CPPFLAGS=$old_CPPFLAGS
+
+  PHP_NEW_EXTENSION(ming, ming.c, $ext_shared)
+  PHP_SUBST(MING_SHARED_LIBADD)
+fi



Home | Main Index | Thread Index | Old Index