[Bug 459548] Review Request: php-gtk - GTK PHP extension

bugzilla at redhat.com bugzilla at redhat.com
Sun Sep 6 10:11:52 UTC 2009


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=459548





--- Comment #25 from Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp>  2009-09-06 06:11:49 EDT ---
Well, while I am not familiar with PHP:

I based on http://www.metal3d.org/repo/fedora/9/SRPMS/ ,
modified for rawhide and succeeded to build on rawhide:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1658076
srpm is under
http://koji.fedoraproject.org/scratch/mtasaka/task_1658076/
! Note that I just tried to build on rawhide and did not
  try anything else (i.e I have not checked any packaging
  guideline issue)

Two thing:
- The reason vanilla php-gtk 2.0.1 won't build due to error messages
  like
--------------------------------------------------
ext/gtk+/gen_gtk.c: At top level:
ext/gtk+/gen_gtk.c:1531: error: duplicate 'static'
ext/gtk+/gen_gtk.c:1542: error: duplicate 'static'
ext/gtk+/gen_gtk.c:1548: error: duplicate 'static'
ext/gtk+/gen_gtk.c:1554: error: duplicate 'static'
--------------------------------------------------
  is due to a slight API change in /usr/include/php/Zend/zend_API.h:
--------------------------------------------------
 #define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference,
required_num_args)      \
-       zend_arg_info name[] = {                                                
                                        \
+       static const zend_arg_info name[] = {                                   
                                                \
                { NULL, 0, NULL, 0, 0, 0, pass_rest_by_reference,
return_reference, required_num_args },
------------------------------------------------------

  So simply removing "static" before using ZEND_BEGIN_ARG_INFOXXXXXXX
  in php-gtk source code will solve this.
  The following script is _very slow_ however it will work anyway:
-------------------------------------------------------
%if 0%{?fedora} >= 12
set +x
echo "Fixing source code for PHP 5.3.0 ..."
grep -rl '^ZEND_' . | while read file
do
   cp -pf $file $file.orig
   echo -n -e "\tfor $file ... "
   (
      sed -i -e 's|^static$||' $file
      line=0
      num=0
      num_a=0
      hold=0
      cat $file.orig | while read line
      do
         num=$((num + 1))
         num_a=$((num_a + 1))
         if [ $num_a -ge 10000 ] ; then num_a=0 ; echo -n "*" ; fi
         if [ $hold = 1 ] ; then
            hold=0
            if echo $line | grep -vq '^ZEND_' ; then
              num_b=$((num - 1))
              sed -i -e "${num_b}s|^.*$|static|" $file
            fi
         fi
         if echo $line | grep -q '^static$' ; then hold=1 ; fi
      done
   )
   echo -e "\tdone"
done
set -x
--------------------------------------------------------------------

- And the following patch is needed
  http://rpms.famillecollet.com/files/php-gtk-php53.patch

  (the argument of zend_set_timeout() changed)

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.




More information about the Fedora-package-review mailing list