[153140] trunk/dports/devel/qtscriptgenerator

michaelld at macports.org michaelld at macports.org
Sun Sep 25 12:15:58 PDT 2016


Revision: 153140
          https://trac.macports.org/changeset/153140
Author:   michaelld at macports.org
Date:     2016-09-25 12:15:57 -0700 (Sun, 25 Sep 2016)
Log Message:
-----------
qtscriptgenerator: fix to work with modern OSX and Clang; addresses ticket #47204.

Modified Paths:
--------------
    trunk/dports/devel/qtscriptgenerator/Portfile
    trunk/dports/devel/qtscriptgenerator/files/patch-generator_typesystem_phonon-qtscript.xml.diff
    trunk/dports/devel/qtscriptgenerator/files/qtsg.pro

Added Paths:
-----------
    trunk/dports/devel/qtscriptgenerator/files/debian_drop_extra_linkage_fix.diff
    trunk/dports/devel/qtscriptgenerator/files/debian_qs_eval_globalize.diff
    trunk/dports/devel/qtscriptgenerator/files/patch-build-system-for-MacPorts.diff
    trunk/dports/devel/qtscriptgenerator/files/patch-include-everything.diff
    trunk/dports/devel/qtscriptgenerator/files/qs_eval.1
    trunk/dports/devel/qtscriptgenerator/files/remove-QtScriptFutureIterator.diff
    trunk/dports/devel/qtscriptgenerator/files/upstream_memory_alignment_fix.diff
    trunk/dports/devel/qtscriptgenerator/files/upstream_support_later_phonon.diff

Modified: trunk/dports/devel/qtscriptgenerator/Portfile
===================================================================
--- trunk/dports/devel/qtscriptgenerator/Portfile	2016-09-25 18:33:41 UTC (rev 153139)
+++ trunk/dports/devel/qtscriptgenerator/Portfile	2016-09-25 19:15:57 UTC (rev 153140)
@@ -6,6 +6,7 @@
 
 name                qtscriptgenerator
 version             0.2.0
+revision            1
 categories          devel kde4
 license             LGPL-2.1
 maintainers         michaelld openmaintainer
@@ -16,7 +17,7 @@
 platforms           darwin
 homepage            http://labs.trolltech.com/page/Projects/QtScript/Generator
 distname            ${name}-src-${version}
-master_sites        googlecode
+master_sites        http://qtscriptgenerator.googlecode.com/files/
 checksums           md5     9f82b0aa212f7938de37df46cd27165c \
                     sha1    4c1078f26b196156e857c17c9d11a66cfea66f00 \
                     rmd160  01c8ce3b4c8e9ebb3bc3c2d7b319846f34baee04 
@@ -27,7 +28,14 @@
 patchfiles          patch-generator.diff \
                     patch-qtbindings.diff \
                     patch-generator_typesystem_phonon-qtscript.xml.diff \
-                    patch-generator_typesystem_phonon.xml.diff
+                    patch-generator_typesystem_phonon.xml.diff \
+                    debian_drop_extra_linkage_fix.diff \
+                    debian_qs_eval_globalize.diff \
+                    upstream_memory_alignment_fix.diff \
+                    upstream_support_later_phonon.diff \
+                    remove-QtScriptFutureIterator.diff \
+                    patch-include-everything.diff \
+                    patch-build-system-for-MacPorts.diff
 
 # check for +debug variant of this port, and make sure phonon was
 # installed with +debug as well; if not, error out.  phonon checks to
@@ -49,6 +57,21 @@
     # copy the QMake build script into place
     copy ${filespath}/qtsg.pro ${worksrcpath}
 
+    reinplace "s|@QT_FRAMEWORKS_DIR@|${qt_frameworks_dir}|g" \
+        ${worksrcpath}/generator/main.h
+    reinplace -W ${worksrcpath} "s|@QT_INCLUDES_DIR@|${qt_includes_dir}|g" \
+        generator/main.h \
+        generator/generator.pri \
+        qtbindings/qtbindingsbase.pri
+    reinplace -W ${worksrcpath} "s|@PREFIX@|${prefix}|g" \
+        generator/main.h \
+        generator/generator.pri \
+        qtbindings/qtbindingsbase.pri
+    reinplace "s|@CC@|${configure.cc}|g" \
+        ${worksrcpath}/qtsg.pro
+    reinplace "s|@CXX@|${configure.cxx}|g" \
+        ${worksrcpath}/qtsg.pro
+
     # allow for universal and non-native building if just the
     # qtbinding scripts, not the generator (which is solely used for
     # generating the scripts)
