development/ming: Fix building perl extension.

Also partially fixed building the php extension. It builds fine
with a "normal" php 5.4 now, but still fails with a zts enabled one
like shipped in Slackware.

Signed-off-by: Heinz Wiesinger <pprkut@slackbuilds.org>
This commit is contained in:
Heinz Wiesinger 2012-09-03 20:56:49 +02:00 committed by Robby Workman
parent 61e6de614c
commit c36043820b
4 changed files with 83 additions and 12 deletions

View file

@ -0,0 +1,43 @@
From a0ea1cc47330a3ab316713d720892b6272401890 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 10 Jul 2011 21:46:09 +0300
Subject: [PATCH] GvCV() isn't an lvalue since Perl 5.13.10
GvCV() can't be assigned to anymore with recent perls, so use the new
GvCV_set() macro when available or implement it the old way if it isn't.
---
perl_ext/Exports.c | 2 +-
perl_ext/perl_swf.h | 4 ++++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/perl_ext/Exports.c b/perl_ext/Exports.c
index 65f8912..5529728 100644
--- a/perl_ext/Exports.c
+++ b/perl_ext/Exports.c
@@ -190,7 +190,7 @@ void export_cv(SV *class, SV *caller, char *sub)
SvPVX(caller), sub, SvPVX(class), sub);
#endif
gv = gv_fetchpv(form("%s::%s",SvPVX( caller), sub), TRUE, SVt_PVCV);
- GvCV(gv) = perl_get_cv(form("%s::%s", SvPVX(class), sub), TRUE);
+ GvCV_set(gv, perl_get_cv(form("%s::%s", SvPVX(class), sub), TRUE));
GvIMPORTED_CV_on(gv);
GvMULTI_on(gv);
}
diff --git a/perl_ext/perl_swf.h b/perl_ext/perl_swf.h
index b960229..1a3656e 100644
--- a/perl_ext/perl_swf.h
+++ b/perl_ext/perl_swf.h
@@ -58,6 +58,10 @@ typedef SWFFontCollection SWF__FontCollection;
#define aTHXo_
#endif
+#ifndef GvCV_set
+# define GvCV_set(G, C) (GvCV(G) = (C))
+#endif
+
#ifndef S_DEBUG
#define swf_debug 0 /* Should we get this from, say, $SWF::debug? */
#define S_DEBUG(level,code) if (swf_debug >= level) { code; }
--
1.7.5.4

View file

@ -6,7 +6,4 @@ morphs), text, sprites (aka movie clips), buttons, and actions
in flash movies, plus more. The goal for Ming is to abstract in flash movies, plus more. The goal for Ming is to abstract
away all of the mundane specifics of the SWF file format. away all of the mundane specifics of the SWF file format.
This builds the c++, perl, python, php and tcl-plugin. This builds the c++, perl, python and tcl-plugin.
To enable the php extension, go to /etc/php/ming.ini
and uncomment the line:
; extension=ming.so

View file

@ -2,7 +2,7 @@
# Slackware build script for ming # Slackware build script for ming
# Copyright 2008-2011 Heinz Wiesinger, Amsterdam, The Netherlands # Copyright 2008-2012 Heinz Wiesinger, Amsterdam, The Netherlands
# All rights reserved. # All rights reserved.
# #
# Redistribution and use of this script, with or without modification, is # Redistribution and use of this script, with or without modification, is
@ -24,7 +24,7 @@
PRGNAM=ming PRGNAM=ming
VERSION=0.4.4 VERSION=0.4.4
BUILD=${BUILD:-1} BUILD=${BUILD:-2}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
@ -65,6 +65,12 @@ cd $PRGNAM-$VERSION
chown -R root:root . chown -R root:root .
chmod -R u+w,go+r-w,a-s . chmod -R u+w,go+r-w,a-s .
# Fix PHP 5.4 compatibility
patch -p0 -d php_ext -i $CWD/patch-ming.c.diff
# Fix building against perl 5.16
patch -p1 -i $CWD/0001-GvCV-isn-t-an-lvalue-since-Perl-5.13.10.patch
# static library is activated because the perl extension needs it # static library is activated because the perl extension needs it
CFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \
@ -81,9 +87,15 @@ CXXFLAGS="$SLKCFLAGS" \
make make
make install DESTDIR=$PKG make install DESTDIR=$PKG
cd php_ext # Building the php extension against a zts enabled php fails currently.
make install DESTDIR=$PKG # Feel free to uncomment this in case you have a normal php. -HW
cd -
#cd php_ext
# make install DESTDIR=$PKG
#cd -
# Install config file for PHP.
#install -D -m 644 $CWD/ming.ini $PKG/etc/php/ming.ini.new
cd py_ext cd py_ext
python setup.py install --root=$PKG python setup.py install --root=$PKG
@ -95,9 +107,6 @@ cd perl_ext
make install DESTDIR=$PKG make install DESTDIR=$PKG
cd - cd -
# Install config file for PHP.
install -D -m 644 $CWD/ming.ini $PKG/etc/php/ming.ini.new
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

View file

@ -0,0 +1,22 @@
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662620
--- ming.c.orig 2011-10-26 01:33:18.000000000 -0500
+++ ming.c 2012-05-14 17:06:09.000000000 -0500
@@ -87,10 +87,17 @@
static SWFMatrix getMatrix(zval *id TSRMLS_DC);
#endif
+#if PHP_API_VERSION < 20100412
#define PHP_MING_FILE_CHK(file) \
if ((PG(safe_mode) && !php_checkuid((file), NULL, CHECKUID_CHECK_FILE_AND_DIR)) || php_check_open_basedir((file) TSRMLS_CC)) { \
RETURN_FALSE; \
- } \
+ }
+#else
+#define PHP_MING_FILE_CHK(file) \
+ if (php_check_open_basedir((file) TSRMLS_CC)) { \
+ RETURN_FALSE; \
+ }
+#endif
/* {{{ proto void ming_setcubicthreshold (int threshold)
Set cubic threshold (?) */