From 5737b1de123f497c02718326863189f83aa55fe8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Mon, 3 Nov 2014 10:00:22 +0100
Subject: Fix overloading = operator for perl 5.20

---
 perl-Qt.spec                                       |  6 +++-
 ...copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch | 42 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 
perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch

diff --git a/perl-Qt.spec b/perl-Qt.spec
index 0d143a0..3e79e7f 100644
--- a/perl-Qt.spec
+++ b/perl-Qt.spec
@@ -13,6 +13,9 @@ Patch1:         0001-Changes-to-support-perl-5.18.0.patch
 Patch2:         0002-Fixes-for-perl-5.18.patch
 # Adjust to perl-5.20.0, bug #1136340, CPAN RT#98790
 Patch3:         
Qt-0.96.0-Bundle-Devel-Peel-SvREFCNT_inc-removed-from-perl-5.2.patch
+# Adjust to perl-5.20.0, bug #1136340, CPAN RT#98790, in new upstream
+# <git://anongit.kde.org/perlqt>
+Patch4:         
perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo 
$version))
 
 BuildRequires:  cmake
@@ -62,6 +65,7 @@ Development files for perl-Qt.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 mkdir build
 
@@ -119,7 +123,7 @@ make test
 %{_datadir}/perlqt
 
 %changelog
-* Thu Sep 11 2014 Petr Pisar <ppi...@redhat.com> - 0.96.0-13
+* Mon Nov 03 2014 Petr Pisar <ppi...@redhat.com> - 0.96.0-13
 - Adjust to perl-5.20.0 (bug #1136340)
 
 * Fri Aug 29 2014 Jitka Plesnikova <jples...@redhat.com> - 0.96.0-12
diff --git 
a/perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch 
b/perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch
new file mode 100644
index 0000000..7acb6d8
--- /dev/null
+++ b/perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch
@@ -0,0 +1,42 @@
+From 1b665848e178301344386717c658386d160d222a Mon Sep 17 00:00:00 2001
+From: Chris Burel <chrisbu...@gmail.com>
+Date: Fri, 31 Oct 2014 11:23:18 -0700
+Subject: [PATCH] Use a copy of the Qt::AutoLoad::AUTOLOAD variable.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This appears to be a change in Perl's behavior.  The way the operator
+overloading in PerlQt works is that it first tries to find an operator method
+on the class itself, and then next it tries to find one in the so-called
+QGlobalSpace, which is a place defined by the smoke library for global Qt
+functions.  Perl passes the underlying XS code the full package and function
+being called, which PerlQt splits into 2 strings, one for the package name, and
+one for the method name.  PerlQt null-terminates the package name string, and
+in previous versions of Perl, this modification did not affect the source
+$AUTOLOAD variable.  In Perl 5.20.0, it does update the Perl variable, and then
+causes confusion down the line.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1136340
+https://bugs.kde.org/show_bug.cgi?id=340518
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ qtcore/src/util.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qtcore/src/util.cpp b/qtcore/src/util.cpp
+index a163e7e..b913af3 100644
+--- a/qtcore/src/util.cpp
++++ b/qtcore/src/util.cpp
+@@ -2047,7 +2047,7 @@ XS(XS_AUTOLOAD) {
+     PERL_SET_CONTEXT(PL_curinterp);
+     // Figure out which package and method is being called, based on the
+     // autoload variable
+-    SV* autoload = get_sv( "Qt::AutoLoad::AUTOLOAD", TRUE );
++    SV* autoload = sv_mortalcopy( get_sv( "Qt::AutoLoad::AUTOLOAD", TRUE ) );
+     char* package = SvPV_nolen( autoload );
+     char* methodname = 0;
+     // Splits off the method name from the package
+-- 
+1.9.3
+
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-Qt.git/commit/?h=epel7&id=5737b1de123f497c02718326863189f83aa55fe8
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org

Reply via email to