From 6f6455a5338c0b43ad1c68ad057ced10f76df93b Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 29 Sep 2020 12:27:12 +0200 Subject: [PATCH] backport upstream patches --- ...gen-1.8.20-broken-ref-for-enum-entry.patch | 49 ++++++++ ...not-handle-simple-example-in-md-file.patch | 58 +++++++++ ...1.8.20-links-using-ref-stopp-working.patch | 117 ++++++++++++++++++ doxygen-1.8.20-python3.patch | 56 +++++++++ doxygen.spec | 9 +- 5 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 doxygen-1.8.20-broken-ref-for-enum-entry.patch create mode 100644 doxygen-1.8.20-does-not-handle-simple-example-in-md-file.patch create mode 100644 doxygen-1.8.20-links-using-ref-stopp-working.patch create mode 100644 doxygen-1.8.20-python3.patch diff --git a/doxygen-1.8.20-broken-ref-for-enum-entry.patch b/doxygen-1.8.20-broken-ref-for-enum-entry.patch new file mode 100644 index 0000000..62e8337 --- /dev/null +++ b/doxygen-1.8.20-broken-ref-for-enum-entry.patch @@ -0,0 +1,49 @@ +commit 63dc5b9b1b3e8fb875304a954e4df934b249034b +Author: Dimitri van Heesch +Date: Wed Aug 26 21:23:29 2020 +0200 + + issue #7977: Broken ref for enum entry (doxygen 1.8.18 -> 1.8.19) + +diff --git a/src/doxygen.cpp b/src/doxygen.cpp +index 757e7831..d5512925 100644 +--- a/src/doxygen.cpp ++++ b/src/doxygen.cpp +@@ -6946,7 +6946,14 @@ static void addEnumValuesToEnums(const Entry *root) + MemberName *mn = mnsd->find(name); // for all members with this name + if (mn) + { +- std::vector< std::unique_ptr > extraMembers; ++ struct EnumValueInfo ++ { ++ EnumValueInfo(const QCString &n,std::unique_ptr &md) : ++ name(n), member(std::move(md)) {} ++ QCString name; ++ std::unique_ptr member; ++ }; ++ std::vector< EnumValueInfo > extraMembers; + // for each enum in this list + for (const auto &md : *mn) + { +@@ -7006,8 +7013,7 @@ static void addEnumValuesToEnums(const Entry *root) + fmd->setAnchor(); + md->insertEnumField(fmd.get()); + fmd->setEnumScope(md.get(),TRUE); +- mn=mnsd->add(e->name); +- extraMembers.push_back(std::move(fmd)); ++ extraMembers.push_back(EnumValueInfo(e->name,fmd)); + } + } + else +@@ -7071,9 +7077,10 @@ static void addEnumValuesToEnums(const Entry *root) + } + } + // move the newly added members into mn +- for (auto &md : extraMembers) ++ for (auto &e : extraMembers) + { +- mn->push_back(std::move(md)); ++ MemberName *emn=mnsd->add(e.name); ++ emn->push_back(std::move(e.member)); + } + } + } diff --git a/doxygen-1.8.20-does-not-handle-simple-example-in-md-file.patch b/doxygen-1.8.20-does-not-handle-simple-example-in-md-file.patch new file mode 100644 index 0000000..971de82 --- /dev/null +++ b/doxygen-1.8.20-does-not-handle-simple-example-in-md-file.patch @@ -0,0 +1,58 @@ +commit 7c429806b072dd8bf777d93035ffda817976adc0 +Author: albert-github +Date: Wed Sep 2 11:32:42 2020 +0200 + + issue #7995 Doxygen doesn't handle very simple example in the .md file + + Besides "keep utf8 characters together..." as done for the C-type parser in code.l (commit d3d9dd8540ec159de080859c8f34a2581c4147f0) this also has to be done for the Fortran, SQL and VHDL code lexers. The code lexers for python and xml already didn't give errors as they already handled these cases for the example. + +diff --git a/src/fortrancode.l b/src/fortrancode.l +index 4951001c..5d036e8a 100644 +--- a/src/fortrancode.l ++++ b/src/fortrancode.l +@@ -1272,6 +1272,17 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") + } + <*>^{BS}"type"{BS}"=" { g_code->codify(yytext); } + ++<*>[\x80-\xFF]* { // keep utf8 characters together... ++ if (g_isFixedForm && yy_my_start > fixedCommentAfter) ++ { ++ startFontClass("comment"); ++ codifyLines(yytext); ++ } ++ else ++ { ++ g_code->codify(yytext); ++ } ++ } + <*>. { + if (g_isFixedForm && yy_my_start > fixedCommentAfter) + { +diff --git a/src/sqlcode.l b/src/sqlcode.l +index 58a2fce9..22a5e170 100644 +--- a/src/sqlcode.l ++++ b/src/sqlcode.l +@@ -190,6 +190,9 @@ commentclose "\*/" + codifyLines(yytext,yyscanner); + } + ++[\x80-\xFF]* { // keep utf8 characters together... ++ codifyLines(yytext,yyscanner); ++ } + . { + codifyLines(yytext,yyscanner); + } +diff --git a/src/vhdlcode.l b/src/vhdlcode.l +index 808e5a29..dcace05d 100644 +--- a/src/vhdlcode.l ++++ b/src/vhdlcode.l +@@ -1497,6 +1497,9 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI + BEGIN(Bases); + } + ++<*>[\x80-\xFF]* { // keep utf8 characters together... ++ g_code->codify(vhdlcodeYYtext); ++ } + <*>. { + g_code->codify(vhdlcodeYYtext); + } diff --git a/doxygen-1.8.20-links-using-ref-stopp-working.patch b/doxygen-1.8.20-links-using-ref-stopp-working.patch new file mode 100644 index 0000000..5ae04fc --- /dev/null +++ b/doxygen-1.8.20-links-using-ref-stopp-working.patch @@ -0,0 +1,117 @@ +commit dfc82af001c56254c6fde0affd009f80e19b1548 +Author: Dimitri van Heesch +Date: Mon Sep 21 12:20:57 2020 +0200 + + issue #8037: Links using @ref stopped working in doxygen 1.8.19 + +diff --git a/src/classdef.cpp b/src/classdef.cpp +index c3cd3ee2..5e2b2fa1 100644 +--- a/src/classdef.cpp ++++ b/src/classdef.cpp +@@ -1248,6 +1248,7 @@ void ClassDefImpl::distributeMemberGroupDocumentation() + + void ClassDefImpl::findSectionsInDocumentation() + { ++ docFindSections(briefDescription(),this,docFile()); + docFindSections(documentation(),this,docFile()); + if (m_impl->memberGroupSDict) + { +diff --git a/src/commentscan.l b/src/commentscan.l +index c151294d..ce495a1c 100644 +--- a/src/commentscan.l ++++ b/src/commentscan.l +@@ -666,6 +666,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" + optList = QCStringList::split(',',optStr); + } + auto it = docCmdMap.find(cmdName.data()); ++ //printf("lookup command '%s' found=%d\n",cmdName.data(),it!=docCmdMap.end()); + if (it!=docCmdMap.end()) // special action is required + { + int i=0; +diff --git a/src/docparser.cpp b/src/docparser.cpp +index 73131f67..b79f8c82 100644 +--- a/src/docparser.cpp ++++ b/src/docparser.cpp +@@ -2448,8 +2448,8 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : + } + m_isSubPage = pd && pd->hasParentPage(); + if (sec->type()!=SectionType::Page || m_isSubPage) m_anchor = sec->label(); +- //printf("m_text=%s,m_ref=%s,m_file=%s,m_refToAnchor=%d type=%d\n", +- // m_text.data(),m_ref.data(),m_file.data(),m_refToAnchor,sec->type); ++ //printf("m_text=%s,m_ref=%s,m_file=%s,type=%d\n", ++ // m_text.data(),m_ref.data(),m_file.data(),m_refType); + return; + } + else if (resolveLink(context,target,TRUE,&compound,anchor)) +diff --git a/src/filedef.cpp b/src/filedef.cpp +index f07201d4..b74fda9b 100644 +--- a/src/filedef.cpp ++++ b/src/filedef.cpp +@@ -311,6 +311,7 @@ void FileDefImpl::distributeMemberGroupDocumentation() + + void FileDefImpl::findSectionsInDocumentation() + { ++ docFindSections(briefDescription(),this,docFile()); + docFindSections(documentation(),this,docFile()); + if (m_memberGroupSDict) + { +diff --git a/src/groupdef.cpp b/src/groupdef.cpp +index 9b333567..7cd6cf26 100644 +--- a/src/groupdef.cpp ++++ b/src/groupdef.cpp +@@ -228,6 +228,7 @@ void GroupDefImpl::distributeMemberGroupDocumentation() + + void GroupDefImpl::findSectionsInDocumentation() + { ++ docFindSections(briefDescription(),this,docFile()); + docFindSections(documentation(),this,docFile()); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); + MemberGroup *mg; +diff --git a/src/markdown.cpp b/src/markdown.cpp +index 3089b8e7..2e6ab3ea 100644 +--- a/src/markdown.cpp ++++ b/src/markdown.cpp +@@ -2662,6 +2662,7 @@ QCString markdownFileNameToId(const QCString &fileName) + int i = baseFn.findRev('.'); + if (i!=-1) baseFn = baseFn.left(i); + QCString baseName = substitute(substitute(substitute(baseFn," ","_"),"/","_"),":","_"); ++ //printf("markdownFileNameToId(%s)=md_%s\n",qPrint(fileName),qPrint(baseName)); + return "md_"+baseName; + } + +diff --git a/src/memberdef.cpp b/src/memberdef.cpp +index 6d179c21..2f92ea01 100644 +--- a/src/memberdef.cpp ++++ b/src/memberdef.cpp +@@ -4838,6 +4838,7 @@ ClassDef *MemberDefImpl::accessorClass() const + + void MemberDefImpl::findSectionsInDocumentation() + { ++ docFindSections(briefDescription(),this,docFile()); + docFindSections(documentation(),this,docFile()); + } + +diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp +index 88eea5d2..65456ac0 100644 +--- a/src/namespacedef.cpp ++++ b/src/namespacedef.cpp +@@ -349,6 +349,7 @@ void NamespaceDefImpl::distributeMemberGroupDocumentation() + + void NamespaceDefImpl::findSectionsInDocumentation() + { ++ docFindSections(briefDescription(),this,docFile()); + docFindSections(documentation(),this,docFile()); + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; +diff --git a/src/pagedef.cpp b/src/pagedef.cpp +index 09152def..75e50ed1 100644 +--- a/src/pagedef.cpp ++++ b/src/pagedef.cpp +@@ -99,6 +99,7 @@ PageDefImpl::~PageDefImpl() + + void PageDefImpl::findSectionsInDocumentation() + { ++ docFindSections(briefDescription(),this,docFile()); + docFindSections(documentation(),this,docFile()); + } + diff --git a/doxygen-1.8.20-python3.patch b/doxygen-1.8.20-python3.patch new file mode 100644 index 0000000..4eede41 --- /dev/null +++ b/doxygen-1.8.20-python3.patch @@ -0,0 +1,56 @@ +commit 6383a72200df27b0515b6e3d09bfad8934eb5c76 +Author: albert-github +Date: Tue Sep 8 13:31:15 2020 +0200 + + Make testsqlite3.py python script running with python 3 + + The testsqlite3.py didn't run under python 3 (found by means of pylint). + Making it runnable under python 2 and python 3. + +diff --git a/testing/testsqlite3.py b/testing/testsqlite3.py +index b4227b44..1d94f701 100755 +--- a/testing/testsqlite3.py ++++ b/testing/testsqlite3.py +@@ -13,7 +13,7 @@ g_conn=None + val=[] + def print_unprocessed_attributes(node): + for key in node.attrib: +- print "WARNING: '%s' has unprocessed attr '%s'" % (node.tag,key) ++ print("WARNING: '%s' has unprocessed attr '%s'" % (node.tag,key)) + + def extract_attribute(node,attribute,pnl): + if not attribute in node.attrib: +@@ -69,7 +69,7 @@ def process_memberdef(node): + extract_element(node,chld,q) + + for chld in node.getchildren(): +- print "WARNING: '%s' has unprocessed child elem '%s'" % (node.tag,chld.tag) ++ print("WARNING: '%s' has unprocessed child elem '%s'" % (node.tag,chld.tag)) + + extract_attribute(node,"kind",q) + extract_attribute(node,"prot",q) +@@ -90,12 +90,12 @@ def process_memberdef(node): + r=[] + try: + r = g_conn.execute(query,val).fetchall() +- except sqlite3.OperationalError,e: +- print "SQL_ERROR:%s"%e ++ except(sqlite3.OperationalError,e): ++ print("SQL_ERROR:%s"%e) + + del val[:] + if not len(r) > 0: +- print "TEST_ERROR: Member not found in SQL DB" ++ print("TEST_ERROR: Member not found in SQL DB") + + + def load_xml(name): +@@ -104,7 +104,7 @@ def load_xml(name): + for event, elem in context: + if event == "end" and elem.tag == "memberdef": + process_memberdef(elem) +- print "\n== Unprocessed XML ==" ++ print("\n== Unprocessed XML ==") + # ET.dump(root) + + diff --git a/doxygen.spec b/doxygen.spec index ab97e09..da6900c 100644 --- a/doxygen.spec +++ b/doxygen.spec @@ -16,7 +16,7 @@ Summary: A documentation system for C/C++ Name: doxygen Epoch: 1 Version: 1.8.20 -Release: 4%{?dist} +Release: 5%{?dist} # No version is specified. License: GPL+ @@ -28,6 +28,10 @@ Source1: doxywizard.desktop Patch0: doxygen-1.8.20-enums-multiple-files.patch Patch1: doxygen-different-results-on-64-and-32-bit.patch Patch2: doxygen-1.8.20-glibc-assert.patch +Patch3: doxygen-1.8.20-broken-ref-for-enum-entry.patch +Patch4: doxygen-1.8.20-links-using-ref-stopp-working.patch +Patch5: doxygen-1.8.20-python3.patch +Patch6: doxygen-1.8.20-does-not-handle-simple-example-in-md-file.patch BuildRequires: %{_bindir}/python3 BuildRequires: ImageMagick @@ -305,6 +309,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} %endif %changelog +* Tue Sep 29 2020 Than Ngo - 1.8.20-5 +- backport upstream patches + * Thu Sep 17 2020 Than Ngo - 1.8.20-4 - Fix doxygen crash