aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ebook-tools/10-cmake_libzip_zipconf_path.patch
diff options
context:
space:
mode:
authorAndrew Domaszek <brimston3@hg0.us>2016-12-07 05:31:48 -0500
committerTimo Teräs <timo.teras@iki.fi>2016-12-27 06:33:41 +0000
commiteae64a38ef298888dd677021f7a32d881a0f9311 (patch)
treed9ce4f20c2071bb24b9b9e3b5906550cc8814853 /testing/ebook-tools/10-cmake_libzip_zipconf_path.patch
parentd8a845cacbbfef49f5fcf4bb19603681843ab745 (diff)
downloadaports-eae64a38ef298888dd677021f7a32d881a0f9311.tar.bz2
aports-eae64a38ef298888dd677021f7a32d881a0f9311.tar.xz
testing/ebook-tools: new aport
https://sourceforge.net/projects/ebook-tools Tools for accessing and converting various ebook file formats
Diffstat (limited to 'testing/ebook-tools/10-cmake_libzip_zipconf_path.patch')
-rw-r--r--testing/ebook-tools/10-cmake_libzip_zipconf_path.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/testing/ebook-tools/10-cmake_libzip_zipconf_path.patch b/testing/ebook-tools/10-cmake_libzip_zipconf_path.patch
new file mode 100644
index 0000000000..71cc04baa5
--- /dev/null
+++ b/testing/ebook-tools/10-cmake_libzip_zipconf_path.patch
@@ -0,0 +1,76 @@
+Author: Pino Toscano <toscano.pino@tiscali.it>
+Description: Get the include dir also for zipconf.h
+ Since libzip 0.11.x, the architecture-specific zipconf.h has been moved to
+ an include directory within the library path.
+ Adapt the CMake stuff to search for zipconf.h there, making sure to use all
+ the include directories needed when wanting to use libzip.
+Forwarded: no
+Last-Update: 2014-02-16
+Bug-Debian: https://bugs.debian.org/739152
+
+--- a/cmake/FindLibZip.cmake
++++ b/cmake/FindLibZip.cmake
+@@ -2,7 +2,7 @@
+ # Once done this will define
+ #
+ # LIBZIP_FOUND - system has the zip library
+-# LIBZIP_INCLUDE_DIR - the zip include directory
++# LIBZIP_INCLUDE_DIRS - the zip include directories
+ # LIBZIP_LIBRARY - Link this to use the zip library
+ #
+ # Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
+@@ -10,12 +10,12 @@
+ # 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)
++if (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIRS)
+ # in cache already
+ set(LIBZIP_FOUND TRUE)
+-else (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)
++else (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIRS)
+
+- find_path(LIBZIP_INCLUDE_DIR zip.h
++ find_path(_LIBZIP_INCLUDE_DIR zip.h
+ ${GNUWIN32_DIR}/include
+ )
+
+@@ -24,13 +24,26 @@
+ ${GNUWIN32_DIR}/lib
+ )
+
++ if (LIBZIP_LIBRARY)
++ get_filename_component(_LIBZIP_LIBRARY_DIR ${LIBZIP_LIBRARY} PATH)
++
++ find_path(_ZIPCONF_INCLUDE_DIR zipconf.h
++ PATHS
++ ${_LIBZIP_LIBRARY_DIR}/include
++ ${_LIBZIP_LIBRARY_DIR}/libzip/include
++ )
++ endif()
++
+ include(FindPackageHandleStandardArgs)
+- FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibZip DEFAULT_MSG LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR)
++ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibZip DEFAULT_MSG LIBZIP_LIBRARY _LIBZIP_INCLUDE_DIR _ZIPCONF_INCLUDE_DIR)
+
++ set(LIBZIP_INCLUDE_DIRS)
++ list(APPEND LIBZIP_INCLUDE_DIRS "${_LIBZIP_INCLUDE_DIR}")
++ list(APPEND LIBZIP_INCLUDE_DIRS "${_ZIPCONF_INCLUDE_DIR}")
+ # ensure that they are cached
+- set(LIBZIP_INCLUDE_DIR ${LIBZIP_INCLUDE_DIR} CACHE INTERNAL "The libzip include path")
++ set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIRS} CACHE INTERNAL "The libzip include paths")
+ set(LIBZIP_LIBRARY ${LIBZIP_LIBRARY} CACHE INTERNAL "The libraries needed to use libzip")
+
+-endif (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)
++endif (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIRS)
+
+-mark_as_advanced(LIBZIP_INCLUDE_DIR LIBZIP_LIBRARY)
++mark_as_advanced(LIBZIP_INCLUDE_DIRS LIBZIP_LIBRARY)
+--- a/src/libepub/CMakeLists.txt
++++ b/src/libepub/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-include_directories (${EBOOK-TOOLS_SOURCE_DIR}/src/libepub ${LIBXML2_INCLUDE_DIR} ${LIBZIP_INCLUDE_DIR})
++include_directories (${EBOOK-TOOLS_SOURCE_DIR}/src/libepub ${LIBXML2_INCLUDE_DIR} ${LIBZIP_INCLUDE_DIRS})
+ add_library (epub SHARED epub.c ocf.c opf.c linklist.c list.c)
+ target_link_libraries (epub ${LIBZIP_LIBRARY} ${LIBXML2_LIBRARIES})
+