[neon/extras/kmymoney/Neon/release] debian: temporarly fix libical detection

Pino Toscano null at kde.org
Mon Aug 15 14:02:05 BST 2022


Git commit 1d4eba69b6c3f69c290635f1c32c99b8e9d88dcb by Pino Toscano.
Committed on 21/08/2021 at 11:09.
Pushed by jriddell into branch 'Neon/release'.

temporarly fix libical detection

M  +3    -0    debian/changelog
A  +128  -0    debian/patches/cmake-libical-own-module.diff
A  +1    -0    debian/patches/series

https://invent.kde.org/neon/extras/kmymoney/commit/1d4eba69b6c3f69c290635f1c32c99b8e9d88dcb

diff --git a/debian/changelog b/debian/changelog
index 43c53d6..3572daf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,9 @@ kmymoney (5.1.2-0r1) UNRELEASED; urgency=medium
   * Bump Standards-Version to 4.6.0, no changes required.
   * Use execute_after_dh_auto_install to avoid invoking dh_auto_install
     manually.
+  * Temporarly switch the CMake detection of libical to the own code, instead
+    of relying on the CMake config module of libical which is not shipped in
+    libical-dev (I do not know why); patch +cmake-libical-own-module.diff.
 
  -- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org>  Sat, 21 Aug 2021 12:45:34 +0200
 
