diff options
Diffstat (limited to 'dev-python/qtstatemachine')
6 files changed, 484 insertions, 0 deletions
diff --git a/dev-python/qtstatemachine/Manifest b/dev-python/qtstatemachine/Manifest new file mode 100644 index 00000000..aada8f2b --- /dev/null +++ b/dev-python/qtstatemachine/Manifest @@ -0,0 +1,6 @@ +AUX qstatemachines_add_CMake_support.patch_003 4827 RMD160 b462cf9d1c91cc6af0dfe0ffe1d4c1df68ec51ad SHA1 3323225f77d9fba7ec3431f53775883f0d15b439 SHA256 4822daf62e6e266e00220da108300e8c4cafadf2bcb08e973d9f721d004d357e +AUX qstatemachines_fix_compound_state.patch_002 2809 RMD160 87788328b902681f10c736f0a39d7b828509429a SHA1 ffed349fa3087f435b92eeb8c8c08074f9865f35 SHA256 58d9330eec0d22f9f54fb18276ea86fbaeee95a762a33a2d95c011270bbe3b40 +AUX qstatemachines_fix_history.patch_001 7507 RMD160 2417563f065816d8012587633e7fa921009676ee SHA1 e03a79b912a305ac0c8c3467994845a970fe0aaf SHA256 eec10835e5733dc9554cf7dd814bdad02f8183b28a32f949004059ce6ce30771 +DIST qtstatemachine-1.1-opensource.tar.gz 1339216 RMD160 102189d7bbb9d2260b1b15020f37f5a078dd8098 SHA1 25a748433bf1807165d176957710739a653c51a4 SHA256 141b78bccb709c203c62bb16c7a328b024d71e83263438e3e65d49c49d9486bd +EBUILD qtstatemachine-1.1-r1.ebuild 925 RMD160 1064b64d8dae03aa6b82bb2f85d5be32fdc96086 SHA1 73b7efa14d2af213faf4fb7d4696e3a0a523cea9 SHA256 0876be0b8faea518b038a5d880b8f9b55bdf61f4f1701ea0b36a821eb61d4fad +EBUILD qtstatemachine-1.1.ebuild 1024 RMD160 eced99f95ad1f4d24a9334acdcb73ebe37864b54 SHA1 64d9b1d191a6243bf14a889b8a0b5cbf65b6cbbb SHA256 da925a8b35bc4ca53f31486d03942192074ebd877798ad41dc0e51d5a8e5a188 diff --git a/dev-python/qtstatemachine/files/qstatemachines_add_CMake_support.patch_003 b/dev-python/qtstatemachine/files/qstatemachines_add_CMake_support.patch_003 new file mode 100644 index 00000000..d21e0126 --- /dev/null +++ b/dev-python/qtstatemachine/files/qstatemachines_add_CMake_support.patch_003 @@ -0,0 +1,154 @@ +--- /dev/null 2009-07-25 12:29:44.706468311 +0200 ++++ CMakeLists.txt 2009-07-27 17:39:53.000000000 +0200 +@@ -0,0 +1,151 @@ ++cmake_minimum_required(VERSION 2.6) ++project(QtStateMachines) ++ ++# Setup Cmake ++set(CMAKE_MODULE_PATH ++ ${PyQtStateMachines_SOURCE_DIR}/cmake/Modules ++ ) ++ ++# Setup Qt4 ++find_package(Qt4 REQUIRED) ++set(QT_USE_QTDBUS 1) ++set(QT_USE_QTGUI 1) ++set(QT_USE_QTSHARED 1) ++set(QT_USE_QTSCRIPT 1) ++include(${QT_USE_FILE}) ++ ++add_definitions(-DQT_STATEMACHINE_SOLUTION -DQT_NO_ANIMATION -DQT_SCRIPT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED) ++ ++include_directories( ++ ${CMAKE_CURRENT_SOURCE_DIR} ++ ${CMAKE_SOURCE_DIR}/src ++ ${QT_INCLUDE_DIR} ++ ${QT_QT_INCLUDE_DIR} ++ ${QT_QTCORE_INCLUDE_DIR} ++ ${CMAKE_CURRENT_BINARY_DIR}/src ++ ${CMAKE_CURRENT_BINARY_DIR} ++ ) ++ ++link_directories(${CMAKE_CURRENT_SOURCE_DIR}) ++ ++set(QtStateMachines_SOURCES ++ src/qabstractstate.cpp ++ src/qabstracttransition.cpp ++ src/qactionstate.cpp ++ src/qeventtransition.cpp ++ src/qfinalstate.cpp ++ src/qguistatemachine.cpp ++ src/qhistorystate.cpp ++ src/qscriptedstatemachine.cpp ++ src/qsignaltransition.cpp ++ src/qssmguiinvokers.cpp ++ src/qstateaction.cpp ++ src/qstate.cpp ++ src/qstatefinishedtransition.cpp ++ src/qstatemachine.cpp ++ src/qtransition.cpp ++) ++ ++ ++set(QtStateMachines_HEADERS ++ src/qabstractstate.h ++ src/qabstracttransition.h ++ src/qactionstate.h ++ src/qeventtransition.h ++ src/qfinalstate.h ++ src/qhistorystate.h ++ src/qscriptedstatemachine.h ++ src/qsignalevent.h ++ src/qsignaltransition.h ++ src/qstateaction.h ++ src/qstatefinishedevent.h ++ src/qstatefinishedtransition.h ++ src/qstate.h ++ src/qstatemachine.h ++ src/qtransition.h ++ src/qtstatemachineglobal.h ++) ++ ++MACRO(QT4_AUTOMOC_MY) ++ QT4_GET_MOC_FLAGS(_moc_INCS) ++ ++ SET(_matching_FILES ) ++ FOREACH (_current_FILE ${ARGN}) ++ ++ GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE) ++ # if "SKIP_AUTOMOC" is set to true, we will not handle this file here. ++ # This is required to make uic work correctly: ++ # we need to add generated .cpp files to the sources (to compile them), ++ # but we cannot let automoc handle them, as the .cpp files don't exist yet when ++ # cmake is run for the very first time on them -> however the .cpp files might ++ # exist at a later run. at that time we need to skip them, so that we don't add two ++ # different rules for the same moc file ++ GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC) ++ ++ IF ( NOT _skip AND EXISTS ${_abs_FILE} ) ++ ++ FILE(READ ${_abs_FILE} _contents) ++ ++ GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH) ++ ++ STRING(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" ++ _match ++ "${_contents}") ++ IF(_match) ++ FOREACH (_current_MOC_INC ${_match}) ++ STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}") ++ GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE) ++ IF(EXISTS ${_abs_PATH}/${_basename}.hpp) ++ SET(_header ${_abs_PATH}/${_basename}.hpp) ++ ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp) ++ SET(_header ${_abs_PATH}/${_basename}.h) ++ ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp) ++ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) ++ QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "") ++ MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) ++ message("DEPS: ${_abs_FILE} -> ${_moc}") ++ ENDFOREACH (_current_MOC_INC) ++ ENDIF(_match) ++ STRING(REGEX MATCHALL "# *include [\"<]moc_+[^ ]+\\.cpp[\">]" ++ _match ++ "${_contents}" ++ ) ++ IF(_match) ++ FOREACH (_current_MOC_INC ${_match}) ++ STRING(REGEX MATCH "[^ <\"_]+\\.cpp" _current_MOC "${_current_MOC_INC}") ++ GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE) ++ IF(EXISTS ${_abs_PATH}/${_basename}.hpp) ++ SET(_header ${_abs_PATH}/${_basename}.hpp) ++ ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp) ++ SET(_header ${_abs_PATH}/${_basename}.h) ++ ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp) ++ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_current_MOC}) ++ QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "") ++ MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) ++ ENDFOREACH (_current_MOC_INC) ++ ENDIF(_match) ++ ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} ) ++ ENDFOREACH (_current_FILE) ++ENDMACRO(QT4_AUTOMOC_MY) ++ ++add_library(StateMachineFramework SHARED ++ ${QtStateMachines_SOURCES} ++ ) ++ ++QT4_AUTOMOC_MY(${QtStateMachines_SOURCES}) ++ ++target_link_libraries(StateMachineFramework ++ ${QT_QTCORE_LIBRARY} ++ ${QT_QTGUI_LIBRARY} ++ ${QT_QTSCRIPT_LIBRARY} ++ ) ++ ++set_target_properties(StateMachineFramework ++ PROPERTIES ++ OUTPUT_NAME ++ QtSolutions_StateMachineFramework-1.1 ++ VERSION 1.0.0 ++ SOVERSION 1.0.0) ++ ++install(TARGETS StateMachineFramework DESTINATION lib${LIB_SUFFIX}) ++install(FILES ${QtStateMachines_HEADERS} DESTINATION include/QtStateMachines/) diff --git a/dev-python/qtstatemachine/files/qstatemachines_fix_compound_state.patch_002 b/dev-python/qtstatemachine/files/qstatemachines_fix_compound_state.patch_002 new file mode 100644 index 00000000..917bbf43 --- /dev/null +++ b/dev-python/qtstatemachine/files/qstatemachines_fix_compound_state.patch_002 @@ -0,0 +1,82 @@ +--- src/qstatemachine_history_fixed.cpp 2009-07-26 18:21:12.000000000 +0200 ++++ src/qstatemachine.cpp 2009-07-27 15:46:45.000000000 +0200 +@@ -273,6 +273,27 @@ + } + } + ++QtState *QtStateMachinePrivate::findActiveLCA(const QList<QtAbstractState*> &states) ++{ ++ if (states.isEmpty()) ++ return rootState; ++ QList<QtState*> ancestors = properAncestors(states.at(0), 0); ++ for (int i = 0; i < ancestors.size(); ++i) { ++ QtState *anc = ancestors.at(i); ++ if (!configuration.contains(anc)) ++ continue; ++ bool ok = true; ++ for (int j = states.size() - 1; (j > 0) && ok; --j) { ++ const QtAbstractState *s = states.at(j); ++ if (!isDescendantOf(s, anc)) ++ ok = false; ++ } ++ if (ok) ++ return anc; ++ } ++ return rootState; ++} ++ + QtState *QtStateMachinePrivate::findLCA(const QList<QtAbstractState*> &states) + { + if (states.isEmpty()) +@@ -378,8 +399,18 @@ + QList<QtAbstractState*> lst = t->targetStates(); + if (lst.isEmpty()) + continue; +- lst.prepend(t->sourceState()); +- QtAbstractState *lca = findLCA(lst); ++ QtAbstractState *lca; ++ if (isDescendantOf(t->targetState(), t->sourceState())) ++ { ++ lst.prepend(t->targetState()); ++ lca = findActiveLCA(lst); ++ } ++ else ++ { ++ lst.prepend(t->sourceState()); ++ lca = findLCA(lst); ++ } ++ + { + QSet<QtAbstractState*>::const_iterator it; + for (it = configuration.constBegin(); it != configuration.constEnd(); ++it) { +@@ -451,8 +482,17 @@ + QList<QtAbstractState*> lst = t->targetStates(); + if (lst.isEmpty()) + continue; +- lst.prepend(t->sourceState()); +- QtState *lca = findLCA(lst); ++ QtState *lca; ++ if (isDescendantOf(t->targetState(), t->sourceState())) ++ { ++ lst.prepend(t->targetState()); ++ lca = findActiveLCA(lst); ++ } ++ else ++ { ++ lst.prepend(t->sourceState()); ++ lca = findLCA(lst); ++ } + for (int j = 1; j < lst.size(); ++j) { + QtAbstractState *s = lst.at(j); + addStatesToEnter(s, lca, statesToEnter, statesForDefaultEntry); +diff -ru src_old/qstatemachine_p.h src/qstatemachine_p.h +--- src_old/qstatemachine_p.h 2009-07-26 18:38:06.000000000 +0200 ++++ src/qstatemachine_p.h 2009-07-26 18:37:15.000000000 +0200 +@@ -109,6 +109,7 @@ + + static QtStateMachinePrivate *get(QtStateMachine *q); + ++ QtState *findActiveLCA(const QList<QtAbstractState*> &states); + static QtState *findLCA(const QList<QtAbstractState*> &states); + + static bool stateEntryLessThan(QtAbstractState *s1, QtAbstractState *s2); diff --git a/dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001 b/dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001 new file mode 100644 index 00000000..fff31346 --- /dev/null +++ b/dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001 @@ -0,0 +1,155 @@ +--- src/qstatemachine_orig.cpp 2009-07-26 11:41:00.000000000 +0200 ++++ src/qstatemachine.cpp 2009-07-26 12:41:26.000000000 +0200 +@@ -455,37 +455,7 @@ + QtState *lca = findLCA(lst); + for (int j = 1; j < lst.size(); ++j) { + QtAbstractState *s = lst.at(j); +- if (QtHistoryState *h = qobject_cast<QtHistoryState*>(s)) { +- QList<QtAbstractState*> hconf = QtHistoryStatePrivate::get(h)->configuration; +- if (!hconf.isEmpty()) { +- for (int k = 0; k < hconf.size(); ++k) { +- QtAbstractState *s0 = hconf.at(k); +- addStatesToEnter(s0, lca, statesToEnter, statesForDefaultEntry); +- } +-#ifdef QSTATEMACHINE_DEBUG +- qDebug() << q << ": restoring" +- << ((QtHistoryStatePrivate::get(h)->historyType == QtState::DeepHistory) ? "deep" : "shallow") +- << "history from" << s << ":" << hconf; +-#endif +- } else { +- QList<QtAbstractState*> hlst; +- if (QtHistoryStatePrivate::get(h)->defaultState) +- hlst.append(QtHistoryStatePrivate::get(h)->defaultState); +- if (hlst.isEmpty()) { +- setError(QtStateMachine::NoDefaultStateInHistoryState, h); +- } else { +- for (int k = 0; k < hlst.size(); ++k) { +- QtAbstractState *s0 = hlst.at(k); +- addStatesToEnter(s0, lca, statesToEnter, statesForDefaultEntry); +- } +-#ifdef QSTATEMACHINE_DEBUG +- qDebug() << q << ": initial history targets for" << s << ":" << hlst; +-#endif +- } +- } +- } else { +- addStatesToEnter(s, lca, statesToEnter, statesForDefaultEntry); +- } ++ addStatesToEnter(s, lca, statesToEnter, statesForDefaultEntry); + if (isParallel(lca)) { + QList<QtAbstractState*> lcac = QtStatePrivate::get(lca)->childStates(); + foreach (QtAbstractState* child,lcac) { +@@ -566,45 +536,78 @@ + QSet<QtAbstractState*> &statesToEnter, + QSet<QtAbstractState*> &statesForDefaultEntry) + { +- statesToEnter.insert(s); +- if (isParallel(s)) { +- QtState *grp = qobject_cast<QtState*>(s); +- QList<QtAbstractState*> lst = QtStatePrivate::get(grp)->childStates(); +- for (int i = 0; i < lst.size(); ++i) { +- QtAbstractState *child = lst.at(i); +- addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry); +- } +- } else if (isCompound(s)) { +- statesForDefaultEntry.insert(s); +- QtState *grp = qobject_cast<QtState*>(s); +- QtAbstractState *initial = grp->initialState(); +- if (initial != 0) { +- addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry); ++#ifdef QSTATEMACHINE_DEBUG ++ Q_Q(QtStateMachine); ++#endif ++ if (QtHistoryState *h = qobject_cast<QtHistoryState*>(s)) { ++ QList<QtAbstractState*> hconf = QtHistoryStatePrivate::get(h)->configuration; ++ if (!hconf.isEmpty()) { ++ for (int k = 0; k < hconf.size(); ++k) { ++ QtAbstractState *s0 = hconf.at(k); ++ addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry); ++ } ++#ifdef QSTATEMACHINE_DEBUG ++ qDebug() << q << ": restoring" ++ << ((QtHistoryStatePrivate::get(h)->historyType == QtState::DeepHistory) ? "deep" : "shallow") ++ << "history from" << s << ":" << hconf; ++#endif + } else { +- setError(QtStateMachine::NoInitialStateError, grp); +- return; ++ QList<QtAbstractState*> hlst; ++ if (QtHistoryStatePrivate::get(h)->defaultState) ++ hlst.append(QtHistoryStatePrivate::get(h)->defaultState); ++ if (hlst.isEmpty()) { ++ setError(QtStateMachine::NoDefaultStateInHistoryState, h); ++ } else { ++ for (int k = 0; k < hlst.size(); ++k) { ++ QtAbstractState *s0 = hlst.at(k); ++ addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry); ++ } ++#ifdef QSTATEMACHINE_DEBUG ++ qDebug() << q << ": initial history targets for" << s << ":" << hlst; ++#endif ++ } + } +- } +- QList<QtState*> ancs = properAncestors(s, root); +- for (int i = 0; i < ancs.size(); ++i) { +- QtState *anc = ancs.at(i); +- if (!anc->parentState()) +- continue; +- statesToEnter.insert(anc); +- if (isParallel(anc)) { +- QList<QtAbstractState*> lst = QtStatePrivate::get(anc)->childStates(); +- for (int j = 0; j < lst.size(); ++j) { +- QtAbstractState *child = lst.at(j); +- bool hasDescendantInList = false; +- QSet<QtAbstractState*>::const_iterator it; +- for (it = statesToEnter.constBegin(); it != statesToEnter.constEnd(); ++it) { +- if (isDescendantOf(*it, child)) { +- hasDescendantInList = true; +- break; ++ } else { ++ statesToEnter.insert(s); ++ if (isParallel(s)) { ++ QtState *grp = qobject_cast<QtState*>(s); ++ QList<QtAbstractState*> lst = QtStatePrivate::get(grp)->childStates(); ++ for (int i = 0; i < lst.size(); ++i) { ++ QtAbstractState *child = lst.at(i); ++ addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry); ++ } ++ } else if (isCompound(s)) { ++ statesForDefaultEntry.insert(s); ++ QtState *grp = qobject_cast<QtState*>(s); ++ QtAbstractState *initial = grp->initialState(); ++ if (initial != 0) { ++ addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry); ++ } else { ++ setError(QtStateMachine::NoInitialStateError, grp); ++ return; ++ } ++ } ++ QList<QtState*> ancs = properAncestors(s, root); ++ for (int i = 0; i < ancs.size(); ++i) { ++ QtState *anc = ancs.at(i); ++ if (!anc->parentState()) ++ continue; ++ statesToEnter.insert(anc); ++ if (isParallel(anc)) { ++ QList<QtAbstractState*> lst = QtStatePrivate::get(anc)->childStates(); ++ for (int j = 0; j < lst.size(); ++j) { ++ QtAbstractState *child = lst.at(j); ++ bool hasDescendantInList = false; ++ QSet<QtAbstractState*>::const_iterator it; ++ for (it = statesToEnter.constBegin(); it != statesToEnter.constEnd(); ++it) { ++ if (isDescendantOf(*it, child)) { ++ hasDescendantInList = true; ++ break; ++ } + } ++ if (!hasDescendantInList) ++ addStatesToEnter(child, anc, statesToEnter, statesForDefaultEntry); + } +- if (!hasDescendantInList) +- addStatesToEnter(child, anc, statesToEnter, statesForDefaultEntry); + } + } + } diff --git a/dev-python/qtstatemachine/qtstatemachine-1.1-r1.ebuild b/dev-python/qtstatemachine/qtstatemachine-1.1-r1.ebuild new file mode 100644 index 00000000..a1aaa525 --- /dev/null +++ b/dev-python/qtstatemachine/qtstatemachine-1.1-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 2004-2009 Sabayon Linux +# Distributed under the terms of the GNU General Public License v2 +# $ + +EAPI="2" +inherit eutils cmake-utils + +DESCRIPTION="Qt State Machine Framework" +SLOT="4" +KEYWORDS="~amd64 ~x86" +IUSE="" +SRC_URI="ftp://ftp.trolltech.com/qt/solutions/lgpl/qtstatemachine-1.1-opensource.tar.gz" +RESTRICT="mirror" +LICENSE="|| ( LGPL-2.1 GPL-3 QPL-1.0 )" + +RDEPEND="dev-libs/glib + media-libs/libpng + x11-libs/qt-core:4 + x11-libs/qt-gui:4" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${P}-opensource" + +src_prepare() { + # Add some bugfix patches + epatch "${FILESDIR}/"qstatemachines*.patch_* +} + +pkg_postinst() { + + ewarn "This package is VERY EXPERIMENTAL." + ewarn "Its build system is utterly broken (see CMake patch)." + ewarn "No examples are installed because of the issue above" + ewarn "...and your cat will be eaten by a black hole!" + einfo "Say thanks to Vincenzo Di Massa for the hard" + einfo "patching work." + +} diff --git a/dev-python/qtstatemachine/qtstatemachine-1.1.ebuild b/dev-python/qtstatemachine/qtstatemachine-1.1.ebuild new file mode 100644 index 00000000..7d222db9 --- /dev/null +++ b/dev-python/qtstatemachine/qtstatemachine-1.1.ebuild @@ -0,0 +1,49 @@ +# Copyright 2004-2009 Sabayon Linux +# Distributed under the terms of the GNU General Public License v2 +# $ + +EAPI="2" +inherit eutils base multilib + +DESCRIPTION="Qt State Machine Framework" +SLOT="4" +KEYWORDS="~amd64 ~x86" +IUSE="" +SRC_URI="ftp://ftp.trolltech.com/qt/solutions/lgpl/qtstatemachine-1.1-opensource.tar.gz" +RESTRICT="mirror" +LICENSE="|| ( LGPL-2.1 GPL-3 QPL-1.0 )" + +RDEPEND="dev-libs/glib + media-libs/libpng + x11-libs/qt-core:4 + x11-libs/qt-gui:4" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${P}-opensource" + +src_configure() { + + # build system is utterly broken + echo "yes" | ./configure -library || die "configure failed" + +} + +src_compile() { + qmake -makefile -nocache || die "qmake failed" + emake || "make failed" +} + +src_install() { + + # build system is broken + dolib.so lib/* + +} + +pkg_postinst() { + ewarn "This package is VERY EXPERIMENTAL." + ewarn "Its build system is utterly broken." + ewarn "No examples are installed because of the issue above" + ewarn "...and your cat will be eaten by a black hole!" + ewarn "plop!" +} |