summaryrefslogtreecommitdiff
path: root/app-text/ebook-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /app-text/ebook-tools
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'app-text/ebook-tools')
-rw-r--r--app-text/ebook-tools/Manifest4
-rw-r--r--app-text/ebook-tools/ebook-tools-0.2.2-r2.ebuild34
-rw-r--r--app-text/ebook-tools/files/ebook-tools-0.2.2-crashfix.patch50
-rw-r--r--app-text/ebook-tools/files/ebook-tools-0.2.2-fvisibility-hidden.patch22
-rw-r--r--app-text/ebook-tools/files/ebook-tools-0.2.2-libzip-cmake.patch83
5 files changed, 193 insertions, 0 deletions
diff --git a/app-text/ebook-tools/Manifest b/app-text/ebook-tools/Manifest
index c8fa3e876cca..36805001156e 100644
--- a/app-text/ebook-tools/Manifest
+++ b/app-text/ebook-tools/Manifest
@@ -1,3 +1,7 @@
+AUX ebook-tools-0.2.2-crashfix.patch 1883 BLAKE2B 957cdf93efefda23074d762992c71e49b991f634394513923eac93ca9f0c3727ae1c17cbfcd65ede714b9b7876c0abb23945e26b093bf9a8b24193babf3b828e SHA512 1c0b432c1628b7164675df488220aa89a725260cd34e118ec3b96be0e647a899d65418ba4b6a0530a6999dcb4d218023e5541c0f6a1a481c25fee0742b79c5ba
+AUX ebook-tools-0.2.2-fvisibility-hidden.patch 998 BLAKE2B 3595aecd20dd3e046d76517595f337642e0723ac6fddab9a4f74a9e29b3cc415cafce3688f1fbc395e3b681a90ac88c05124b71c69882e1a3cda25c231d5258a SHA512 ae8c8608335e3d7251f4fca959a9ada267cffed6d7abbf7baf5a053490b80789cff3e9fde76ca6c034bf19760a51d6822e2ead7a4f7d15aaa11d5484c463de6f
+AUX ebook-tools-0.2.2-libzip-cmake.patch 3113 BLAKE2B e3b78d2ab278ff759afec16a57f074a722b3f5ff6aeceac9bd736843981d6de205607a0e89ffad0db4fdc14e3d250959a02b642e07b01a77c24aa494a1b37d8a SHA512 d228d9bd192e5cd46c7a991025d995b33e26049053ecd548ab35edace11e10aef6c7ca24c584680f97bb765d7e3485b5e6ea337a0255dcf1041f804213443b78
DIST ebook-tools-0.2.2.tar.gz 46889 BLAKE2B 20b6ff048e9e31d2e00db3a02b67e21f3031d74aedfc663331b08f626b1816adecad5039e124462f97ff2ff7dc43f002eb39dd625f031ae42fe2b46338e94fcf SHA512 b4518249835ed7cc672392bf2f8b1c62bc218e41c53663bb26ab34c9e43a99b6b7ae794babdb4bd775e467bb17918703a66ee57c8cf94cb7afc4ba2a7f74816a
EBUILD ebook-tools-0.2.2-r1.ebuild 649 BLAKE2B d39c7352b72d1b8143468be21df3e4f2c094ea6c0b9380ae69d1ec0b6a20f62d820caa4a618861a61c2f00f0402ca2cb1c2c05b5c31346f0da3e929ef487364d SHA512 4cd37a92486ff8fe5a6f62db6016ddc888dcbe27d7d88579721e3ef2fdf3183131108ecb3defce86189401ef5979a236ecba6368202d7c67facf2e94de626fa1
+EBUILD ebook-tools-0.2.2-r2.ebuild 774 BLAKE2B 7e04f816f7f11e9653b571ef0652094431e5390cfa0394b899f8c0b104533c7faf83b7e5a2ace646eda0200934db1f96ee00c40f424a49f9ad0db54bd319173c SHA512 ac365508573ea852bdbb481580f314e313e843ef16b4323c961193a9d84fd8e3c4f5c28ba3e80f593d3241ae8fcdbb4c0848bd9dad297d6f8795087b43380ef9
MISC metadata.xml 400 BLAKE2B c225e8514134fea3843975618d6bb5b6085785eb71a9b0413bf986d752eff783f973c10fb7e6af504a3efa1c0e05475b421ff4c1f4c24bf51d4a948d485ed103 SHA512 2ab30e14742c63fc54cc75068b57d1c9fa178d6f57fb03b8b15c5649d4bdf35c5068a132c6ee50fe855a2037af67b5c2fd2229cc97b4f3e89f4eecde6d21885b
diff --git a/app-text/ebook-tools/ebook-tools-0.2.2-r2.ebuild b/app-text/ebook-tools/ebook-tools-0.2.2-r2.ebuild
new file mode 100644
index 000000000000..b8b20f0bdac3
--- /dev/null
+++ b/app-text/ebook-tools/ebook-tools-0.2.2-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="Tools for accessing and converting various ebook file formats"
+HOMEPAGE="https://sourceforge.net/projects/ebook-tools/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86"
+IUSE="+lit2epub"
+
+DEPEND="
+ dev-libs/libxml2
+ >=dev-libs/libzip-1.7.2:=
+"
+RDEPEND="${DEPEND}
+ lit2epub? ( app-text/convertlit )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-crashfix.patch"
+ "${FILESDIR}/${P}-fvisibility-hidden.patch"
+ "${FILESDIR}/${P}-libzip-cmake.patch"
+)
+
+src_prepare() {
+ cmake_src_prepare
+ use lit2epub || sed -e "\|lit2epub|d" -i src/tools/CMakeLists.txt || die
+}
diff --git a/app-text/ebook-tools/files/ebook-tools-0.2.2-crashfix.patch b/app-text/ebook-tools/files/ebook-tools-0.2.2-crashfix.patch
new file mode 100644
index 000000000000..1ca8dd4902f2
--- /dev/null
+++ b/app-text/ebook-tools/files/ebook-tools-0.2.2-crashfix.patch
@@ -0,0 +1,50 @@
+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.
+---
+ src/libepub/epub.c | 5 +++--
+ src/libepub/opf.c | 4 ++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/libepub/epub.c b/src/libepub/epub.c
+index d085503..a259d9d 100644
+--- a/src/libepub/epub.c
++++ b/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/src/libepub/opf.c b/src/libepub/opf.c
+index 6851db2..09bce9e 100644
+--- a/src/libepub/opf.c
++++ b/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
diff --git a/app-text/ebook-tools/files/ebook-tools-0.2.2-fvisibility-hidden.patch b/app-text/ebook-tools/files/ebook-tools-0.2.2-fvisibility-hidden.patch
new file mode 100644
index 000000000000..933ecb878810
--- /dev/null
+++ b/app-text/ebook-tools/files/ebook-tools-0.2.2-fvisibility-hidden.patch
@@ -0,0 +1,22 @@
+--- a/src/libepub/epub_shared.h
++++ b/src/libepub/epub_shared.h
+@@ -8,7 +8,7 @@
+ # define EPUB_EXPORT __declspec(dllimport)
+ # endif
+ #else
+-# define EPUB_EXPORT
++# define EPUB_EXPORT __attribute__ ((visibility ("default")))
+ #endif
+
+ /**
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,7 +15,7 @@ find_package(LibXml2 REQUIRED)
+ find_package(LibZip REQUIRED)
+
+ if(CMAKE_C_COMPILER_ID MATCHES GNU)
+- set(CMAKE_C_FLAGS "-Wall -W -Wno-long-long -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -Wshadow -fno-common ${CMAKE_C_FLAGS}")
++ set(CMAKE_C_FLAGS "-Wall -W -Wno-long-long -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -Wshadow -fno-common -fvisibility=hidden ${CMAKE_C_FLAGS}")
+ endif(CMAKE_C_COMPILER_ID MATCHES GNU)
+ if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
diff --git a/app-text/ebook-tools/files/ebook-tools-0.2.2-libzip-cmake.patch b/app-text/ebook-tools/files/ebook-tools-0.2.2-libzip-cmake.patch
new file mode 100644
index 000000000000..d1a560f1a5da
--- /dev/null
+++ b/app-text/ebook-tools/files/ebook-tools-0.2.2-libzip-cmake.patch
@@ -0,0 +1,83 @@
+From fa125b4223bc8995ed60befbed757ec23eed72e7 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Thu, 22 Oct 2020 23:32:33 +0200
+Subject: [PATCH] Use >=dev-libs/libzip-1.7.2 cmake config
+
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ CMakeLists.txt | 2 +-
+ cmake/FindLibZip.cmake | 36 ------------------------------------
+ src/libepub/CMakeLists.txt | 2 +-
+ 3 files changed, 2 insertions(+), 38 deletions(-)
+ delete mode 100644 cmake/FindLibZip.cmake
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fc141c2..691cf2b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+ set(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)")
+
+ find_package(LibXml2 REQUIRED)
+-find_package(LibZip REQUIRED)
++find_package(LibZip 1.7.2 CONFIG REQUIRED)
+
+ if(CMAKE_C_COMPILER_ID MATCHES GNU)
+ set(CMAKE_C_FLAGS "-Wall -W -Wno-long-long -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -Wshadow -fno-common ${CMAKE_C_FLAGS}")
+diff --git a/cmake/FindLibZip.cmake b/cmake/FindLibZip.cmake
+deleted file mode 100644
+index c873092..0000000
+--- a/cmake/FindLibZip.cmake
++++ /dev/null
+@@ -1,36 +0,0 @@
+-# - Try to find libzip
+-# Once done this will define
+-#
+-# LIBZIP_FOUND - system has the zip library
+-# LIBZIP_INCLUDE_DIR - the zip include directory
+-# LIBZIP_LIBRARY - Link this to use the zip library
+-#
+-# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
+-#
+-# Redistribution and use is allowed according to the terms of the BSD license.
+-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+-
+-if (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)
+- # in cache already
+- set(LIBZIP_FOUND TRUE)
+-else (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)
+-
+- find_path(LIBZIP_INCLUDE_DIR zip.h
+- ${GNUWIN32_DIR}/include
+- )
+-
+- find_library(LIBZIP_LIBRARY NAMES zip
+- PATHS
+- ${GNUWIN32_DIR}/lib
+- )
+-
+- include(FindPackageHandleStandardArgs)
+- FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibZip DEFAULT_MSG LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR)
+-
+- # ensure that they are cached
+- set(LIBZIP_INCLUDE_DIR ${LIBZIP_INCLUDE_DIR} CACHE INTERNAL "The libzip include path")
+- set(LIBZIP_LIBRARY ${LIBZIP_LIBRARY} CACHE INTERNAL "The libraries needed to use libzip")
+-
+-endif (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)
+-
+-mark_as_advanced(LIBZIP_INCLUDE_DIR LIBZIP_LIBRARY)
+diff --git a/src/libepub/CMakeLists.txt b/src/libepub/CMakeLists.txt
+index a3208b7..460270c 100644
+--- a/src/libepub/CMakeLists.txt
++++ b/src/libepub/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ include_directories (${EBOOK-TOOLS_SOURCE_DIR}/src/libepub ${LIBXML2_INCLUDE_DIR} ${LIBZIP_INCLUDE_DIR})
+ add_library (epub SHARED epub.c ocf.c opf.c linklist.c list.c)
+-target_link_libraries (epub ${LIBZIP_LIBRARY} ${LIBXML2_LIBRARIES})
++target_link_libraries (epub libzip::zip ${LIBXML2_LIBRARIES})
+
+ set_target_properties (epub PROPERTIES VERSION 0.2.1 SOVERSION 0)
+
+--
+2.29.0
+