diff options
author | Tim Biermann <tbier@posteo.de> | 2021-02-24 11:05:31 +0000 |
---|---|---|
committer | Tim Biermann <tbier@posteo.de> | 2021-02-24 11:05:31 +0000 |
commit | 8529940b8f6928db8c01927f886832e8ddce0f32 (patch) | |
tree | d6ce099374f2945636680fcd2bbd7a463c389965 /ebook-tools | |
parent | a5b46329ed8aaa6c975a025ea8b009431ad555da (diff) | |
download | contrib-8529940b8f6928db8c01927f886832e8ddce0f32.tar.gz contrib-8529940b8f6928db8c01927f886832e8ddce0f32.tar.xz |
ebook-tools: adopted port, added a patch to fix a crash
Diffstat (limited to 'ebook-tools')
-rw-r--r-- | ebook-tools/.footprint | 1 | ||||
-rw-r--r-- | ebook-tools/.signature | 7 | ||||
-rw-r--r-- | ebook-tools/Pkgfile | 33 | ||||
-rw-r--r-- | ebook-tools/crash-fix.patch | 51 |
4 files changed, 73 insertions, 19 deletions
diff --git a/ebook-tools/.footprint b/ebook-tools/.footprint index b4c27ebdb..ba6d44ca0 100644 --- a/ebook-tools/.footprint +++ b/ebook-tools/.footprint @@ -1,6 +1,7 @@ drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/einfo +-rwxr-xr-x root/root usr/bin/lit2epub drwxr-xr-x root/root usr/include/ -rw-r--r-- root/root usr/include/epub.h -rw-r--r-- root/root usr/include/epub_shared.h diff --git a/ebook-tools/.signature b/ebook-tools/.signature index 49ea02029..50d3a5b27 100644 --- a/ebook-tools/.signature +++ b/ebook-tools/.signature @@ -1,5 +1,6 @@ untrusted comment: verify with /etc/ports/contrib.pub -RWSagIOpLGJF36a1+xF6/EYgs+XvTEvqmNRP45EOT0jTAJy9dAjLSImUIC1w0+6kUCy8jheAm1hLgYTs8a/Wye/dxBvdPLnfSAI= -SHA256 (Pkgfile) = a6be0dcc5ddaae6e1be2542c68feecd559d60be24739286e6fe5963de8b4e003 -SHA256 (.footprint) = 5b8b4f54bb379770a3b81c2a5a4f2ca1913a2799ffed0a2c5f5defa3154a7d41 +RWSagIOpLGJF30HGrMtDW/XvmG90ynq9el4Tl4+GyCt2QuIgjqb5vc4K947ho4Eo09/bsAyZ1ce5OJ4Z3vlYxR6bskomKCRoxw8= +SHA256 (Pkgfile) = 8051791acb80554c810bd7b92207df41c2826b001bbff3e77b5d3c7bc3e2721b +SHA256 (.footprint) = 92ae33d88d0810e6c90dca4fe6da8a93ac9c63dd9af197515795dd65d5e0abee SHA256 (ebook-tools-0.2.2.tar.gz) = cbc35996e911144fa62925366ad6a6212d6af2588f1e39075954973bbee627ae +SHA256 (crash-fix.patch) = ad556ce08909727a6022c9f1632086ccb8623a81a4f39cd34722e22116e14527 diff --git a/ebook-tools/Pkgfile b/ebook-tools/Pkgfile index 807cc190d..42873b2a0 100644 --- a/ebook-tools/Pkgfile +++ b/ebook-tools/Pkgfile @@ -1,23 +1,24 @@ -# Description: Ebook tools -# URL: http://ebook-tools.sourceforge.net/ -# Maintainer: Alan Mizrahi, alan at mizrahi dot com dot ve -# Depends on: libzip libxml2 +# Description: Tools for accessing and converting various ebook file formats +# URL: http://ebook-tools.sourceforge.net/ +# Maintainer: Tim Biermann, tbier at posteo dot de +# Depends on: libzip libxml2 name=ebook-tools version=0.2.2 -release=1 -source=(http://downloads.sourceforge.net/sourceforge/$name/$name-$version.tar.gz) +release=2 +source=(http://downloads.sourceforge.net/sourceforge/$name/$name-$version.tar.gz + # https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/ebook-tools/trunk/crash-fix.patch + crash-fix.patch) build() { + patch -Np2 -d $name-$version -i $SRC/crash-fix.patch # https://sourceforge.net/p/ebook-tools/bugs/8/ [[ -e /usr/bin/ninja ]] && PKGMK_EBOOKTOOLS+=' -G Ninja' - cmake -S $name-$version -B build $PKGMK_EBOOKTOOLS \ - -D CMAKE_INSTALL_PREFIX=/usr \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \ - -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \ - -Wno-dev - cmake --build build - DESTDIR=$PKG cmake --install build - - rm $PKG/usr/bin/lit2epub + cmake -S $name-$version -B build $PKGMK_EBOOKTOOLS \ + -D CMAKE_INSTALL_PREFIX=/usr \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \ + -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \ + -Wno-dev + cmake --build build + DESTDIR=$PKG cmake --install build } diff --git a/ebook-tools/crash-fix.patch b/ebook-tools/crash-fix.patch new file mode 100644 index 000000000..2389d299c --- /dev/null +++ b/ebook-tools/crash-fix.patch @@ -0,0 +1,51 @@ +From 93ebf942a90f9c95797838f9adab94bc0378671c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de> +Date: Tue, 30 Apr 2019 16:36:09 +0200 +Subject: [PATCH] Avoid crash on toc.ncx navPoint without navLabel + +Althoug at least one navLabel is required per navPoint, there is no +guarantee it actually exists. + +Avoid crashes due to invalid accesses of a null label in case the toc is +broken, and spew a warning. + +Fixes #8 epub_tit_next crashes on navPoint without navLabel. +--- + ebook-tools/src/libepub/epub.c | 5 +++-- + ebook-tools/src/libepub/opf.c | 4 ++++ + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ebook-tools/src/libepub/epub.c b/ebook-tools/src/libepub/epub.c +index d085503..a259d9d 100644 +--- a/ebook-tools/src/libepub/epub.c ++++ b/ebook-tools/src/libepub/epub.c +@@ -469,8 +469,9 @@ int epub_tit_next(struct titerator *tit) { + case TITERATOR_NAVMAP: + case TITERATOR_PAGES: + ti = GetNodeData(curr); +- tit->cache.label = +- (char *)_opf_label_get_by_doc_lang(tit->epub->opf, ti->label); ++ if (ti->label) ++ tit->cache.label = ++ (char *)_opf_label_get_by_doc_lang(tit->epub->opf, ti->label); + + if (! tit->cache.label) + tit->cache.label = (char *)ti->id; +diff --git a/ebook-tools/src/libepub/opf.c b/ebook-tools/src/libepub/opf.c +index 6851db2..09bce9e 100644 +--- a/ebook-tools/src/libepub/opf.c ++++ b/ebook-tools/src/libepub/opf.c +@@ -398,6 +398,10 @@ void _opf_parse_navmap(struct opf *opf, xmlTextReaderPtr reader) { + + } else if (xmlTextReaderNodeType(reader) == 15) { + if (item) { ++ if (! item->label) { ++ _epub_print_debug(opf->epub, DEBUG_WARNING, ++ "- missing navlabel for nav point element"); ++ } + _epub_print_debug(opf->epub, DEBUG_INFO, + "adding nav point item->%s %s (d:%d,p:%d)", + item->id, item->src, item->depth, item->playOrder); +-- +2.21.0 + |