From 9a050335e115160b5de55af00ca21150eb8876ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= Date: Thu, 1 Jul 2010 19:47:09 +0200 Subject: [PATCH] Add Findlibarchive.cmake to allow building with system's libarchive. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kai Wasserbäch --- debian/changelog | 4 +- debian/patches/add_libarchive_script.patch | 79 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 debian/patches/add_libarchive_script.patch diff --git a/debian/changelog b/debian/changelog index a2dda9ba1..7700d57bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,10 @@ cmake (2.8.2-2) UNRELEASED; urgency=low - Added libarchive-dev to Build-Depends. - Don't B-D on procps on Hurd, already provided by hurd. * debian/rules: Use system libarchive. + * debian/patches/add_libarchive_script.patch: Added to allow building with + the system's libarchive. - -- Kai Wasserbäch Thu, 01 Jul 2010 16:58:57 +0200 + -- Kai Wasserbäch Thu, 01 Jul 2010 19:43:25 +0200 cmake (2.8.2-1) unstable; urgency=low diff --git a/debian/patches/add_libarchive_script.patch b/debian/patches/add_libarchive_script.patch new file mode 100644 index 000000000..de4b975f4 --- /dev/null +++ b/debian/patches/add_libarchive_script.patch @@ -0,0 +1,79 @@ +--- + CMakeLists.txt | 3 +- + Modules/Findlibarchive.cmake | 41 ++++++++++++++++++++++++++++ + Tests/CMakeTests/ModuleNoticesTest.cmake.in | 2 + + 3 files changed, 45 insertions(+), 1 deletion(-) + +Index: b/CMakeLists.txt +=================================================================== +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -265,7 +265,8 @@ MACRO (CMAKE_BUILD_UTILITIES) + ENDIF() + IF(CMAKE_USE_SYSTEM_LIBARCHIVE) + FIND_PACKAGE(libarchive) +- SET(CMAKE_TAR_LIBRARIES libarchive) ++ SET(CMAKE_TAR_LIBRARIES ${LIBARCHIVE_LIBRARY}) ++ SET(CMAKE_TAR_INCLUDES ${LIBARCHIVE_INCLUDE_DIR}) + ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) +Index: b/Modules/Findlibarchive.cmake +=================================================================== +--- /dev/null ++++ b/Modules/Findlibarchive.cmake +@@ -0,0 +1,41 @@ ++# - Try to find libarchive ++# Once done this will define ++# ++# LIBARCHIVE_FOUND - system has libarchive ++# LIBARCHIVE_INCLUDE_DIR - the libarchive include directory ++# LIBARCHIVE_LIBRARY - Link this to use libarchive ++# HAVE_LIBARCHIVE_GZIP_SUPPORT - whether libarchive has been compiled with gzip support ++# HAVE_LIBARCHIVE_LZMA_SUPPORT - whether libarchive has been compiled with lzma support ++# HAVE_LIBARCHIVE_XZ_SUPPORT - whether libarchive has been compiled with xz support ++# ++# Copyright (c) 2006, Pino Toscano, ++# ++# Redistribution and use is allowed according to the terms of the BSD license. ++# For details see the accompanying COPYING-CMAKE-SCRIPTS file. ++ ++include(CheckLibraryExists) ++ ++if (LIBARCHIVE_LIBRARY AND LIBARCHIVE_INCLUDE_DIR) ++ # in cache already ++ set(LIBARCHIVE_FOUND TRUE) ++else (LIBARCHIVE_LIBRARY AND LIBARCHIVE_INCLUDE_DIR) ++ find_path(LIBARCHIVE_INCLUDE_DIR archive.h ++ ${GNUWIN32_DIR}/include ++ ) ++ ++ find_library(LIBARCHIVE_LIBRARY NAMES archive libarchive archive2 libarchive2 ++ PATHS ++ ${GNUWIN32_DIR}/lib ++ ) ++ ++ if (LIBARCHIVE_LIBRARY) ++ check_library_exists(${LIBARCHIVE_LIBRARY} archive_write_set_compression_gzip "" HAVE_LIBARCHIVE_GZIP_SUPPORT) ++ check_library_exists(${LIBARCHIVE_LIBRARY} archive_write_set_compression_lzma "" HAVE_LIBARCHIVE_LZMA_SUPPORT) ++ check_library_exists(${LIBARCHIVE_LIBRARY} archive_write_set_compression_xz "" HAVE_LIBARCHIVE_XZ_SUPPORT) ++ endif (LIBARCHIVE_LIBRARY) ++ ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(LibArchive DEFAULT_MSG LIBARCHIVE_INCLUDE_DIR LIBARCHIVE_LIBRARY HAVE_LIBARCHIVE_GZIP_SUPPORT) ++ ++ mark_as_advanced(LIBARCHIVE_INCLUDE_DIR LIBARCHIVE_LIBRARY HAVE_LIBARCHIVE_GZIP_SUPPORT HAVE_LIBARCHIVE_LZMA_SUPPORT) ++endif (LIBARCHIVE_LIBRARY AND LIBARCHIVE_INCLUDE_DIR) +Index: b/Tests/CMakeTests/ModuleNoticesTest.cmake.in +=================================================================== +--- a/Tests/CMakeTests/ModuleNoticesTest.cmake.in ++++ b/Tests/CMakeTests/ModuleNoticesTest.cmake.in +@@ -22,6 +22,8 @@ string(REPLACE "\r\r" "\r" notice_regex + # Modules that do not require our notice. + set(notice_exceptions + FindCUDA.cmake # MIT License, distributed here from upstream project ++ Findlibarchive.cmake # Debian-Patch: taken from kdeutils, different until ++ # upstream accepts it. + ) + + # Load the list of modules to check. diff --git a/debian/patches/series b/debian/patches/series index 29629183c..3aa2e4c46 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ FindGTK2_pangommconfig.diff FindJNI_fix_libarch_determination.diff cpack_installed_size.diff FindPython_fix_#569321_and_#580503.diff +add_libarchive_script.patch