diff --git a/kdevelop-pg-qt-2.2.1.tar.xz b/kdevelop-pg-qt-2.2.1.tar.xz new file mode 100644 index 0000000..5131763 Binary files /dev/null and b/kdevelop-pg-qt-2.2.1.tar.xz differ diff --git a/kdevelop-pg-qt.spec b/kdevelop-pg-qt.spec new file mode 100644 index 0000000..ff0d9a3 --- /dev/null +++ b/kdevelop-pg-qt.spec @@ -0,0 +1,69 @@ +%undefine __cmake_in_source_build + +%define src_ver 2.2.1 + +Name: kdevelop-pg-qt +Summary: A parser generator +Version: 2.2.1 +Release: 1 +# All LGPLv2+, except for bison-generated kdev-pg-parser.{cc.h} which are GPLv2+ +License: LGPLv2+ and GPLv2+ with exception +URL: http://techbase.kde.org/Development/KDevelop-PG-Qt_Introduction +Source0: http://download.kde.org/stable/kdevelop-pg-qt/%{version}/src/kdevelop-pg-qt-%{src_ver}.tar.xz +# upstream fix https://invent.kde.org/kdevelop/kdevelop-pg-qt/-/commit/0f830b2abc7763f6598f7f1a84f5af403d402a02 +Patch0: upstream_Fix-linking-on-s390x.patch + +BuildRequires: bison +BuildRequires: flex +BuildRequires: kf5-rpm-macros +BuildRequires: extra-cmake-modules +BuildRequires: qt5-qtbase-devel + +# For AutoReq cmake-filesystem +BuildRequires: cmake + +%description +KDevelop-PG-Qt is a parser generator written in readable source-code and +generating readable source-code. Its syntax was inspired by AntLR. It +implements the visitor-pattern and uses the Qt library. That is why it +is ideal to be used in Qt-/KDE-based applications like KDevelop. + +%package devel +Summary: Developer files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +# went noarch->arch, so be careful on upgrades -- rex +Obsoletes: kdevelop-pg-qt-devel < 1.0.0-1 + +%description devel +%{summary}. + + +%prep +%autosetup -p1 -n %{name}-%{src_ver} + + +%build +mkdir build +pushd build + %cmake_kf5 .. + %make_build +popd + +%install +pushd build + %make_install +popd + +%files +%doc AUTHORS README +%license COPYING.LIB +%{_bindir}/kdev-pg-qt + +%files devel +%{_includedir}/kdevelop-pg-qt/ +%{_libdir}/cmake/KDevelop-PG-Qt/ + + +%changelog +* Mon Sep 05 2022 liweiganga - 2.2.1-1 +- init for openEuler \ No newline at end of file diff --git a/kdevelop-pg-qt.yaml b/kdevelop-pg-qt.yaml new file mode 100644 index 0000000..9904a07 --- /dev/null +++ b/kdevelop-pg-qt.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: https://github.com/KDE/kdevelop-pg-qt +tag_prefix: "^v" +seperator: "." \ No newline at end of file diff --git a/upstream_Fix-linking-on-s390x.patch b/upstream_Fix-linking-on-s390x.patch new file mode 100644 index 0000000..731761e --- /dev/null +++ b/upstream_Fix-linking-on-s390x.patch @@ -0,0 +1,111 @@ +From 0f830b2abc7763f6598f7f1a84f5af403d402a02 Mon Sep 17 00:00:00 2001 +From: Milian Wolff +Date: Mon, 2 Mar 2020 22:56:55 +0100 +Subject: Fix linking on s390x + +Ensure all symbols are available and don't hide the template +instantiation. + +BUG: 417679 +--- + kdev-pg/kdev-pg-code-gen.cpp | 47 ++++++++++++++++++++++---------------------- + kdev-pg/kdev-pg-code-gen.h | 14 ++++++++++++- + 2 files changed, 36 insertions(+), 25 deletions(-) + +diff --git a/kdev-pg/kdev-pg-code-gen.cpp b/kdev-pg/kdev-pg-code-gen.cpp +index 4db60e0..7a5d8aa 100644 +--- a/kdev-pg/kdev-pg-code-gen.cpp ++++ b/kdev-pg/kdev-pg-code-gen.cpp +@@ -1014,35 +1014,34 @@ void GenerateParseMethodSignature::visitVariableDeclaration(Model::VariableDecla + DefaultVisitor::visitVariableDeclaration(node); + } + +-template +-void GenerateVariableDeclaration::operator()(Model::VariableDeclarationItem *node) ++namespace GenerateVariableDeclarationImpl + { +- if(printType) +- { +- if (node->mIsSequence) +- out << "const KDevPG::ListNode<"; ++void printType(QTextStream &out, Model::VariableDeclarationItem *node) ++{ ++ if (node->mIsSequence) ++ out << "const KDevPG::ListNode<"; + +- if (node->mVariableType == Model::VariableDeclarationItem::TypeToken) +- out << "qint64 "; +- else if (node->mVariableType == Model::VariableDeclarationItem::TypeNode) +- { +- out << node->mCapitalizedType << "Ast *"; +- }else if (node->mVariableType == Model::VariableDeclarationItem::TypeVariable) +- out << node->mType << " "; +- else +- Q_ASSERT(0); // ### not supported ++ if (node->mVariableType == Model::VariableDeclarationItem::TypeToken) ++ out << "qint64 "; ++ else if (node->mVariableType == Model::VariableDeclarationItem::TypeNode) ++ { ++ out << node->mCapitalizedType << "Ast *"; ++ }else if (node->mVariableType == Model::VariableDeclarationItem::TypeVariable) ++ out << node->mType << " "; ++ else ++ Q_ASSERT(0); // ### not supported + +- if (node->mIsSequence) +- out << "> *"; +- } ++ if (node->mIsSequence) ++ out << "> *"; ++} + +- if(printName) +- { +- out << node->mName; ++void printName(QTextStream &out, Model::VariableDeclarationItem *node) ++{ ++ out << node->mName; + +- if (node->mIsSequence) +- out << "Sequence"; +- } ++ if (node->mIsSequence) ++ out << "Sequence"; ++} + } + + void GenerateMemberCode::operator()(Settings::MemberItem* m) +diff --git a/kdev-pg/kdev-pg-code-gen.h b/kdev-pg/kdev-pg-code-gen.h +index f639ab6..9c9160e 100644 +--- a/kdev-pg/kdev-pg-code-gen.h ++++ b/kdev-pg/kdev-pg-code-gen.h +@@ -136,6 +136,12 @@ public: + void operator()(Model::SymbolItem *node); + }; + ++namespace GenerateVariableDeclarationImpl ++{ ++ void printType(QTextStream &out, Model::VariableDeclarationItem *node); ++ void printName(QTextStream &out, Model::VariableDeclarationItem *node); ++}; ++ + template + class GenerateVariableDeclaration + { +@@ -146,7 +152,13 @@ public: + GenerateVariableDeclaration(QTextStream& o): out(o) + {} + +- void operator()(Model::VariableDeclarationItem *node); ++ void operator()(Model::VariableDeclarationItem *node) ++ { ++ if (printType) ++ GenerateVariableDeclarationImpl::printType(out, node); ++ if (printName) ++ GenerateVariableDeclarationImpl::printName(out, node); ++ } + }; + + class GenerateTokenVariableInitialization : public DefaultVisitor +-- +cgit v1.1 \ No newline at end of file