From 952cdc192a155ba05c3870b4754aa53d1f8a4725 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Fri, 29 Sep 2023 06:04:00 +0000 Subject: [PATCH] djvu, bump version (move djvulibre to djvu according to Gentoo) (#9535) --- app-text/djvu/djvu-3.5.28.recipe | 138 +++++++ app-text/djvu/patches/djvu-3.5.28.patchset | 338 ++++++++++++++++++ media-libs/djvulibre/djvulibre-3.5.27.recipe | 90 ----- .../patches/djvulibre-3.5.27.patchset | 44 --- 4 files changed, 476 insertions(+), 134 deletions(-) create mode 100644 app-text/djvu/djvu-3.5.28.recipe create mode 100644 app-text/djvu/patches/djvu-3.5.28.patchset delete mode 100644 media-libs/djvulibre/djvulibre-3.5.27.recipe delete mode 100644 media-libs/djvulibre/patches/djvulibre-3.5.27.patchset diff --git a/app-text/djvu/djvu-3.5.28.recipe b/app-text/djvu/djvu-3.5.28.recipe new file mode 100644 index 000000000..78b37cb18 --- /dev/null +++ b/app-text/djvu/djvu-3.5.28.recipe @@ -0,0 +1,138 @@ +SUMMARY="Web-centric format for distributing documents and images" +DESCRIPTION="DjVu is a web-centric format and software platform for distributing documents \ +and images." +HOMEPAGE="http://djvulibre.sourceforge.net/" +COPYRIGHT="2002 Leon Bottou and Yann Le Cun. + 2001 AT&T + 1999-2001 LizardTech, Inc." +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="http://downloads.sourceforge.net/project/djvu/DjVuLibre/$portVersion/djvulibre-$portVersion.tar.gz" +CHECKSUM_SHA256="fcd009ea7654fde5a83600eb80757bd3a76998e47d13c66b54c8db849f8f2edc" +SOURCE_DIR="djvulibre-$portVersion" +PATCHES="djvu-$portVersion.patchset" + +ARCHITECTURES="all" +SECONDARY_ARCHITECTURES="x86" + +libVersion="21.7.0" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + +PROVIDES=" + djvu$secondaryArchSuffix = $portVersion + lib:libdjvulibre$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:libtiff$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +REPLACES=" + djvulibre$secondaryArchSuffix + " + +PROVIDES_devel=" + djvu${secondaryArchSuffix}_devel = $portVersion + devel:libdjvulibre$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + djvu$secondaryArchSuffix == $portVersion base + " + +if [ -z "$secondaryArchSuffix" ]; then + SUMMARY_tools="Tools package for DjVu" + PROVIDES_tools=" + djvu${secondaryArchSuffix}_tools = $portVersion compat >= 3.5 + cmd:any2djvu #no_debug + cmd:bzz + cmd:c44 + cmd:cjb2 + cmd:cpaldjvu + cmd:csepdjvu + cmd:ddjvu + cmd:djvm + cmd:djvmcvt + cmd:djvudigital #no_debug + cmd:djvudump + cmd:djvuextract + cmd:djvumake + cmd:djvups + cmd:djvused + cmd:djvuserve + cmd:djvutoxml + cmd:djvutxt + cmd:djvuxmlparser + " + REQUIRES_tools=" + $REQUIRES + djvu$secondaryArchSuffix == $portVersion base + " +fi + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libjpeg$secondaryArchSuffix + devel:libtiff$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoconf + cmd:gcc$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + cmd:make + " + +debugList=( + $libDir/libdjvulibre.so.$libVersion + ) +if [ -z "$secondaryArchSuffix" ]; then + for i in `echo "$PROVIDES_tools" | grep -v no_debug | sed -n -e "s/^\s*cmd://p"`; do + debugList+=("${binDir/$portName/${portName}_tools}"/$i) + done +fi +defineDebugInfoPackage $portName "${debugList[@]}" + +BUILD() +{ + export CPPFLAGS="-Wno-deprecated-declarations" + autoreconf -vfi + runConfigure ./configure + make $jobArgs + cd doc + make-djvulibre-book-en.sh +} + +INSTALL() +{ + echo "$PROVIDES_tools" | sed -n -e "s/^\s*cmd://p" + make install + + # not needed + rm -rf $dataDir/icons + + # add documentation (in djvu format) + mkdir -p $developDocDir + cp doc/djvulibre-book-en.djvu $developDocDir + + prepareInstalledDevelLib libdjvulibre + fixPkgconfig + + packageEntries devel \ + $developDir + + if [ -z "$secondaryArchSuffix" ]; then + packageEntries tools \ + $binDir \ + $dataDir \ + $manDir + fi + + # Remove stuff we don't need in the secondary architecture base package. + if [ -n "$secondaryArchSuffix" ]; then + rm -rf $binDir \ + rm -rf $dataDir \ + rm -rf $manDir + fi +} diff --git a/app-text/djvu/patches/djvu-3.5.28.patchset b/app-text/djvu/patches/djvu-3.5.28.patchset new file mode 100644 index 000000000..1a63f9f94 --- /dev/null +++ b/app-text/djvu/patches/djvu-3.5.28.patchset @@ -0,0 +1,338 @@ +From d8b8661e465ee6b44776c34442d03659d4478f56 Mon Sep 17 00:00:00 2001 +From: Sergei Reznikov +Date: Wed, 25 Mar 2015 10:35:25 +0300 +Subject: Fix build + + +diff --git a/libdjvu/miniexp.cpp b/libdjvu/miniexp.cpp +index 1077cab..b066e3e 100644 +--- a/libdjvu/miniexp.cpp ++++ b/libdjvu/miniexp.cpp +@@ -1300,7 +1300,7 @@ static int stdio_fputs(miniexp_io_t *io, const char *s) { + + static int true_stdio_fgetc(miniexp_io_t *io) { + FILE *f = (io->data[0]) ? (FILE*)(io->data[0]) : stdin; +- return ::getc(f); ++ return getc(f); + } + static int compat_getc() { + return true_stdio_fgetc(&miniexp_io); +-- +2.37.3 + + +From a6882b34e0e38f4e91abfbaa2b4391287320172c Mon Sep 17 00:00:00 2001 +From: Sergei Reznikov +Date: Wed, 25 Mar 2015 10:45:06 +0300 +Subject: Haiku: gcc2 fix + + +diff --git a/libdjvu/JB2Image.h b/libdjvu/JB2Image.h +index a87a83b..86a8bfa 100644 +--- a/libdjvu/JB2Image.h ++++ b/libdjvu/JB2Image.h +@@ -329,6 +329,7 @@ private: + int top,left,right,bottom; + void compute_bounding_box(const GBitmap &cbm); + }; ++public: + GTArray boxes; + void get_bounding_box(int shapeno, LibRect &dest); + }; +-- +2.37.3 + + +From f3013d06e4cb5e79fff0cb372e0165e3c594a43c Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 07:52:07 +0200 +Subject: drop-register-keyword-clang16.patch from Gentoo + + +diff --git a/libdjvu/GBitmap.h b/libdjvu/GBitmap.h +index ca89a19..b579f5d 100644 +--- a/libdjvu/GBitmap.h ++++ b/libdjvu/GBitmap.h +@@ -620,7 +620,7 @@ GBitmap::euclidian_ratio(int a, int b, int &q, int &r) + inline int + GBitmap::read_run(unsigned char *&data) + { +- register int z=*data++; ++ int z=*data++; + return (z>=RUNOVERFLOWVALUE)? + ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z; + } +@@ -628,7 +628,7 @@ GBitmap::read_run(unsigned char *&data) + inline int + GBitmap::read_run(const unsigned char *&data) + { +- register int z=*data++; ++ int z=*data++; + return (z>=RUNOVERFLOWVALUE)? + ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z; + } +-- +2.37.3 + + +From 1fb610c5ec3fae88c4ad6d26215a5b621d7b437d Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0001-djvulibre-fedora-Patch0-djvulibre-3.5.22-cdefs.patch.patch + + +diff --git a/libdjvu/GSmartPointer.h b/libdjvu/GSmartPointer.h +index 8a8bb8a..08540f7 100644 +--- a/libdjvu/GSmartPointer.h ++++ b/libdjvu/GSmartPointer.h +@@ -62,6 +62,8 @@ + # pragma interface + #endif + ++#include ++ + /** @name GSmartPointer.h + + Files #"GSmartPointer.h"# and #"GSmartPointer.cpp"# define a smart-pointer +-- +2.37.3 + + +From 51a79d4bc698521d7ef336d24febce8689cd1e69 Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0002-djvulibre-fedora-Patch6-djvulibre-3.5.27-export-file.patch + + +diff --git a/desktopfiles/Makefile.am b/desktopfiles/Makefile.am +index 9e952e1..5b8cae3 100644 +--- a/desktopfiles/Makefile.am ++++ b/desktopfiles/Makefile.am +@@ -32,10 +32,9 @@ if HAVE_CONVERSION_INKSCAPE + convert_icons_process = \ + s=`echo $@ | sed -e 's/[a-z]*\([0-9]*\).*/\1/'`; \ + ${INKSCAPE} \ +---without-gui \ + --export-width=$${s} \ + --export-height=$${s} \ +---export-png=$@ $< ++--export-filename=$@ $< + endif + + if HAVE_CONVERSION_CONVERT +-- +2.37.3 + + +From a349e3aaa44cfbe958935cfb4f1bf1bcc6b6f686 Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0003-djvulibre-fedora-Patch8-djvulibre-3.5.27-check-image.patch + + +diff --git a/libdjvu/IW44Image.cpp b/libdjvu/IW44Image.cpp +index e8d4b44..aa3d554 100644 +--- a/libdjvu/IW44Image.cpp ++++ b/libdjvu/IW44Image.cpp +@@ -678,7 +678,11 @@ IW44Image::Map::image(signed char *img8, int rowsize, int pixsep, int fast) + size_t sz = bw * bh; + if (sz / (size_t)bw != (size_t)bh) // multiplication overflow + G_THROW("IW44Image: image size exceeds maximum (corrupted file?)"); ++ if (sz == 0) ++ G_THROW("IW44Image: zero size image (corrupted file?)"); + GPBuffer gdata16(data16,sz); ++ if (data16 == NULL) ++ G_THROW("IW44Image: unable to allocate image data"); + // Copy coefficients + int i; + short *p = data16; +-- +2.37.3 + + +From 7270e7a7842ce4b2c789453618b1fa0fcc425ecb Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0004-djvulibre-fedora-Patch9-djvulibre-3.5.27-interger-ov.patch + + +diff --git a/tools/ddjvu.cpp b/tools/ddjvu.cpp +index 7109952..2f3e0f9 100644 +--- a/tools/ddjvu.cpp ++++ b/tools/ddjvu.cpp +@@ -70,6 +70,7 @@ + #include + #include + #include ++#include + + #ifdef UNIX + # include +@@ -394,7 +395,9 @@ render(ddjvu_page_t *page, int pageno) + rowsize = rrect.w; + else + rowsize = rrect.w * 3; +- if (! (image = (char*)malloc(rowsize * rrect.h))) ++ if ((size_t)rowsize > SIZE_MAX / rrect.h) ++ die(i18n("Integer overflow when allocating image buffer for page %d"), pageno); ++ if (! (image = (char*)malloc((size_t)rowsize * rrect.h))) + die(i18n("Cannot allocate image buffer for page %d"), pageno); + + /* Render */ +-- +2.37.3 + + +From d3491c280a8f0bfb7476e2f8e1c01945efb26a8e Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0005-djvulibre-fedora-Patch10-djvulibre-3.5.27-check-inpu.patch + + +diff --git a/libdjvu/DataPool.cpp b/libdjvu/DataPool.cpp +index 5fcbedf..4c2eaf0 100644 +--- a/libdjvu/DataPool.cpp ++++ b/libdjvu/DataPool.cpp +@@ -791,6 +791,8 @@ DataPool::create(const GP & pool, int start, int length) + DEBUG_MSG("DataPool::DataPool: pool=" << (void *)((DataPool *)pool) << " start=" << start << " length= " << length << "\n"); + DEBUG_MAKE_INDENT(3); + ++ if (!pool) G_THROW( ERR_MSG("DataPool.zero_DataPool") ); ++ + DataPool *xpool=new DataPool(); + GP retval=xpool; + xpool->init(); +-- +2.37.3 + + +From 92327dab0211d31391c6bd474e7cede41868426d Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0006-djvulibre-fedora-Patch11-djvulibre-3.5.27-djvuport-s.patch + + +diff --git a/libdjvu/DjVuPort.cpp b/libdjvu/DjVuPort.cpp +index 2b3e0d2..a377920 100644 +--- a/libdjvu/DjVuPort.cpp ++++ b/libdjvu/DjVuPort.cpp +@@ -507,10 +507,19 @@ GP + DjVuPortcaster::id_to_file(const DjVuPort * source, const GUTF8String &id) + { + GPList list; ++ ++ if (!!opening_id && opening_id == id) ++ G_THROW("DjVuPortcaster: recursive opening of the same file (corrupted file?)"); ++ else ++ opening_id = id; ++ + compute_closure(source, list, true); + GP file; + for(GPosition pos=list;pos;++pos) + if ((file=list[pos]->id_to_file(source, id))) break; ++ ++ opening_id = GUTF8String(); ++ + return file; + } + +diff --git a/libdjvu/DjVuPort.h b/libdjvu/DjVuPort.h +index e2b3125..313dc2b 100644 +--- a/libdjvu/DjVuPort.h ++++ b/libdjvu/DjVuPort.h +@@ -484,6 +484,7 @@ private: + const DjVuPort *dst, int distance); + void compute_closure(const DjVuPort *src, GPList &list, + bool sorted=false); ++ GUTF8String opening_id; + }; + + +-- +2.37.3 + + +From 33af189611e1a1fc02382be5ca0a2c8771b4ecf9 Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0007-djvulibre-fedora-Patch12-djvulibre-3.5.27-unsigned-s.patch + + +diff --git a/libdjvu/GBitmap.cpp b/libdjvu/GBitmap.cpp +index c2fdbe4..3d552a6 100644 +--- a/libdjvu/GBitmap.cpp ++++ b/libdjvu/GBitmap.cpp +@@ -69,6 +69,7 @@ + #include + #include + #include ++#include + + // - Author: Leon Bottou, 05/1997 + +@@ -1284,6 +1285,8 @@ GBitmap::decode(unsigned char *runs) + // initialize pixel array + if (nrows==0 || ncolumns==0) + G_THROW( ERR_MSG("GBitmap.not_init") ); ++ if (ncolumns > USHRT_MAX - border) ++ G_THROW("GBitmap: row size exceeds maximum (corrupted file?)"); + bytes_per_row = ncolumns + border; + if (runs==0) + G_THROW( ERR_MSG("GBitmap.null_arg") ); +-- +2.37.3 + + +From 4f7c6da73feddee68408b94004a80ceb03c055d6 Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 10:49:10 +0200 +Subject: applying patch + 0008-djvulibre-fedora-Patch13-djvulibre-3.5.27-out-o-2.patch + + +diff --git a/libdjvu/DjVuText.cpp b/libdjvu/DjVuText.cpp +index 60a4f39..9d893c2 100644 +--- a/libdjvu/DjVuText.cpp ++++ b/libdjvu/DjVuText.cpp +@@ -345,7 +345,8 @@ DjVuTXT::decode(const GP &gbs) + int textsize = bs.read24(); + char *buffer = textUTF8.getbuf(textsize); + int readsize = bs.read(buffer,textsize); +- buffer[readsize] = 0; ++ if (buffer) ++ buffer[readsize] = 0; + if (readsize < textsize) + G_THROW( ERR_MSG("DjVuText.corrupt_chunk") ); + // Try reading zones +-- +2.37.3 + + +From ebe3c69481a8fd3928baf92f13ee5f0d1cb4b185 Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Thu, 28 Sep 2023 11:29:36 +0200 +Subject: Use freshly build djvused to create the documentation + + +diff --git a/doc/make-djvulibre-book-en.sh b/doc/make-djvulibre-book-en.sh +index bc56e53..673adcf 100755 +--- a/doc/make-djvulibre-book-en.sh ++++ b/doc/make-djvulibre-book-en.sh +@@ -56,6 +56,6 @@ echo ")" >> $tmpdir/outline.txt + + ## plug outline + +-djvused $book -e "set-outline $tmpdir/outline.txt" -s ++../tools/djvused $book -e "set-outline $tmpdir/outline.txt" -s + + +-- +2.37.3 + diff --git a/media-libs/djvulibre/djvulibre-3.5.27.recipe b/media-libs/djvulibre/djvulibre-3.5.27.recipe deleted file mode 100644 index 85f573bd1..000000000 --- a/media-libs/djvulibre/djvulibre-3.5.27.recipe +++ /dev/null @@ -1,90 +0,0 @@ -SUMMARY="Web-centric format for distributing documents and images" -DESCRIPTION=" -DjVu is a web-centric format and software platform for distributing documents \ -and images." -HOMEPAGE="http://djvulibre.sourceforge.net/" -COPYRIGHT="2002 Leon Bottou and Yann Le Cun. - 2001 AT&T - 1999-2001 LizardTech, Inc." -LICENSE="GNU GPL v2" -REVISION="3" -SOURCE_URI="http://downloads.sourceforge.net/project/djvu/DjVuLibre/$portVersion/djvulibre-$portVersion.tar.gz" -CHECKSUM_SHA256="e69668252565603875fb88500cde02bf93d12d48a3884e472696c896e81f505f" -PATCHES="djvulibre-$portVersion.patchset" - -ARCHITECTURES="all" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - djvulibre$secondaryArchSuffix = $portVersion - cmd:any2djvu$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:bzz$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:c44$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:cjb2$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:cpaldjvu$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:csepdjvu$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:ddjvu$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvm$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvmcvt$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvudigital$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvudump$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvuextract$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvumake$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvups$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvused$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvuserve$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvutoxml$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvutxt$secondaryArchSuffix = $portVersion compat >= 3.5 - cmd:djvuxmlparser$secondaryArchSuffix = $portVersion compat >= 3.5 - lib:libdjvulibre$secondaryArchSuffix = 21.6.0 compat >= 21 - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libjpeg$secondaryArchSuffix - lib:libtiff$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - djvulibre${secondaryArchSuffix}_devel = $portVersion - devel:libdjvulibre$secondaryArchSuffix = 21.6.0 compat >= 21 - " -REQUIRES_devel=" - djvulibre$secondaryArchSuffix == $portVersion - " - -BUILD_REQUIRES=" - devel:libjpeg$secondaryArchSuffix - devel:libtiff$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:aclocal - cmd:autoconf - cmd:gcc$secondaryArchSuffix - cmd:libtool - cmd:libtoolize$secondaryArchSuffix - cmd:make - " - -BUILD() -{ - aclocal - libtoolize -fci - automake --add-missing - autoconf - runConfigure ./configure - make -} - -INSTALL() -{ - make install - - prepareInstalledDevelLibs libdjvulibre - - fixPkgconfig - - packageEntries devel $developDir -} diff --git a/media-libs/djvulibre/patches/djvulibre-3.5.27.patchset b/media-libs/djvulibre/patches/djvulibre-3.5.27.patchset deleted file mode 100644 index e566deabd..000000000 --- a/media-libs/djvulibre/patches/djvulibre-3.5.27.patchset +++ /dev/null @@ -1,44 +0,0 @@ -From 8654d9d893f8748a990c91550edf8ce65e8cd508 Mon Sep 17 00:00:00 2001 -From: Sergei Reznikov -Date: Wed, 25 Mar 2015 10:35:25 +0300 -Subject: Fix build - - -diff --git a/libdjvu/miniexp.cpp b/libdjvu/miniexp.cpp -index 80ef640..4e8445e 100644 ---- a/libdjvu/miniexp.cpp -+++ b/libdjvu/miniexp.cpp -@@ -1241,7 +1241,7 @@ static int stdio_fputs(miniexp_io_t *io, const char *s) { - - static int true_stdio_fgetc(miniexp_io_t *io) { - FILE *f = (io->data[0]) ? (FILE*)(io->data[0]) : stdin; -- return ::getc(f); -+ return getc(f); - } - static int compat_getc() { - return true_stdio_fgetc(&miniexp_io); --- -2.13.1 - - -From 9f3b58cfbbe05e81600ed2a333e60c5b952b40e9 Mon Sep 17 00:00:00 2001 -From: Sergei Reznikov -Date: Wed, 25 Mar 2015 10:45:06 +0300 -Subject: Haiku: gcc2 fix - - -diff --git a/libdjvu/JB2Image.h b/libdjvu/JB2Image.h -index a87a83b..86a8bfa 100644 ---- a/libdjvu/JB2Image.h -+++ b/libdjvu/JB2Image.h -@@ -329,6 +329,7 @@ private: - int top,left,right,bottom; - void compute_bounding_box(const GBitmap &cbm); - }; -+public: - GTArray boxes; - void get_bounding_box(int shapeno, LibRect &dest); - }; --- -2.13.1 -