diff --git a/debian/patches/cmake-libical-own-module.diff b/debian/patches/cmake-libical-own-module.diff
new file mode 100644
index 0000000..6df1fc5
--- /dev/null
+++ b/debian/patches/cmake-libical-own-module.diff
@@ -0,0 +1,128 @@
+Author: Pino Toscano <pino at debian.org>
+Description: Revert libical detection to use an own CMake module
+ While libical has been providing a CMake config module for years, sadly it has
+ not been packaged in Debian so far. KMyMoney switched to rely on that instead
+ of the own "find module", which means that libical cannot be found anymore.
+ .
+ As temporary workaround, revert the upstream commit [1] that switches to the
+ CMake config module of libical, using the previous way.
+ .
+ [1] 90fc77f734da5aeb8fea4d36971e97f7f024a113
+Last-Update: 2021-08-21
+Forwarded: not-needed
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -275,9 +275,9 @@ add_feature_info(Weboob ENABLE_WEBOOB "O
+ 
+ 
+ # check for optional ical support
+-find_package(LibIcal)
++find_package(Libical)
+ cmake_dependent_option(ENABLE_LIBICAL "Enable Calendar plugin" ON
+-                       "LibIcal_FOUND" OFF)
++                       "LIBICAL_FOUND" OFF)
+ add_feature_info(iCalendar ENABLE_LIBICAL "iCalendar integration.")
+ 
+ 
+--- /dev/null
++++ b/cmake/modules/FindLibical.cmake
+@@ -0,0 +1,81 @@
++# Find Libical
++#
++#  LIBICAL_FOUND - system has Libical with the minimum version needed
++#  LIBICAL_INCLUDE_DIRS - the Libical include directories
++#  LIBICAL_LIBRARIES - The libraries needed to use Libical
++#  LIBICAL_VERSION = The value of ICAL_VERSION defined in ical.h
++
++# SPDX-FileCopyrightText: 2008 Allen Winter <winter at kde.org>
++#
++# Redistribution and use is allowed according to the terms of the BSD license.
++# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
++
++set(LIBICAL_FOUND FALSE)
++
++if(NOT LIBICAL_MIN_VERSION)
++  set(LIBICAL_MIN_VERSION "0.33")
++endif(NOT LIBICAL_MIN_VERSION)
++
++if (WIN32)
++  file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
++endif(WIN32)
++
++set(LIBICAL_FIND_REQUIRED ${Libical_FIND_REQUIRED})
++if(LIBICAL_INCLUDE_DIRS AND LIBICAL_LIBRARIES)
++
++  # Already in cache, be silent
++  set(LIBICAL_FIND_QUIETLY TRUE)
++
++endif(LIBICAL_INCLUDE_DIRS AND LIBICAL_LIBRARIES)
++
++#set the root from the LIBICAL_BASE environment
++file(TO_CMAKE_PATH "$ENV{LIBICAL_BASE}" libical_root )
++#override the root from LIBICAL_BASE defined to cmake
++if(DEFINED LIBICAL_BASE)
++  file(TO_CMAKE_PATH "${LIBICAL_BASE}" libical_root )
++endif(DEFINED LIBICAL_BASE)
++
++find_path(LIBICAL_INCLUDE_DIRS NAMES libical/ical.h
++  HINTS ${libical_root}/include ${_program_FILES_DIR}/libical/include
++)
++
++find_library(LIBICAL_LIBRARY NAMES ical libical
++  HINTS ${libical_root}/lib ${_program_FILES_DIR}/libical/lib
++)
++find_library(LIBICALSS_LIBRARY NAMES icalss libicalss
++  HINTS ${libical_root}/lib ${_program_FILES_DIR}/libical/lib
++)
++set(LIBICAL_LIBRARIES ${LIBICAL_LIBRARY} ${LIBICALSS_LIBRARY})
++
++if(LIBICAL_INCLUDE_DIRS AND LIBICAL_LIBRARIES)
++  set(FIND_LIBICAL_VERSION_SOURCE
++    "#include <libical/ical.h>\n int main()\n {\n printf(\"%s\",ICAL_VERSION);return 1;\n }\n")
++  set(FIND_LIBICAL_VERSION_SOURCE_FILE ${CMAKE_BINARY_DIR}/CMakeTmp/FindLIBICAL.cxx)
++  file(WRITE "${FIND_LIBICAL_VERSION_SOURCE_FILE}" "${FIND_LIBICAL_VERSION_SOURCE}")
++
++  set(FIND_LIBICAL_VERSION_ADD_INCLUDES
++    "-DINCLUDE_DIRECTORIES:STRING=${LIBICAL_INCLUDE_DIRS}")
++
++  try_run(RUN_RESULT COMPILE_RESULT
++    ${CMAKE_BINARY_DIR}
++    ${FIND_LIBICAL_VERSION_SOURCE_FILE}
++    CMAKE_FLAGS "${FIND_LIBICAL_VERSION_ADD_INCLUDES}"
++    RUN_OUTPUT_VARIABLE LIBICAL_VERSION)
++
++  if(COMPILE_RESULT AND RUN_RESULT EQUAL 1)
++    message(STATUS "Found Libical version ${LIBICAL_VERSION}")
++    if(${LIBICAL_VERSION} VERSION_LESS ${LIBICAL_MIN_VERSION})
++      message(STATUS "Libcal version ${LIBICAL_VERSION} is too old. At least version ${LIBICAL_MIN_VERSION} is needed.")
++      set(LIBICAL_INCLUDE_DIRS "")
++      set(LIBICAL_LIBRARIES "")
++    else(${LIBICAL_VERSION} VERSION_LESS ${LIBICAL_MIN_VERSION})
++      set(LIBICAL_FOUND TRUE)
++    endif(${LIBICAL_VERSION} VERSION_LESS ${LIBICAL_MIN_VERSION})
++  else(COMPILE_RESULT AND RUN_RESULT EQUAL 1)
++    message(FATAL_ERROR "Unable to compile or run the libical version detection program.")
++  endif(COMPILE_RESULT AND RUN_RESULT EQUAL 1)
++else(LIBICAL_INCLUDE_DIRS AND LIBICAL_LIBRARIES)
++  message(STATUS "Could not find libical headers and library icalendarexport will not be compiled. If you do have libical development package installed use the LIBICAL_BASE cmake variable to point to the location where libical is installed")
++endif(LIBICAL_INCLUDE_DIRS AND LIBICAL_LIBRARIES)
++
++mark_as_advanced(LIBICAL_INCLUDE_DIRS LIBICAL_LIBRARIES)
+--- a/kmymoney/plugins/icalendar/export/CMakeLists.txt
++++ b/kmymoney/plugins/icalendar/export/CMakeLists.txt
+@@ -21,12 +21,12 @@ set_target_properties(icalendarexporter
+                       PROPERTIES
+                       LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
+ 
+-target_include_directories(icalendarexporter PRIVATE ${LibIcal_INCLUDE_DIRS})
++target_include_directories(icalendarexporter PRIVATE ${LIBICAL_INCLUDE_DIRS})
+ target_link_libraries(icalendarexporter
+   KF5::KIOWidgets
+   kmm_mymoney
+   kmm_plugin
+-  ${LibIcal_LIBRARIES}
++  ${LIBICAL_LIBRARIES}
+ )
+ 
+ install(FILES icalendarexporter.rc
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..be23571
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+cmake-libical-own-module.diff



More information about the Neon-commits mailing list