From e87da0a2c1e0243e99cafd7553e0705d3858657d Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 17:19:23 +0100 Subject: [PATCH] added debug package [release 0.2.0-2mamba;Mon Mar 12 2012] --- README.md | 3 + qtscriptgenerator-0.1.0-gcc44.patch | 11 ++ qtscriptgenerator-0.1.0-no_phonon.patch | 11 ++ qtscriptgenerator-0.2.0-arm-ftbfs-float.patch | 41 ++++++ ...generator-0.2.0-memory_alignment_fix.patch | 137 ++++++++++++++++++ qtscriptgenerator.spec | 90 ++++++++++++ 6 files changed, 293 insertions(+) create mode 100644 qtscriptgenerator-0.1.0-gcc44.patch create mode 100644 qtscriptgenerator-0.1.0-no_phonon.patch create mode 100644 qtscriptgenerator-0.2.0-arm-ftbfs-float.patch create mode 100644 qtscriptgenerator-0.2.0-memory_alignment_fix.patch create mode 100644 qtscriptgenerator.spec diff --git a/README.md b/README.md index bba1f04..7d96bfd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # qtscriptgenerator +Qt Script Generator is a tool that generates Qt bindings for Qt Script. With the generated bindings you get access to substantial portions of the Qt API from within Qt Script. +Qt is a cross-platform application framework for desktop and embedded development. It includes an intuitive API and a rich C++ class library, integrated tools for GUI development and internationalization, and support for Java™ and C++ development. + diff --git a/qtscriptgenerator-0.1.0-gcc44.patch b/qtscriptgenerator-0.1.0-gcc44.patch new file mode 100644 index 0000000..c9a69e4 --- /dev/null +++ b/qtscriptgenerator-0.1.0-gcc44.patch @@ -0,0 +1,11 @@ +diff -uNr generator.orig/parser/rpp/pp.h generator/parser/rpp/pp.h +--- generator.orig/parser/rpp/pp.h 2008-12-05 11:01:44.000000000 +0100 ++++ generator/parser/rpp/pp.h 2008-12-13 10:42:22.000000000 +0100 +@@ -30,6 +30,7 @@ + #include + + #include ++#include + + #ifdef HAVE_MMAP + # include diff --git a/qtscriptgenerator-0.1.0-no_phonon.patch b/qtscriptgenerator-0.1.0-no_phonon.patch new file mode 100644 index 0000000..f6ca4c3 --- /dev/null +++ b/qtscriptgenerator-0.1.0-no_phonon.patch @@ -0,0 +1,11 @@ +diff -up qtscriptgenerator-src-0.1.0/qtbindings/qtbindings.pro.no_phonon qtscriptgenerator-src-0.1.0/qtbindings/qtbindings.pro +--- qtscriptgenerator-src-0.1.0/qtbindings/qtbindings.pro.no_phonon 2009-02-20 05:42:24.000000000 -0600 ++++ qtscriptgenerator-src-0.1.0/qtbindings/qtbindings.pro 2009-03-10 09:54:04.000000000 -0500 +@@ -6,7 +6,6 @@ SUBDIRS = qtscript_core \ + qtscript_sql \ + qtscript_svg \ + qtscript_xml \ +- qtscript_phonon \ + qtscript_webkit \ + qtscript_xmlpatterns \ + qtscript_uitools \ diff --git a/qtscriptgenerator-0.2.0-arm-ftbfs-float.patch b/qtscriptgenerator-0.2.0-arm-ftbfs-float.patch new file mode 100644 index 0000000..6305c9a --- /dev/null +++ b/qtscriptgenerator-0.2.0-arm-ftbfs-float.patch @@ -0,0 +1,41 @@ +diff -Nru qtscriptgenerator-src-0.2.0.orig/generator/typesystem_core-common.xml qtscriptgenerator-src-0.2.0/generator/typesystem_core-common.xml +--- qtscriptgenerator-src-0.2.0.orig/generator/typesystem_core-common.xml 2012-01-23 12:30:03.000000000 +0100 ++++ qtscriptgenerator-src-0.2.0/generator/typesystem_core-common.xml 2012-03-08 05:36:14.342528441 +0100 +@@ -921,6 +921,7 @@ + + + ++ + + + +diff -Nru qtscriptgenerator-src-0.2.0.orig/generator/typesystem_core-qtscript.xml qtscriptgenerator-src-0.2.0/generator/typesystem_core-qtscript.xml +--- qtscriptgenerator-src-0.2.0.orig/generator/typesystem_core-qtscript.xml 2012-01-23 12:30:03.000000000 +0100 ++++ qtscriptgenerator-src-0.2.0/generator/typesystem_core-qtscript.xml 2012-03-08 05:41:37.492524499 +0100 +@@ -1447,6 +1447,7 @@ + + + ++ + + + +diff -Nru qtscriptgenerator-src-0.2.0.orig/generator/typesystem_core.xml qtscriptgenerator-src-0.2.0/generator/typesystem_core.xml +--- qtscriptgenerator-src-0.2.0.orig/generator/typesystem_core.xml 2012-01-23 12:30:03.000000000 +0100 ++++ qtscriptgenerator-src-0.2.0/generator/typesystem_core.xml 2012-03-08 05:39:53.932524942 +0100 +@@ -1388,14 +1388,12 @@ + + + +- +- +- + + + + + ++ + + + diff --git a/qtscriptgenerator-0.2.0-memory_alignment_fix.patch b/qtscriptgenerator-0.2.0-memory_alignment_fix.patch new file mode 100644 index 0000000..fbdda93 --- /dev/null +++ b/qtscriptgenerator-0.2.0-memory_alignment_fix.patch @@ -0,0 +1,137 @@ +From: Modestas Vainius +Subject: [PATCH] Memory alignment fixes + +Fixes various memory alignment issues which cause generator to crash on +alignment-sensitive architectures. + +Signed-off-by: Modestas Vainius + +--- + 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(-) + +diff --git a/generator/parser/ast.h b/generator/parser/ast.h +index c213b21..90be00a 100644 +--- a/generator/parser/ast.h ++++ b/generator/parser/ast.h +@@ -863,7 +863,7 @@ struct QEnumsAST : public DeclarationAST + template + _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; + } +diff --git a/generator/parser/list.h b/generator/parser/list.h +index e25a6d9..bfc5cb8 100644 +--- a/generator/parser/list.h ++++ b/generator/parser/list.h +@@ -37,7 +37,7 @@ struct ListNode + + static ListNode *create(const Tp &element, pool *p) + { +- ListNode *node = new (p->allocate(sizeof(ListNode))) ListNode(); ++ ListNode *node = new (p->allocate(sizeof(ListNode), strideof(ListNode))) ListNode(); + node->element = element; + node->index = 0; + node->next = node; +diff --git a/generator/parser/rpp/pp-symbol.h b/generator/parser/rpp/pp-symbol.h +index de646df..f82bd42 100644 +--- a/generator/parser/rpp/pp-symbol.h ++++ b/generator/parser/rpp/pp-symbol.h +@@ -24,6 +24,11 @@ class pp_symbol + static rxx_allocator__allocator; + return __allocator; + } ++ static rxx_allocator &ppfs_allocator_instance () ++ { ++ static rxx_allocator__ppfs_allocator; ++ return __ppfs_allocator; ++ } + + public: + static int &N() +@@ -39,7 +44,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); + } + +@@ -59,7 +64,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); + } + +diff --git a/generator/parser/rxx_allocator.h b/generator/parser/rxx_allocator.h +index ee6bddb..1e6ccd2 100644 +--- a/generator/parser/rxx_allocator.h ++++ b/generator/parser/rxx_allocator.h +@@ -31,6 +31,17 @@ + #include + #include + ++// Stride calculation ++template ++struct Tchar { ++ T t; ++ char c; ++}; ++ ++#define strideof(T) \ ++ ((sizeof(Tchar) > sizeof(T)) ? \ ++ sizeof(Tchar)-sizeof(T) : sizeof(T)) ++ + template class rxx_allocator { + public: + typedef _Tp value_type; +@@ -89,6 +100,12 @@ public: + return p; + } + ++ pointer allocate(size_type __n, size_type stride, const void* = 0) { ++ if (reinterpret_cast(_M_current_block + _M_current_index) % stride > 0) ++ _M_current_index += stride - reinterpret_cast(_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); } +diff --git a/generator/parser/smallobject.h b/generator/parser/smallobject.h +index 0debcc8..2c4f541 100644 +--- a/generator/parser/smallobject.h ++++ b/generator/parser/smallobject.h +@@ -35,6 +35,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) +@@ -42,6 +43,11 @@ inline void *pool::allocate(std::size_t __size) + 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; +-- +tg: (95a3b52..) general/memory_alignment_fix (depends on: upstream) diff --git a/qtscriptgenerator.spec b/qtscriptgenerator.spec new file mode 100644 index 0000000..5633c5e --- /dev/null +++ b/qtscriptgenerator.spec @@ -0,0 +1,90 @@ +Name: qtscriptgenerator +Version: 0.2.0 +Release: 2mamba +Summary: QtScript bindings generator +Group: Development/Bindings +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://code.google.com/p/qtscriptgenerator +Source: http://qtscriptgenerator.googlecode.com/files/qtscriptgenerator-src-%{version}.tar.gz +Patch0: %{name}-0.1.0-no_phonon.patch +Patch1: %{name}-0.1.0-gcc44.patch +Patch2: %{name}-0.2.0-arm-ftbfs-float.patch +Patch3: %{name}-0.2.0-memory_alignment_fix.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libfontconfig-devel +BuildRequires: libfreetype-devel +BuildRequires: libgcc +BuildRequires: libGL-devel +BuildRequires: libglib-devel +BuildRequires: libGLU-devel +BuildRequires: libICE-devel +BuildRequires: libpng-devel +BuildRequires: libqt4-devel +BuildRequires: libphonon-devel +BuildRequires: libSM-devel +BuildRequires: libsqlite-devel +BuildRequires: libstdc++6-devel +BuildRequires: libX11-devel +BuildRequires: libXext-devel +BuildRequires: libXfixes-devel +BuildRequires: libXinerama-devel +BuildRequires: libXrender-devel +BuildRequires: libz-devel +## AUTOBUILDREQ-END +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%debug_package + +%description +Qt Script Generator is a tool that generates Qt bindings for Qt Script. With the generated bindings you get access to substantial portions of the Qt API from within Qt Script. +Qt is a cross-platform application framework for desktop and embedded development. It includes an intuitive API and a rich C++ class library, integrated tools for GUI development and internationalization, and support for Java™ and C++ development. + +%prep +%setup -q -n %{name}-src-%{version} +%patch0 -p1 +%patch1 -p0 +%ifarch arm +%patch2 -p1 +%endif +%patch3 -p1 + +%build +cd generator +export QTDIR=%{_libdir}/qt4 +# workaround +export INCLUDE=%{_includedir}/qt4 +qmake-qt4 +%make +./generator +cd ../qtbindings +qmake-qt4 +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +mkdir -p %{buildroot}%{_qt4_plugindir}/script/ +cp -a plugins/script/libqtscript* \ + %{buildroot}%{_qt4_plugindir}/script/ + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_qt4_plugindir}/script/libqtscript_*.so +%{_qt4_plugindir}/script/libqtscript_*.so.* +%doc README + +%changelog +* Mon Mar 12 2012 Silvan Calarco 0.2.0-2mamba +- added debug package + +* Thu Mar 08 2012 Silvan Calarco 0.2.0-1mamba +- update to 0.2.0 + +* Mon Mar 09 2009 Silvan Calarco 0.1.0-1mamba +- package created by autospec