Accepting request 1135229 from home:mathletic:branches:devel:tools

- Update to doxygen 1.10.0
  Full changelog see https://www.doxygen.nl/manual/changelog.html
- Drop patches that are part of upstream since 1.9.7
  Fix-boundingbox-parsing_part1.patch,
  Fix-boundingbox-parsing_part2.patch,
  Fix-boundingbox-parsing_part3.patch,
  and Fix-boundingbox-parsing_part4.patch.
- Drop patch reproducible.patch, it does no longer apply and
  messing around with the internals of a C++ filesystem library
  does not seem to be the right approach.

OBS-URL: https://build.opensuse.org/request/show/1135229
OBS-URL: https://build.opensuse.org/package/show/devel:tools/doxygen?expand=0&rev=201
This commit is contained in:
Martin Pluskal 2023-12-27 09:29:43 +00:00 committed by Git OBS Bridge
parent 5228d02d93
commit d3e2c14830
10 changed files with 27 additions and 2288 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,216 +0,0 @@
From 7b2a6027775b0158304635a98de0f9b5672f163a Mon Sep 17 00:00:00 2001
From: Dimitri van Heesch <doxygen@gmail.com>
Date: Wed, 4 Jan 2023 10:55:36 +0100
Subject: [PATCH] issue #9319: Doc build fails with cairo 1.17.6
---
TinyDeflate/gunzip.hh | 26 ++++++-----
src/CMakeLists.txt | 1 +
src/dotrunner.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++
src/doxygen.cpp | 2 -
4 files changed, 120 insertions(+), 13 deletions(-)
diff --git a/TinyDeflate/gunzip.hh b/TinyDeflate/gunzip.hh
index c0039d5f832..c237298fdb0 100644
--- a/TinyDeflate/gunzip.hh
+++ b/TinyDeflate/gunzip.hh
@@ -944,23 +944,27 @@ namespace gunzip_ns
// The following routines are macros rather than e.g. lambda functions,
// in order to make them inlined in the function structure, and breakable/resumable.
+ #define CONCAT(a, b) a##b
// Bit-by-bit input routine
- #define DummyGetBits(numbits) do { \
- auto p = state.template GetBits<bool(Abortable&Flag_InputAbortable)>(std::forward<InputFunctor>(input), numbits); \
- if((Abortable & Flag_InputAbortable) && !~p) return -2; \
+ #define DummyGetBits_(line,numbits) do { \
+ auto CONCAT(pd,line) = state.template GetBits<bool(Abortable&Flag_InputAbortable)>(std::forward<InputFunctor>(input), numbits); \
+ if((Abortable & Flag_InputAbortable) && !~CONCAT(pd,line)) return -2; \
} while(0)
+ #define DummyGetBits(numbits) DummyGetBits_(__LINE__, numbits)
- #define GetBits(numbits, target) \
- auto p = state.template GetBits<bool(Abortable&Flag_InputAbortable)>(std::forward<InputFunctor>(input), numbits); \
- if((Abortable & Flag_InputAbortable) && !~p) return -2; \
- target = p
+ #define GetBits_(line,numbits, target) \
+ auto CONCAT(pb,line) = state.template GetBits<bool(Abortable&Flag_InputAbortable)>(std::forward<InputFunctor>(input), numbits); \
+ if((Abortable & Flag_InputAbortable) && !~CONCAT(pb,line)) return -2; \
+ target = CONCAT(pb,line)
+ #define GetBits(numbits, target) GetBits_(__LINE__, numbits, target)
// Huffman tree read routine.
- #define HuffRead(tree, target) \
- auto p = state.template HuffRead<bool(Abortable&Flag_InputAbortable)>(std::forward<InputFunctor>(input), tree); \
- if((Abortable & Flag_InputAbortable) && !~p) return -2; \
- target = p
+ #define HuffRead_(line, tree, target) \
+ auto CONCAT(ph,line) = state.template HuffRead<bool(Abortable&Flag_InputAbortable)>(std::forward<InputFunctor>(input), tree); \
+ if((Abortable & Flag_InputAbortable) && !~CONCAT(ph,line)) return -2; \
+ target = CONCAT(ph,line)
+ #define HuffRead(tree, target) HuffRead_(__LINE__, tree, target)
#define Fail_If(condition) do { \
/*assert(!(condition));*/ \
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e9df895ce3a..0e33638c42d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,7 @@
# vim:ts=4:sw=4:expandtab:autoindent:
include_directories(
+ ${PROJECT_SOURCE_DIR}/TinyDeflate
${PROJECT_SOURCE_DIR}/filesystem
${PROJECT_SOURCE_DIR}/libmd5
${PROJECT_SOURCE_DIR}/liblodepng
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp
index d3b2615f4ed..5be9f20de9c 100644
--- a/src/dotrunner.cpp
+++ b/src/dotrunner.cpp
@@ -16,6 +16,8 @@
#include <cassert>
#include <cmath>
+#include <gunzip.hh>
+
#include "dotrunner.h"
#include "util.h"
#include "portable.h"
@@ -31,6 +33,9 @@
#define MAX_LATEX_GRAPH_INCH 150
#define MAX_LATEX_GRAPH_SIZE (MAX_LATEX_GRAPH_INCH * 72)
+//#define DBG(x) printf x
+#define DBG(x) do {} while(0)
+
//-----------------------------------------------------------------------------------------
// since dot silently reproduces the input file when it does not
@@ -108,6 +113,7 @@ static bool resetPDFSize(const int width,const int height, const QCString &base)
bool DotRunner::readBoundingBox(const QCString &fileName,int *width,int *height,bool isEps)
{
+#if 0
const char *bb = isEps ? "%%PageBoundingBox:" : "/MediaBox [";
size_t bblen = strlen(bb);
FILE *f = Portable::fopen(fileName,"rb");
@@ -139,6 +145,104 @@ bool DotRunner::readBoundingBox(const QCString &fileName,int *width,int *height,
err("Failed to extract bounding box from generated diagram file %s\n",qPrint(fileName));
fclose(f);
return FALSE;
+#endif
+ std::ifstream f = Portable::openInputStream(fileName);
+ if (!f.is_open())
+ {
+ err("Failed to open file %s for extracting bounding box\n",qPrint(fileName));
+ return false;
+ }
+
+ // read file contents into string 'contents'
+ std::stringstream buffer;
+ buffer << f.rdbuf();
+ std::string contents = buffer.str();
+
+ // start of bounding box marker we are looking for
+ const std::string boundingBox = isEps ? "%%PageBoundingBox:" : "/MediaBox [";
+
+ // helper routine to extract the bounding boxes width and height
+ auto extractBoundingBox = [&fileName,&boundingBox,&width,&height](const char *s) -> bool
+ {
+ int x,y;
+ double w,h;
+ if (sscanf(s+boundingBox.length(),"%d %d %lf %lf",&x,&y,&w,&h)==4)
+ {
+ *width = static_cast<int>(std::ceil(w));
+ *height = static_cast<int>(std::ceil(h));
+ return true;
+ }
+ err("Failed to extract bounding box from generated diagram file %s\n",qPrint(fileName));
+ return false;
+ };
+
+ // compressed segment start and end markers
+ const std::string streamStart = "stream\n";
+ const std::string streamEnd = "\nendstream";
+
+ const size_t l = contents.length();
+ size_t i=0;
+ while (i<l)
+ {
+ if (!isEps && contents[i]=='s' && strncmp(&contents[i],streamStart.c_str(),streamStart.length())==0)
+ { // compressed stream start
+ int col=17;
+ i+=streamStart.length();
+ const size_t start=i;
+ DBG(("---- start stream at offset %08x\n",(int)i));
+ while (i<l)
+ {
+ if (contents[i]=='\n' && strncmp(&contents[i],streamEnd.c_str(),streamEnd.length())==0)
+ { // compressed block found in range [start..i]
+ DBG(("\n---- end stream at offset %08x\n",(int)i));
+ // decompress it into decompressBuf
+ std::vector<char> decompressBuf;
+ const char *source = &contents[start];
+ const size_t sourceLen = i-start;
+ size_t sourcePos = 0;
+ decompressBuf.reserve(sourceLen*2);
+ auto getter = [source,&sourcePos,sourceLen]() -> int {
+ return sourcePos<sourceLen ? static_cast<unsigned char>(source[sourcePos++]) : EOF;
+ };
+ auto putter = [&decompressBuf](const char c) -> int {
+ decompressBuf.push_back(c); return c;
+ };
+ Deflate(getter,putter);
+ // convert decompression buffer to string
+ std::string s(decompressBuf.begin(), decompressBuf.end());
+ DBG(("decompressed_data=[[[\n%s\n]]]\n",s.c_str()));
+ // search for bounding box marker
+ const size_t idx = s.find(boundingBox);
+ if (idx!=std::string::npos) // found bounding box in uncompressed data
+ {
+ return extractBoundingBox(s.c_str()+idx);
+ }
+ // continue searching after end stream marker
+ i+=streamEnd.length();
+ break;
+ }
+ else // compressed stream character
+ {
+ if (col>16) { col=0; DBG(("\n%08x: ",static_cast<int>(i))); }
+ DBG(("%02x ",static_cast<unsigned char>(contents[i])));
+ col++;
+ i++;
+ }
+ }
+ }
+ else if (((isEps && contents[i]=='%') || (!isEps && contents[i]=='/')) &&
+ strncmp(&contents[i],boundingBox.c_str(),boundingBox.length())==0)
+ { // uncompressed bounding box
+ return extractBoundingBox(&contents[i]);
+ }
+ else // uncompressed stream character
+ {
+ i++;
+ }
+ }
+ err("Failed to find bounding box in generated diagram file %s\n",qPrint(fileName));
+ // nothing found
+ return false;
}
//---------------------------------------------------------------------------------
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 78b72ebfecc..55068e74dcb 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -11930,8 +11930,6 @@ void parseInput()
{
Portable::setenv("DOTFONTPATH",qPrint(curFontPath));
}
- // issue 9319
- Portable::setenv("CAIRO_DEBUG_PDF","1");
}

View File

@ -1,93 +0,0 @@
From f3514d578633cad3e39d6787f81085e46bafbaf4 Mon Sep 17 00:00:00 2001
From: Dimitri van Heesch <doxygen@gmail.com>
Date: Wed, 4 Jan 2023 22:49:00 +0100
Subject: [PATCH] Fix and work around compiler warnings and remove dead code
---
TinyDeflate/gunzip.hh | 4 ++--
src/dotrunner.cpp | 42 +++++++++---------------------------------
2 files changed, 11 insertions(+), 35 deletions(-)
diff --git a/TinyDeflate/gunzip.hh b/TinyDeflate/gunzip.hh
index c237298fdb0..a631815a255 100644
--- a/TinyDeflate/gunzip.hh
+++ b/TinyDeflate/gunzip.hh
@@ -430,7 +430,7 @@ namespace gunzip_ns
static_assert((T)false, "result_of<CallableType> is invalid; use "
"result_of<CallableType(zero or more argument types)> instead.");
};
- #if __cplusplus > 202000UL
+ #if __cplusplus > 201703UL
template <typename F, typename... Args>
struct result_of<F(Args...)> : std::invoke_result<F, Args...> {};
#else
@@ -702,7 +702,7 @@ namespace gunzip_ns
// Note: Throws away progress already made traversing the tree
return ~std::uint_least32_t(0); // error flag
}
- cur = (unsigned(cur) << 1) | bool(p);
+ cur = (unsigned(cur) << 1) | unsigned(bool(p));
#ifdef DEFL_DO_HUFF_STATS
if(len > maxlen)
{
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp
index 5be9f20de9c..9246029cb61 100644
--- a/src/dotrunner.cpp
+++ b/src/dotrunner.cpp
@@ -16,7 +16,16 @@
#include <cassert>
#include <cmath>
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 4242 )
+#pragma warning( disable : 4244 )
+#endif
#include <gunzip.hh>
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+
#include "dotrunner.h"
#include "util.h"
@@ -113,39 +122,6 @@ static bool resetPDFSize(const int width,const int height, const QCString &base)
bool DotRunner::readBoundingBox(const QCString &fileName,int *width,int *height,bool isEps)
{
-#if 0
- const char *bb = isEps ? "%%PageBoundingBox:" : "/MediaBox [";
- size_t bblen = strlen(bb);
- FILE *f = Portable::fopen(fileName,"rb");
- if (!f)
- {
- //printf("readBoundingBox: could not open %s\n",fileName);
- return FALSE;
- }
- const int maxLineLen=1024;
- char buf[maxLineLen];
- while (fgets(buf,maxLineLen,f)!=NULL)
- {
- const char *p = strstr(buf,bb);
- if (p) // found PageBoundingBox or /MediaBox string
- {
- int x,y;
- double w,h;
- fclose(f);
- if (sscanf(p+bblen,"%d %d %lf %lf",&x,&y,&w,&h)!=4)
- {
- //printf("readBoundingBox sscanf fail\n");
- return FALSE;
- }
- *width = static_cast<int>(std::ceil(w));
- *height = static_cast<int>(std::ceil(h));
- return TRUE;
- }
- }
- err("Failed to extract bounding box from generated diagram file %s\n",qPrint(fileName));
- fclose(f);
- return FALSE;
-#endif
std::ifstream f = Portable::openInputStream(fileName);
if (!f.is_open())
{

View File

@ -1,66 +0,0 @@
From 8129939c312e4b5060042fdb93bd071b7b133381 Mon Sep 17 00:00:00 2001
From: Dimitri van Heesch <doxygen@gmail.com>
Date: Thu, 5 Jan 2023 11:16:24 +0100
Subject: [PATCH] issue #9319: Doc build fails with cairo 1.17.6
- Improve detection of "flate" encoded streams
---
TinyDeflate/gunzip.hh | 2 +-
src/dotrunner.cpp | 20 +++++++++++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/TinyDeflate/gunzip.hh b/TinyDeflate/gunzip.hh
index a631815a255..652058ab823 100644
--- a/TinyDeflate/gunzip.hh
+++ b/TinyDeflate/gunzip.hh
@@ -430,7 +430,7 @@ namespace gunzip_ns
static_assert((T)false, "result_of<CallableType> is invalid; use "
"result_of<CallableType(zero or more argument types)> instead.");
};
- #if __cplusplus > 201703UL
+ #if __cplusplus > 202000UL
template <typename F, typename... Args>
struct result_of<F(Args...)> : std::invoke_result<F, Args...> {};
#else
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp
index 9246029cb61..2e87a0d4a37 100644
--- a/src/dotrunner.cpp
+++ b/src/dotrunner.cpp
@@ -20,6 +20,7 @@
#pragma warning( push )
#pragma warning( disable : 4242 )
#pragma warning( disable : 4244 )
+#pragma warning( disable : 4996 )
#endif
#include <gunzip.hh>
#ifdef _MSC_VER
@@ -156,11 +157,28 @@ bool DotRunner::readBoundingBox(const QCString &fileName,int *width,int *height,
const std::string streamStart = "stream\n";
const std::string streamEnd = "\nendstream";
+ auto detectDeflateStreamStart = [&streamStart](const char *s)
+ {
+ size_t len = streamStart.length();
+ bool streamOK = strncmp(s,streamStart.c_str(),len)==0;
+ if (streamOK) // ASCII marker matches, check stream header bytes as well
+ {
+ unsigned short header1 = static_cast<unsigned char>(s[len])<<8; // CMF byte
+ if (header1) // not end of string
+ {
+ unsigned short header = (static_cast<unsigned char>(s[len+1])) | header1; // FLG byte
+ // check for correct header (see https://www.rfc-editor.org/rfc/rfc1950)
+ return ((header&0x8F20)==0x0800) && (header%31)==0;
+ }
+ }
+ return false;
+ };
+
const size_t l = contents.length();
size_t i=0;
while (i<l)
{
- if (!isEps && contents[i]=='s' && strncmp(&contents[i],streamStart.c_str(),streamStart.length())==0)
+ if (!isEps && contents[i]=='s' && detectDeflateStreamStart(&contents[i]))
{ // compressed stream start
int col=17;
i+=streamStart.length();

BIN
doxygen-1.10.0.src.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:297f8ba484265ed3ebd3ff3fe7734eb349a77e4f95c8be52ed9977f51dea49df
size 5293513

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon Dec 25 20:11:52 UTC 2023 - Christoph G <foss@grueninger.de>
- Update to doxygen 1.10.0
Full changelog see https://www.doxygen.nl/manual/changelog.html
- Drop patches that are part of upstream since 1.9.7
Fix-boundingbox-parsing_part1.patch,
Fix-boundingbox-parsing_part2.patch,
Fix-boundingbox-parsing_part3.patch,
and Fix-boundingbox-parsing_part4.patch.
- Drop patch reproducible.patch, it does no longer apply and
messing around with the internals of a C++ filesystem library
does not seem to be the right approach.
-------------------------------------------------------------------
Mon Jul 17 17:14:00 UTC 2023 - Bernhard Wiedemann <bwiedemann@suse.com>

View File

@ -22,7 +22,7 @@
%endif
Name: doxygen
Version: 1.9.6
Version: 1.10.0
Release: 0
Summary: Automated C, C++, and Java Documentation Generator
# qtools are used for building and they are GPL-3.0 licensed
@ -34,14 +34,8 @@ Source0: https://www.doxygen.nl/files/doxygen-%{version}.src.tar.gz
Patch1: %{name}-no-lowercase-man-names.patch
# The unified libclang-cpp library doesn't exist on older Leap / SLE
Patch10: doxygen-no-libclang-cpp.patch
# Fix PDF boudingbox parsing when dot uses cairo >= 1.17.6 -- https://github.com/doxygen/doxygen/issues/9319
Patch20: https://github.com/doxygen/doxygen/commit/966d69c603b5.patch#/Fix-boundingbox-parsing_part1.patch
Patch21: https://github.com/doxygen/doxygen/commit/7b2a6027775b.patch#/Fix-boundingbox-parsing_part2.patch
Patch22: https://github.com/doxygen/doxygen/commit/f3514d578633.patch#/Fix-boundingbox-parsing_part3.patch
Patch23: https://github.com/doxygen/doxygen/commit/8129939c312e.patch#/Fix-boundingbox-parsing_part4.patch
Patch24: reproducible.patch
BuildRequires: bison
BuildRequires: cmake >= 2.8.12
BuildRequires: cmake >= 3.14
BuildRequires: flex
%if 0%{?suse_version} <= 1500
BuildRequires: gcc9-c++
@ -58,12 +52,12 @@ BuildRequires: llvm-clang-devel
%endif
%description
Doxygen is a documentation system for C, C++, Java, and IDL. It can
generate an online class browser (in HTML) and an offline reference
manual (in LaTeX) from a set of documented source files. The
documentation is extracted directly from the sources. Doxygen is
developed on a Linux platform, but it runs on most other UNIX flavors
as well.
Doxygen is the de facto standard tool for generating documentation
from annotated C++ sources, but it also supports other popular
programming languages such as C, Objective-C, C-sharp, PHP, Java,
Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran,
and to some extent D. Doxygen also supports the hardware description
language VHDL.
%prep
%setup -q
@ -74,11 +68,6 @@ as well.
%patch10 -p1
%endif
%endif
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%build
%cmake \

View File

@ -17,7 +17,7 @@
Name: doxywizard
Version: 1.9.6
Version: 1.10.0
Release: 0
Summary: Graphical User Interface for Doxygen
# qtools are used for building and they are GPL-3.0 licensed
@ -27,7 +27,7 @@ URL: https://www.doxygen.nl/
Source: https://www.doxygen.nl/files/doxygen-%{version}.src.tar.gz
Source1: doxywizard.desktop
BuildRequires: bison
BuildRequires: cmake >= 2.8.12
BuildRequires: cmake >= 3.14
BuildRequires: flex
%if 0%{?suse_version} <= 1500
BuildRequires: gcc9-c++

View File

@ -1,75 +0,0 @@
Index: doxygen-1.9.6/filesystem/filesystem.hpp
===================================================================
--- doxygen-1.9.6.orig/filesystem/filesystem.hpp
+++ doxygen-1.9.6/filesystem/filesystem.hpp
@@ -5548,12 +5548,13 @@ public:
impl(const path& path, directory_options options)
: _base(path)
, _options(options)
- , _dir(nullptr)
+ , _namelist(nullptr)
+ , _namelisti(-1)
, _entry(nullptr)
{
if (!path.empty()) {
- _dir = ::opendir(path.native().c_str());
- if (!_dir) {
+ _namelisti = _namelistn = ::scandir(path.native().c_str(), &_namelist, NULL, alphasort);
+ if (_namelistn == -1) {
auto error = errno;
_base = filesystem::path();
if ((error != EACCES && error != EPERM) || (options & directory_options::skip_permission_denied) == directory_options::none) {
@@ -5568,19 +5569,23 @@ public:
impl(const impl& other) = delete;
~impl()
{
- if (_dir) {
- ::closedir(_dir);
+ if (_namelist) {
+ for (int i=_namelistn-1; i>=0; i--) {
+ free(_namelist[i]);
+ }
+ free(_namelist);
+ _namelist = nullptr;
}
}
void increment(std::error_code& ec)
{
- if (_dir) {
+ if (_namelist) {
bool skip;
do {
skip = false;
errno = 0;
- _entry = ::readdir(_dir);
- if (_entry) {
+ if (_namelisti > 0 ) {
+ _entry = _namelist[--_namelisti];
_dir_entry._path = _base;
_dir_entry._path.append_name(_entry->d_name);
copyToDirEntry();
@@ -5590,8 +5595,11 @@ public:
}
}
else {
- ::closedir(_dir);
- _dir = nullptr;
+ for (int i=_namelistn-1; i>=0; i--) {
+ free(_namelist[i]);
+ }
+ free(_namelist);
+ _namelist = nullptr;
_dir_entry._path.clear();
if (errno) {
ec = detail::make_system_error();
@@ -5634,7 +5642,9 @@ public:
}
path _base;
directory_options _options;
- DIR* _dir;
+ int _namelisti;
+ int _namelistn;
+ struct dirent **_namelist;
struct ::dirent* _entry;
directory_entry _dir_entry;
std::error_code _ec;