@@ -70,6 +93,11 @@
 configure.args      "-o Makefile qtsg.pro"
 configure.post_args
 configure.universal_args
+configure.env-delete \
+                    QTDIR=${qt_dir}
+build.env-delete    QTDIR=${qt_dir}
+# used by generator/generator:
+build.env-append    QTFRAMEWORKS=${qt_frameworks_dir}
 
 # allow ccache, if specified by the user
 pre-build {
@@ -78,6 +106,24 @@
     }
 }
 
+variant docs description {installs the documentation} {}
+
+post-destroot {
+    xinstall -m 755 ${build.dir}/generator/generator ${destroot}${prefix}/bin/qs_generator
+    xinstall -m 755 ${build.dir}/qtbindings/qs_eval/qs_eval ${destroot}${prefix}/bin/qs_eval
+    xinstall -m 755 -d ${destroot}${prefix}/share/man/man1
+    xinstall -m 644 ${filespath}/qs_eval.1 ${destroot}${prefix}/share/man/man1/qs_eval.1
+    reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/share/man/man1/qs_eval.1
+    if {[variant_isset docs]} {
+        xinstall -m 755 -d ${destroot}${prefix}/share/doc/qtscriptgenerator
+        foreach d [glob -nocomplain ${build.dir}/doc/*] {
+            file copy ${d} ${destroot}${prefix}/share/doc/qtscriptgenerator
+        }
+    }
+    xinstall -m 755 -d ${destroot}${prefix}/share/doc/qtscriptgenerator
+    file copy ${build.dir}/examples ${destroot}${prefix}/share/doc/qtscriptgenerator
+}
+
 variant debug description "Build release and debug versions" {}
 
 # need to check this to make sure it works

Added: trunk/dports/devel/qtscriptgenerator/files/debian_drop_extra_linkage_fix.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/debian_drop_extra_linkage_fix.diff	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/debian_drop_extra_linkage_fix.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,43 @@
+From: Modestas Vainius <modestas at vainius.eu>
+Subject: [PATCH] Reduce excess linkage
+
+Do not link to unnecessary libraries.
+
+Signed-off-by: Modestas Vainius <modestas at vainius.eu>
+
+---
+ qtbindings/qtbindingsbase.pri                      |    2 ++
+ qtbindings/qtscript_core/qtscript_core.pro         |    2 ++
+ qtbindings/qtscript_uitools/qtscript_uitools.pro   |    2 ++
+ .../qtscript_xmlpatterns/qtscript_xmlpatterns.pro  |    2 ++
+ 4 files changed, 8 insertions(+), 0 deletions(-)
+
+--- qtbindings/qtscript_core/qtscript_core.pro
++++ qtbindings/qtscript_core/qtscript_core.pro
+@@ -1,4 +1,6 @@
+ TARGET = qtscript_core
+ include(../qtbindingsbase.pri)
++qt:load(qt)
++LIBS -= -lQtGui
+ SOURCES += $$GENERATEDCPP/com_trolltech_qt_core/plugin.cpp
+ include($$GENERATEDCPP/com_trolltech_qt_core/com_trolltech_qt_core.pri)
+--- qtbindings/qtscript_uitools/qtscript_uitools.pro
++++ qtbindings/qtscript_uitools/qtscript_uitools.pro
+@@ -1,5 +1,7 @@
+ TARGET = qtscript_uitools
+ include(../qtbindingsbase.pri)
+ CONFIG += uitools
++QT -= xml
++qt:load(qt)
+ SOURCES += $$GENERATEDCPP/com_trolltech_qt_uitools/plugin.cpp
+ include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri)
+--- qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro
++++ qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro
+@@ -2,5 +2,7 @@ TARGET = qtscript_xmlpatterns
+ include(../qtbindingsbase.pri)
+ QT -= gui
+ QT += xmlpatterns network
++qt:load(qt)
++LIBS -= -lQtNetwork
+ SOURCES += $$GENERATEDCPP/com_trolltech_qt_xmlpatterns/plugin.cpp
+ include($$GENERATEDCPP/com_trolltech_qt_xmlpatterns/com_trolltech_qt_xmlpatterns.pri)

Added: trunk/dports/devel/qtscriptgenerator/files/debian_qs_eval_globalize.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/debian_qs_eval_globalize.diff	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/debian_qs_eval_globalize.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,51 @@
+From: Modestas Vainius <modestas at vainius.eu>
+Subject: [PATCH] debian/qs_eval_globalize
+
+Disable qs_eval code which tries to load locally built plugins.
+
+Signed-off-by: Modestas Vainius <modestas at vainius.eu>
+
+---
+ qtbindings/qs_eval/main.cpp |   12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+--- qtbindings/qs_eval/main.cpp
++++ qtbindings/qs_eval/main.cpp
+@@ -142,6 +142,7 @@ int main(int argc, char *argv[])
+     else
+         app = new QApplication(argc, argv);
+ 
++#if 0
+     QDir dir(QApplication::applicationDirPath());
+     if (dir.dirName() == QLatin1String("debug") || dir.dirName() == QLatin1String("release"))
+         dir.cdUp();
+@@ -154,6 +155,7 @@ int main(int argc, char *argv[])
+     QStringList paths = app->libraryPaths();
+     paths <<  dir.absolutePath();
+     app->setLibraryPaths(paths);
++#endif
+ 
+     QScriptEngine *eng = new QScriptEngine();
+ 
+@@ -177,17 +179,15 @@ int main(int argc, char *argv[])
+     if (!failExtensions.isEmpty()) {
+         if (failExtensions.size() == extensions.size()) {
+             qWarning("Failed to import Qt bindings!\n"
+-                     "Plugins directory searched: %s/script\n"
+-                     "Make sure that the bindings have been built, "
++                     "Make sure that the bindings have been installed, "
+                      "and that this executable and the plugins are "
+-                     "using compatible Qt libraries.", qPrintable(dir.absolutePath()));
++                     "using compatible Qt libraries.");
+         } else {
+             qWarning("Failed to import some Qt bindings: %s\n"
+-                     "Plugins directory searched: %s/script\n"
+-                     "Make sure that the bindings have been built, "
++                     "Make sure that the bindings have been installed, "
+                      "and that this executable and the plugins are "
+                      "using compatible Qt libraries.",
+-                     qPrintable(failExtensions.join(", ")), qPrintable(dir.absolutePath()));
++                     qPrintable(failExtensions.join(", ")));
+         }
+     }
+ 

Added: trunk/dports/devel/qtscriptgenerator/files/patch-build-system-for-MacPorts.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/patch-build-system-for-MacPorts.diff	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/patch-build-system-for-MacPorts.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,80 @@
+diff --git generator/generator.pri generator/generator.pri
+index daa3e0c..3b62b9b 100644
+--- generator/generator.pri
++++ generator/generator.pri
+@@ -5,6 +5,12 @@ TEMPLATE = app
+ TARGET = generator
+ DEPENDPATH += $$GENERATORPATH tests parser
+ mac:CONFIG -= app_bundle
++
++LIBS *= -L at PREFIX@/lib
++INCLUDEPATH += @QT_INCLUDES_DIR@
++INCLUDEPATH += @PREFIX@/include/phonon
++INCLUDEPATH += @PREFIX@/include
++
+ INCLUDEPATH += $$GENERATORPATH/.
+ INCLUDEPATH += $$GENERATORPATH/../common
+ 
+diff --git generator/main.h generator/main.h
+index ebf153d..dd65632 100644
+--- generator/main.h
++++ generator/main.h
+@@ -46,6 +46,7 @@
+ 
+ #include <QFile>
+ #include <QDir>
++#include <QDebug>
+ 
+ struct Preprocess
+ {
+@@ -87,17 +88,24 @@ struct Preprocess
+             includes += commandLineIncludes.split(path_splitter);        
+ 
+         // Include Qt
++        qDebug() << "includes=" << includes;
+         QString qtdir = getenv ("QTDIR");
+         if (qtdir.isEmpty()) {
+ #if defined(Q_OS_MAC)
+             qWarning("QTDIR environment variable not set. Assuming standard binary install using frameworks.");
+-            QString frameworkDir = "/Library/Frameworks";
++            QString frameworkDir = getenv("QTFRAMEWORKS");
++            if (frameworkDir.isEmpty()) {
++                frameworkDir = "@QT_FRAMEWORKS_DIR@";
++            }
+             includes << (frameworkDir + "/QtXml.framework/Headers");
+             includes << (frameworkDir + "/QtNetwork.framework/Headers");
+             includes << (frameworkDir + "/QtCore.framework/Headers");
+             includes << (frameworkDir + "/QtGui.framework/Headers");
+             includes << (frameworkDir + "/QtOpenGL.framework/Headers");
+             includes << frameworkDir;
++            includes << "@QT_INCLUDES_DIR@";
++            includes << "@PREFIX@/include/phonon";
++            includes << "@PREFIX@/include";
+ #else
+             qWarning("QTDIR environment variable not set. This may cause problems with finding the necessary include files.");
+ #endif
+@@ -110,6 +118,7 @@ struct Preprocess
+             includes << (qtdir + "/QtOpenGL");
+             includes << qtdir;
+         }
++        qDebug() << "includes=" << includes;
+ 
+         foreach (QString include, includes)
+             preprocess.push_include_path(QDir::convertSeparators(include).toStdString());        
+diff --git qtbindings/qtbindingsbase.pri qtbindings/qtbindingsbase.pri
+index 54eb9a5..3021b73 100644
+--- qtbindings/qtbindingsbase.pri
++++ qtbindings/qtbindingsbase.pri
+@@ -1,9 +1,12 @@
+ TEMPLATE = lib
+ DEPENDPATH += .
+ INCLUDEPATH += .
++INCLUDEPATH += @QT_INCLUDES_DIR@
++INCLUDEPATH += @PREFIX@/include/phonon
++INCLUDEPATH += @PREFIX@/include
+ DESTDIR = $$PWD/../plugins/script
+ QT += script
+ CONFIG += @ARCHES@ @BUILD_TYPE@
+ GENERATEDCPP = $$PWD/../generated_cpp
+ TARGET=$$qtLibraryTarget($$TARGET)
+ target.path = $$[QT_INSTALL_PLUGINS]/script

Modified: trunk/dports/devel/qtscriptgenerator/files/patch-generator_typesystem_phonon-qtscript.xml.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/patch-generator_typesystem_phonon-qtscript.xml.diff	2016-09-25 18:33:41 UTC (rev 153139)
+++ trunk/dports/devel/qtscriptgenerator/files/patch-generator_typesystem_phonon-qtscript.xml.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -5,7 +5,7 @@
      <interface-type name="Phonon::PlatformPlugin" java-name="PlatformPlugin">
          <modify-function signature="deviceAccessListFor(Phonon::AudioOutputDevice)const" remove="all" />
 +        <modify-function signature="deviceAccessListFor(Phonon::AudioCaptureDevice)const" remove="all" />
-+	<modify-function signature="deviceAccessListFor(Phonon::VideoCaptureDevice)const" remove="all" />
++        <modify-function signature="deviceAccessListFor(Phonon::VideoCaptureDevice)const" remove="all" />
      </interface-type>
  
    <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'Phonon::AddonInterface::SubtitleCommand' does not have a type entry or is not an enum" />

Added: trunk/dports/devel/qtscriptgenerator/files/patch-include-everything.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/patch-include-everything.diff	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/patch-include-everything.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,55 @@
+--- generator/orig.qtscript_masterinclude.h	2015-10-30 10:37:09.000000000 +0100
++++ generator/qtscript_masterinclude.h	2015-10-30 10:39:06.000000000 +0100
+@@ -49,15 +49,47 @@
+ 
+ #include <QtUiTools/QtUiTools>
+ 
+-#ifndef QT_NO_XMLPATTERNS
++// #ifndef QT_NO_XMLPATTERNS
+ #  include <QtXmlPatterns/QtXmlPatterns>
+-#endif
++// #endif
+ 
+-#ifndef QT_NO_WEBKIT
++// #ifndef QT_NO_WEBKIT
+ #  include <QtWebKit/QtWebKit>
+-#endif
++// #endif
+ 
+-#  include <phonon/phonon>
++// #  include <phonon/phonon>
++
++#include "phonon/abstractaudiooutput.h"                                                             
++#include "phonon/abstractmediastream.h"                                                             
++#include "phonon/abstractvideooutput.h"                                                             
++#include "phonon/addoninterface.h"                                                                  
++#include "phonon/audiooutput.h"                                                                     
++#include "phonon/audiooutputinterface.h"                                                            
++#include "phonon/backendcapabilities.h"                                                             
++#include "phonon/backendinterface.h"
++#include "phonon/effect.h"
++#include "phonon/effectinterface.h"
++#include "phonon/effectparameter.h"
++#include "phonon/effectwidget.h"
++#include "phonon/mediacontroller.h"
++#include "phonon/medianode.h"
++#include "phonon/mediaobject.h"
++#include "phonon/mediaobjectinterface.h"
++#include "phonon/mediasource.h"
++#include "phonon/objectdescription.h"
++#include "phonon/objectdescriptionmodel.h"
++#include "phonon/path.h"
++#include "phonon/phonondefs.h"
++#include "phonon/phononnamespace.h"
++#include "phonon/platformplugin.h"
++#include "phonon/seekslider.h"
++#include "phonon/streaminterface.h"
++#include "phonon/videoplayer.h"
++#include "phonon/videowidget.h"
++#include "phonon/videowidgetinterface.h"
++#include "phonon/volumefadereffect.h"
++#include "phonon/volumefaderinterface.h"
++#include "phonon/volumeslider.h"
+ 
+ #include "../qtbindings/qtscript_core/qtscriptconcurrent.h"
+ 

Added: trunk/dports/devel/qtscriptgenerator/files/qs_eval.1
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/qs_eval.1	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/qs_eval.1	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,22 @@
+.TH QS_EVAL 1 "March 2009" "Qt Script" "A simple Qt Script interpreter"
+.SH NAME
+qs_eval \- A simple Qt Script interpreter / launcher
+.SH SYNOPSIS
+qs_eval [options] [FILE] [FILE ..]
+.SH DESCRIPTION
+qs_eval is a simple script interpreter / launcher that imports all the bindings.
+You can use it to run the examples found in @PREFIX@/share/doc/qtscriptgenerator/examples,
+e.g. with the examples directory being the working directory. If no script files are
+specified, qs_eval will enter interactive mode.
+.SS Arguments:
+FILE                    Qt Script file to run
+.SS 
+.SS Options:
+.TP
+.B \-tty
+Assume the script is a console application (QApplication::Tty)
+.SH AUTHORS
+.P
+Trolltech ASA
+.P
+Manual page was written by Modestas Vainius for Debian GNU/Linux distribution.

Modified: trunk/dports/devel/qtscriptgenerator/files/qtsg.pro
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/qtsg.pro	2016-09-25 18:33:41 UTC (rev 153139)
+++ trunk/dports/devel/qtscriptgenerator/files/qtsg.pro	2016-09-25 19:15:57 UTC (rev 153140)
@@ -3,4 +3,7 @@
 TEMPLATE = subdirs
 CONFIG   += ordered
 
+QMAKE_CC = @CC@
+QMAKE_CXX = @CXX@
+
 SUBDIRS = generator qtbindings

Added: trunk/dports/devel/qtscriptgenerator/files/remove-QtScriptFutureIterator.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/remove-QtScriptFutureIterator.diff	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/remove-QtScriptFutureIterator.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,52 @@
+--- generator/typesystem_core-common.xml.orig	2015-03-20 18:01:15.000000000 +0100
++++ generator/typesystem_core-common.xml	2015-03-20 18:01:39.000000000 +0100
+@@ -1387,7 +1387,6 @@
+   <object-type name="QFutureIterator" generate="no">
+     <modify-function signature="operator=(const QFuture&amp;)" remove="all" />
+   </object-type>
+-  <object-type name="QtScriptFutureIterator" generic-class="yes" java-name="QFutureIterator" />
+   <object-type name="QRunnable" />
+ 
+ 
+--- generator/typesystem_core-qtscript.xml.orig	2015-03-20 18:01:15.000000000 +0100
++++ generator/typesystem_core-qtscript.xml	2015-03-20 18:01:49.000000000 +0100
+@@ -1115,13 +1115,6 @@
+       <modify-function signature="futures()const" remove="all" />
+   </object-type>
+   
+-  <object-type name="QtScriptFutureIterator">
+-    <modify-function signature="QFutureIterator(const QFuture &amp;)">
+-        <modify-argument index="1">
+-            <replace-type modified-type="QtScriptFuture" />
+-        </modify-argument>
+-    </modify-function>       
+-  </object-type>
+ 
+ 
+   <!-- QXMLStream stream stuff. This was moved from QtXml to QtCore in 4.4 -->
+--- generator/typesystem_core.xml.orig	2015-03-20 18:01:15.000000000 +0100
++++ generator/typesystem_core.xml	2015-03-20 18:01:56.000000000 +0100
+@@ -2452,13 +2452,6 @@
+   <object-type name="QFutureIterator" generate="no">
+     <modify-function signature="operator=(const QFuture&amp;)" remove="all"/>
+   </object-type>
+-  <object-type name="QtScriptFutureIterator" generic-class="yes" java-name="QFutureIterator">
+-    <modify-function signature="QFutureIterator(const QFuture &amp;)">
+-        <modify-argument index="1">
+-            <replace-type modified-type="QtScriptFuture"/>
+-        </modify-argument>
+-    </modify-function>       
+-  </object-type>
+   <object-type name="QRunnable"/>
+ 
+ 
+--- qtbindings/qtscript_core/qtscriptconcurrent.h.orig	2012-01-23 12:30:03.000000000 +0100
++++ qtbindings/qtscript_core/qtscriptconcurrent.h	2015-03-20 18:01:59.000000000 +0100
+@@ -55,7 +55,6 @@
+ typedef QFuture<QScriptValue> QtScriptFuture;
+ typedef QFutureWatcher<QScriptValue> QtScriptFutureWatcher;
+ typedef QFutureSynchronizer<QScriptValue> QtScriptFutureSynchronizer;
+-typedef QFutureIterator<QScriptValue> QtScriptFutureIterator;
+ 
+ #endif // QT_NO_CONCURRENT
+ 

Added: trunk/dports/devel/qtscriptgenerator/files/upstream_memory_alignment_fix.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/upstream_memory_alignment_fix.diff	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/upstream_memory_alignment_fix.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,125 @@
+From: Modestas Vainius <modestas at vainius.eu>
+Subject: [PATCH] Memory alignment fixes
+
+Fixes various memory alignment issues which cause generator to crash on
+alignment-sensitive architectures.
+
+Signed-off-by: Modestas Vainius <modestas at vainius.eu>
+
+---
+ generator/parser/ast.h           |    2 +-
+ generator/parser/list.h          |    2 +-
+ generator/parser/rpp/pp-symbol.h |    9 +++++++--
+ generator/parser/rxx_allocator.h |   17 +++++++++++++++++
+ generator/parser/smallobject.h   |    6 ++++++
+ 5 files changed, 32 insertions(+), 4 deletions(-)
+
+--- generator/parser/ast.h
++++ generator/parser/ast.h
+@@ -880,7 +880,7 @@ struct QEnumsAST : public DeclarationAST
+ template <class _Tp>
+ _Tp *CreateNode(pool *memory_pool)
+ {
+-  _Tp *node = reinterpret_cast<_Tp*>(memory_pool->allocate(sizeof(_Tp)));
++  _Tp *node = reinterpret_cast<_Tp*>(memory_pool->allocate(sizeof(_Tp), strideof(_Tp)));
+   node->kind = _Tp::__node_kind;
+   return node;
+ }
+--- generator/parser/list.h
++++ generator/parser/list.h
+@@ -54,7 +54,7 @@ struct ListNode
+ 
+   static ListNode *create(const Tp &element, pool *p)
+   {
+-    ListNode<Tp> *node = new (p->allocate(sizeof(ListNode))) ListNode();
++    ListNode<Tp> *node = new (p->allocate(sizeof(ListNode), strideof(ListNode))) ListNode();
+     node->element = element;
+     node->index = 0;
+     node->next = node;
+--- generator/parser/rpp/pp-symbol.h
++++ generator/parser/rpp/pp-symbol.h
+@@ -51,6 +51,11 @@ class pp_symbol
+     static rxx_allocator<char>__allocator;
+     return __allocator;
+   }
++  static rxx_allocator<pp_fast_string> &ppfs_allocator_instance ()
++  {
++    static rxx_allocator<pp_fast_string>__ppfs_allocator;
++    return __ppfs_allocator;
++  }
+ 
+ public:
+   static int &N()
+@@ -66,7 +71,7 @@ public:
+     memcpy(data, __data, __size);
+     data[__size] = '\0';
+ 
+-    char *where = allocator_instance ().allocate (sizeof (pp_fast_string));
++    pp_fast_string *where = ppfs_allocator_instance ().allocate (sizeof (pp_fast_string));
+     return new (where) pp_fast_string (data, __size);
+   }
+ 
+@@ -86,7 +91,7 @@ public:
+     std::copy (__first, __last, data);
+     data[__size] = '\0';
+ 
+-    char *where = allocator_instance ().allocate (sizeof (pp_fast_string));
++    pp_fast_string *where = ppfs_allocator_instance ().allocate (sizeof (pp_fast_string));
+     return new (where) pp_fast_string (data, __size);
+   }
+ 
+--- generator/parser/rxx_allocator.h
++++ generator/parser/rxx_allocator.h
+@@ -48,6 +48,17 @@
+ #include <cstring>
+ #include <memory>
+ 
++// Stride calculation
++template <typename T>
++struct Tchar {
++  T t;
++  char c;
++};
++
++#define strideof(T)                            \
++  ((sizeof(Tchar<T>) > sizeof(T)) ?            \
++  sizeof(Tchar<T>)-sizeof(T) : sizeof(T))
++
+ template <class _Tp> class rxx_allocator {
+ public:
+   typedef _Tp value_type;
+@@ -106,6 +117,12 @@ public:
+     return p;
+   }
+ 
++  pointer allocate(size_type __n, size_type stride, const void* = 0) {
++    if (reinterpret_cast<size_type>(_M_current_block + _M_current_index) % stride > 0)
++      _M_current_index += stride - reinterpret_cast<size_type>(_M_current_block + _M_current_index) % stride;
++    return allocate(__n);
++  }
++
+   void deallocate(pointer __p, size_type __n) {}
+ 
+   size_type max_size() const { return size_type(-1) / sizeof(_Tp); }
+--- generator/parser/smallobject.h
++++ generator/parser/smallobject.h
+@@ -52,6 +52,7 @@ class pool
+ 
+ public:
+   inline void *allocate(std::size_t __size);
++  inline void *allocate(std::size_t __size, std::size_t __stride);
+ };
+ 
+ inline void *pool::allocate(std::size_t __size)
+@@ -59,6 +60,11 @@ inline void *pool::allocate(std::size_t
+   return __alloc.allocate(__size);
+ }
+ 
++inline void *pool::allocate(std::size_t __size, std::size_t __stride)
++{
++  return __alloc.allocate(__size, __stride);
++}
++
+ #endif
+ 
+ // kate: space-indent on; indent-width 2; replace-tabs on;

Added: trunk/dports/devel/qtscriptgenerator/files/upstream_support_later_phonon.diff
===================================================================
--- trunk/dports/devel/qtscriptgenerator/files/upstream_support_later_phonon.diff	                        (rev 0)
+++ trunk/dports/devel/qtscriptgenerator/files/upstream_support_later_phonon.diff	2016-09-25 19:15:57 UTC (rev 153140)
@@ -0,0 +1,27 @@
+From: Modestas Vainius <modax at debian.org>
+From: Felix Geyer <debfx-pkg at fobos.de>
+Subject: Fix building against system Phonon up to and including 4.6.0
+Forwarded: no
+Origin: vendor
+Last-Update: 2012-03-06
+
+--- generator/typesystem_phonon-common.xml
++++ generator/typesystem_phonon-common.xml
+@@ -101,6 +101,7 @@
+     <value-type name="Phonon::AudioChannelDescription" java-name="AudioChannelDescription" />
+     <value-type name="Phonon::SubtitleDescription" java-name="SubtitleDescription" />
+     <value-type name="Phonon::AudioCaptureDevice"  java-name="AudioCaptureDevice" />
++    <value-type name="Phonon::DeviceAccessList" java-name="DeviceAccessList" />
+ 
+     <object-type name="Phonon::AbstractAudioOutput" java-name="AbstractAudioOutput" />
+     <object-type name="Phonon::AbstractMediaStream" java-name="AbstractMediaStream" />
+--- generator/typesystem_phonon.xml
++++ generator/typesystem_phonon.xml
+@@ -128,6 +128,7 @@
+         <modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
+         <modify-function signature="fromIndex(int)" remove="all"/> 
+     </value-type>
++    <value-type name="Phonon::DeviceAccessList" java-name="DeviceAccessList" />
+ 
+     <object-type name="Phonon::AbstractAudioOutput" java-name="AbstractAudioOutput"/>
+     <object-type name="Phonon::AbstractMediaStream" java-name="AbstractMediaStream"/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160925/cab916c9/attachment-0001.html>


More information about the macports-changes mailing list