From 0cb05ee05116fb65f48da7cd73db03da57e5b009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= ppisar@redhat.com Date: Tue, 22 Mar 2016 15:38:37 +0100 Subject: Fix code generation with "puic4 -x"
--- ...Fix-problems-with-puic4-x-code-generation.patch | 129 +++++++++++++++++++++ perl-Qt.spec | 4 + 2 files changed, 133 insertions(+) create mode 100644 Qt-0.96.0-Fix-problems-with-puic4-x-code-generation.patch
diff --git a/Qt-0.96.0-Fix-problems-with-puic4-x-code-generation.patch b/Qt-0.96.0-Fix-problems-with-puic4-x-code-generation.patch new file mode 100644 index 0000000..1d3a9a7 --- /dev/null +++ b/Qt-0.96.0-Fix-problems-with-puic4-x-code-generation.patch @@ -0,0 +1,129 @@ +From 94492c83232701ebc95d739f884f6457a96475f5 Mon Sep 17 00:00:00 2001 +From: Olivier Lahaye olivier.lahaye@cea.fr +Date: Fri, 19 Jun 2015 08:11:36 -0700 +Subject: [PATCH] Fix problems with puic4 -x code generation. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is a patch submitted for https://github.com/chrisburel/perlqt4/issues/44 "puic4 -x does not create valid perl code" + +Petr Písař: Ported to 0.96.0: + +commit e8a30b78f46a376da70fc9cc8f8166b72aea5261 +Author: Olivier Lahaye olivier.lahaye@cea.fr +Date: Fri Jun 19 08:11:36 2015 -0700 + + Fix problems with puic4 -x code generation. + +Signed-off-by: Petr Písař ppisar@redhat.com +--- + qtcore/tools/puic/uic.cpp | 74 +++++++++++++++++++++++++---------------------- + 1 file changed, 39 insertions(+), 35 deletions(-) + +diff --git a/qtcore/tools/puic/uic.cpp b/qtcore/tools/puic/uic.cpp +index 996a7da..edb5538 100644 +--- a/qtcore/tools/puic/uic.cpp ++++ b/qtcore/tools/puic/uic.cpp +@@ -139,30 +139,34 @@ void Uic::writeCopyrightHeader(DomUI *ui) + { + QString comment = ui->elementComment(); + if ( this->option().generator == Option::PerlGenerator ) { +- if (comment.size()) +- out << "/*\n" << comment << "\n*/\n\n"; ++ if (comment.size()) { ++ comment.insert( 0, "# " ); ++ comment.replace( QRegExp("\n"), "\n# " ); ++ out << "################################################################################\n" ++ << comment ++ << "\n################################################################################\n\n"; ++ } + +- out << "#################################################################################\n"; +- out << "## Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n"; +- out << "##\n"; +- out << "## Created: " << QDateTime::currentDateTime().toString() << "\n"; +- out << "## " << QString::fromLatin1("by: Qt User Interface Compiler version %1\n").arg(QLatin1String(QT_VERSION_STR)); +- out << "##\n"; +- out << "## WARNING! All changes made in this file will be lost when recompiling UI file!\n"; +- out << "################################################################################\n\n"; +- } +- else { ++ out << "################################################################################\n"; ++ out << "## Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n"; ++ out << "##\n"; ++ out << "## Created: " << QDateTime::currentDateTime().toString() << "\n"; ++ out << "## " << QString::fromLatin1("by: Qt User Interface Compiler version %1\n").arg(QLatin1String(QT_VERSION_STR)); ++ out << "##\n"; ++ out << "## WARNING! All changes made in this file will be lost when recompiling UI file!\n"; ++ out << "################################################################################\n\n"; ++ } else { + if (comment.size()) + out << "/*\n" << comment << "\n*/\n\n"; + +- out << "/********************************************************************************\n"; +- out << "** Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n"; +- out << "**\n"; +- out << "** Created: " << QDateTime::currentDateTime().toString() << "\n"; +- out << "** " << QString::fromLatin1("by: Qt User Interface Compiler version %1\n").arg(QLatin1String(QT_VERSION_STR)); +- out << "**\n"; +- out << "** WARNING! All changes made in this file will be lost when recompiling UI file!\n"; +- out << "********************************************************************************/\n\n"; ++ out << "/********************************************************************************\n"; ++ out << "** Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n"; ++ out << "**\n"; ++ out << "** Created: " << QDateTime::currentDateTime().toString() << "\n"; ++ out << "** " << QString::fromLatin1("by: Qt User Interface Compiler version %1\n").arg(QLatin1String(QT_VERSION_STR)); ++ out << "**\n"; ++ out << "** WARNING! All changes made in this file will be lost when recompiling UI file!\n"; ++ out << "********************************************************************************/\n\n"; + } + } + +@@ -381,28 +385,28 @@ bool Uic::plwrite(DomUI *ui) + + if (option().useKDE) { + out << "\n\nsub main {" << endl; +- out << option().indent << "my $about = KDE::AboutData("" << className.toLower() << "", "" << className << "", KDE.ki18n(""), "0.1")" << endl; +- out << option().indent << "KDE::CmdLineArgs.init(\@ARGV, $about)" << endl; +- out << option().indent << "my $a = KDE::Application" << endl; ++ out << option().indent << "my $about = KDE::AboutData("" << className.toLower() << "", "" << className << "", KDE.ki18n(""), "0.1");" << endl; ++ out << option().indent << "KDE::CmdLineArgs.init(\@ARGV, $about);" << endl; ++ out << option().indent << "my $a = KDE::Application;" << endl; + parentClass.replace(QRegExp("^Q"), "Qt::"); + parentClass.replace(QRegExp("^K"), "KDE::"); +- out << option().indent << "my $w = " << parentClass << endl; +- out << option().indent << option().prefix << className << "setupUi($w)" << endl; +- out << option().indent << "$a->topWidget = $w" << endl; +- out << option().indent << "$w->show()" << endl; +- out << option().indent << "$a->exec()" << endl; ++ out << option().indent << "my $w = " << parentClass << ";" << endl; ++ out << option().indent << option().prefix << className << "setupUi($w);" << endl; ++ out << option().indent << "$a->topWidget = $w;" << endl; ++ out << option().indent << "$w->show();" << endl; ++ out << option().indent << "$a->exec();" << endl; + out << "}" << endl; +- out << "exit main()" << endl; ++ out << "exit main();" << endl; + } else { + out << "\n\nsub main {" << endl; +- out << option().indent << "my $a = Qt::Application(\@ARGV)" << endl; ++ out << option().indent << "my $a = Qt::Application(\@ARGV);" << endl; + parentClass.replace(QRegExp("^Q"), "Qt::"); +- out << option().indent << "my $w = " << parentClass << endl; +- out << option().indent << "my $u = " << option().prefix << className << endl; +- out << option().indent << "$w->show()" << endl; +- out << option().indent << "$a->exec()" << endl; ++ out << option().indent << "my $w = " << parentClass << ";" << endl; ++ out << option().indent << "my $u = " << option().prefix << className << ";" << endl; ++ out << option().indent << "$w->show();" << endl; ++ out << option().indent << "$a->exec();" << endl; + out << "}" << endl; +- out << "exit main()" << endl; ++ out << "exit main();" << endl; + } + } + +-- +2.5.5 + diff --git a/perl-Qt.spec b/perl-Qt.spec index 65e81bc..18047a0 100644 --- a/perl-Qt.spec +++ b/perl-Qt.spec @@ -23,6 +23,8 @@ Patch4: perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.pa Patch5: Qt-0.96.0-Initialize-smokeperl_object-properly.patch # Adjust to smokeqt's QChar, in upstream after 4.8.0 Patch6: Qt-0.96.0-Fix-uchar-test.patch +# Fix code generation with "puic4 -x", bug #1118240, in upstream after 4.14.3 +Patch7: Qt-0.96.0-Fix-problems-with-puic4-x-code-generation.patch BuildRequires: coreutils BuildRequires: cmake # gcc for C standard library headers @@ -95,6 +97,7 @@ Development files for perl-Qt. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1
mkdir build
@@ -169,6 +172,7 @@ export PERL5LIB="$PWD/blib/lib:$PWD/blib/arch" * Tue Mar 22 2016 Petr Pisar ppisar@redhat.com - 0.96.0-19 - Modernize spec file - Run X11 tests +- Fix code generation with "puic4 -x" (bug #1118240)
* Thu Feb 04 2016 Fedora Release Engineering releng@fedoraproject.org - 0.96.0-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
perl-devel@lists.fedoraproject.org