added debug package [release 0.2.0-2mamba;Mon Mar 12 2012]

This commit is contained in:
Silvan Calarco 2024-01-05 17:19:23 +01:00
parent 5d0c84784e
commit e87da0a2c1
6 changed files with 293 additions and 0 deletions

View File

@ -1,2 +1,5 @@
# qtscriptgenerator # 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.

View File

@ -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 <cctype>
#include <fcntl.h>
+#include <cstdio>
#ifdef HAVE_MMAP
# include <sys/mman.h>

View File

@ -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 \

View File

@ -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 @@
<value-type name="QEasingCurve">
<modify-function signature="customType()const" remove="all" />
<modify-function signature="setCustomType(double)" remove="all" />
+ <modify-function signature="setCustomType(float)" remove="all" />
</value-type>
<object-type name="QAbstractAnimation" />
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 @@
<modify-function signature="operator==(const QEasingCurve &amp;)const" remove="all"/>
<modify-function signature="operator!=(const QEasingCurve &amp;)const" remove="all"/>
<modify-function signature="setCustomType(double)" remove="all"/>
+ <modify-function signature="setCustomType(float)" remove="all"/>
<modify-function signature="customType()const" remove="all"/>
</value-type>
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 @@
</value-type>
<value-type name="QEasingCurve">
- <modify-function signature="customType()const" remove="all"/>
- <modify-function signature="setCustomType(double)" remove="all"/>
-
<modify-function signature="QEasingCurve(QEasingCurve)" remove="all"/>
<modify-function signature="operator=(QEasingCurve)" remove="all"/>
<modify-function signature="operator==(const QEasingCurve &amp;)const" remove="all"/>
<modify-function signature="operator!=(const QEasingCurve &amp;)const" remove="all"/>
<modify-function signature="setCustomType(double)" remove="all"/>
+ <modify-function signature="setCustomType(float)" remove="all"/>
<modify-function signature="customType()const" remove="all"/>
</value-type>

View File

@ -0,0 +1,137 @@
From: Modestas Vainius <modestas@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@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(-)
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 <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;
}
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<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;
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<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()
@@ -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 <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;
@@ -89,6 +100,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); }
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)

90
qtscriptgenerator.spec Normal file
View File

@ -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 <silvan.calarco@mambasoft.it>
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 <silvan.calarco@mambasoft.it> 0.2.0-2mamba
- added debug package
* Thu Mar 08 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 0.2.0-1mamba
- update to 0.2.0
* Mon Mar 09 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 0.1.0-1mamba
- package created by autospec