[kde-freebsd] [PATCH] x11/kdelibs4: Fix FindKdcraw.cmake FindKexiv2.cmake, FindKipi.cmake
Jason E. Hale
bsdkaffee at gmail.com
Mon Aug 10 09:24:51 CEST 2009
>Submitter-Id: current-users
>Originator: Jason E. Hale
>Organization: none
>Confidential: no
>Synopsis: [PATCH] x11/kdelibs4: Fix FindKdcraw.cmake FindKexiv2.cmake, FindKipi.cmake
>Severity: non-critical
>Priority: low
>Category: ports
>Class: update
>Release: FreeBSD 7.2-RELEASE i386
>Environment:
System: FreeBSD mocha.verizon.net 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Mon May 4 04:03:46 EDT 2009 root at mocha.verizon.net:/usr/obj/usr/src/sys/MOCHA7 i386
KDE 4.3.0
>Description:
FindKdcraw.cmake, FindKexiv2.cmake, and FindKipi.cmake installed by x11/kdelibs4
do not work properly. They use the deprecated PKGCONFIG macro and do not
properly detect their respective libraries when the KDE3 counterparts are
installed.
Currently, all the ports that I know of requiring these libraries use a
patch that I came up with a while ago to detect Kdcraw, Kexiv2, and Kipi.
Namely:
deskutils/kdeplasma-addons
graphics/digikam-kde4
graphics/kipi-plugins-kde4
I have attached a patch that fixes the detection of the KDE4 versions of
Kdcraw, Kexiv2, and Kipi even if KDE3 versions are installed. This will help
reduce the patches we have and hopefully prevent any future ones.
>How-To-Repeat:
Use attached diff.
>Fix:
--- 2009-08-09-kdelibs4.diff begins here ---
diff -ruN kdelibs4.orig/Makefile kdelibs4/Makefile
--- kdelibs4.orig/Makefile 2009-08-09 21:42:09.000000000 -0400
+++ kdelibs4/Makefile 2009-08-09 22:08:24.000000000 -0400
@@ -8,6 +8,7 @@
PORTNAME= kdelibs
PORTVERSION= ${KDE4_VERSION}
+PORTREVISION= 1
CATEGORIES= x11 kde ipv6
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= ${KDE4_BRANCH}/${PORTVERSION}/src
diff -ruN kdelibs4.orig/files/patch-cmake_modules_FindKdcraw.cmake kdelibs4/files/patch-cmake_modules_FindKdcraw.cmake
--- kdelibs4.orig/files/patch-cmake_modules_FindKdcraw.cmake 2009-08-09 21:42:09.000000000 -0400
+++ kdelibs4/files/patch-cmake_modules_FindKdcraw.cmake 2009-08-10 02:46:49.000000000 -0400
@@ -1,11 +1,87 @@
--- ../cmake/modules/FindKdcraw.cmake.orig 2009-01-06 17:27:37.000000000 +0000
+++ ../cmake/modules/FindKdcraw.cmake 2009-01-25 08:34:44.000000000 +0000
-@@ -51,7 +51,7 @@
+@@ -45,63 +45,34 @@
+
+ else(KDCRAW_LOCAL_FOUND)
+
+- message(STATUS "Check Kdcraw library using pkg-config...")
+ if(NOT WIN32)
++ message(STATUS "Check Kdcraw library using pkg-config...")
++
+ # use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
- INCLUDE(UsePkgConfig)
-
+- INCLUDE(UsePkgConfig)
+-
- PKGCONFIG(libkdcraw _KDCRAWIncDir _KDCRAWLinkDir _KDCRAWLinkFlags _KDCRAWCflags)
-+ PKGCONFIG(libkdcraw-kde4 _KDCRAWIncDir _KDCRAWLinkDir _KDCRAWLinkFlags _KDCRAWCflags)
+-
+- if(_KDCRAWLinkFlags)
+- # query pkg-config asking for a libkdcraw >= 0.2.0
+- EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkdcraw RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+- if(_return_VALUE STREQUAL "0")
+- message(STATUS "Found libkdcraw release >= 0.2.0")
+- set(KDCRAW_VERSION_GOOD_FOUND TRUE)
+- else(_return_VALUE STREQUAL "0")
+- message(STATUS "Found libkdcaw release < 0.2.0, too old")
+- set(KDCRAW_VERSION_GOOD_FOUND FALSE)
+- set(KDCRAW_FOUND FALSE)
+- endif(_return_VALUE STREQUAL "0")
+- else(_KDCRAWLinkFlags)
+- set(KDCRAW_VERSION_GOOD_FOUND FALSE)
+- set(KDCRAW_FOUND FALSE)
+- endif(_KDCRAWLinkFlags)
+- ELSE(NOT WIN32)
+- set(KDCRAW_VERSION_GOOD_FOUND TRUE)
+- ENDif(NOT WIN32)
++ include(FindPkgConfig)
++ pkg_check_modules(LIBKDCRAW libkdcraw-kde4>=0.2.0)
++ else(NOT WIN32)
++ set(LIBKDCRAW_FOUND 1)
++ endif(NOT WIN32)
+
+- if(KDCRAW_VERSION_GOOD_FOUND)
+- set(KDCRAW_DEFINITIONS "${_KDCRAWCflags}")
++ if(LIBKDCRAW_FOUND)
++ set(KDCRAW_DEFINITIONS ${LIBKDCRAW_CFLAGS})
+
+- FIND_PATH(KDCRAW_INCLUDE_DIR libkdcraw/version.h
+- ${_KDCRAWIncDir}
++ find_path(KDCRAW_INCLUDE_DIR NAMES libkdcraw/version.h
++ PATHS ${LIBKEXIV2_INCLUDE_DIRS} ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH
+ )
+-
+- FIND_LIBRARY(KDCRAW_LIBRARIES NAMES kdcraw
+- PATHS
+- ${_KDCRAWLinkDir}
++ find_library(KDCRAW_LIBRARY NAMES kdcraw
++ PATHS ${LIBKDCRAW_LIBRARY_DIRS} ${KDE4_LIB_DIR} NO_DEFAULT_PATH
+ )
+-
+- if (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES)
+- set(KDCRAW_FOUND TRUE)
+- endif (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES)
+- endif(KDCRAW_VERSION_GOOD_FOUND)
+- if (KDCRAW_FOUND)
+- if (NOT Kdcraw_FIND_QUIETLY)
+- message(STATUS "Found libkdcraw: ${KDCRAW_LIBRARIES}")
+- endif (NOT Kdcraw_FIND_QUIETLY)
+- else (KDCRAW_FOUND)
+- if (Kdcraw_FIND_REQUIRED)
+- if (NOT KDCRAW_INCLUDE_DIR)
+- message(FATAL_ERROR "Could NOT find libkdcraw header files")
+- endif (NOT KDCRAW_INCLUDE_DIR)
+- if (NOT KDCRAW_LIBRARIES)
+- message(FATAL_ERROR "Could NOT find libkdcraw library")
+- endif (NOT KDCRAW_LIBRARIES)
+- endif (Kdcraw_FIND_REQUIRED)
+- endif (KDCRAW_FOUND)
++ endif(LIBKDCRAW_FOUND)
++
++ include(FindPackageHandleStandardArgs)
++ find_package_handle_standard_args(Kdcraw DEFAULT_MSG KDCRAW_LIBRARY KDCRAW_INCLUDE_DIR)
++
++ if(KDCRAW_FOUND)
++ set(KDCRAW_LIBRARIES ${KDCRAW_LIBRARY})
++ endif(KDCRAW_FOUND)
- if(_KDCRAWLinkFlags)
- # query pkg-config asking for a libkdcraw >= 0.2.0
+ MARK_AS_ADVANCED(KDCRAW_INCLUDE_DIR KDCRAW_LIBRARIES)
+
diff -ruN kdelibs4.orig/files/patch-cmake_modules_FindKexiv2.cmake kdelibs4/files/patch-cmake_modules_FindKexiv2.cmake
--- kdelibs4.orig/files/patch-cmake_modules_FindKexiv2.cmake 2009-08-09 21:42:09.000000000 -0400
+++ kdelibs4/files/patch-cmake_modules_FindKexiv2.cmake 2009-08-10 02:36:01.000000000 -0400
@@ -1,11 +1,81 @@
--- ../cmake/modules/FindKexiv2.cmake.orig 2009-01-06 17:27:37.000000000 +0000
+++ ../cmake/modules/FindKexiv2.cmake 2009-01-25 08:34:53.000000000 +0000
-@@ -49,7 +49,7 @@
+@@ -47,60 +47,30 @@
+
+ # use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
- INCLUDE(UsePkgConfig)
-
+- INCLUDE(UsePkgConfig)
+-
- PKGCONFIG(libkexiv2 _KEXIV2IncDir _KEXIV2LinkDir _KEXIV2LinkFlags _KEXIV2Cflags)
-+ PKGCONFIG(libkexiv2-kde4 _KEXIV2IncDir _KEXIV2LinkDir _KEXIV2LinkFlags _KEXIV2Cflags)
+-
+- if(_KEXIV2LinkFlags)
+- # query pkg-config asking for a libkexiv2 >= 0.2.0
+- EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkexiv2 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+- if(_return_VALUE STREQUAL "0")
+- message(STATUS "Found libkexiv2 release >= 0.2.0")
+- set(KEXIV2_VERSION_GOOD_FOUND TRUE)
+- else(_return_VALUE STREQUAL "0")
+- message(STATUS "Found libkexiv2 release < 0.2.0, too old")
+- set(KEXIV2_VERSION_GOOD_FOUND FALSE)
+- set(KEXIV2_FOUND FALSE)
+- endif(_return_VALUE STREQUAL "0")
+- else(_KEXIV2LinkFlags)
+- set(KEXIV2_VERSION_GOOD_FOUND FALSE)
+- set(KEXIV2_FOUND FALSE)
+- endif(_KEXIV2LinkFlags)
++ include(FindPkgConfig)
++ pkg_check_modules(LIBKEXIV2 libkexiv2-kde4>=0.2.0)
+ else(NOT WIN32)
+- set(KEXIV2_VERSION_GOOD_FOUND TRUE)
++ set(LIBKEXIV2_FOUND 1)
+ endif(NOT WIN32)
+
+- if(KEXIV2_VERSION_GOOD_FOUND)
+- set(KEXIV2_DEFINITIONS "${_KEXIV2Cflags}")
++ if(LIBKEXIV2_FOUND)
++ set(KEXIV2_DEFINITIONS ${LIBKEXIV2_CFLAGS})
- if(_KEXIV2LinkFlags)
- # query pkg-config asking for a libkexiv2 >= 0.2.0
+- FIND_PATH(KEXIV2_INCLUDE_DIR libkexiv2/version.h
+- ${_KEXIV2IncDir}
++ find_path(KEXIV2_INCLUDE_DIR NAMES libkexiv2/version.h
++ PATHS ${LIBKEXIV2_INCLUDE_DIRS} ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH
+ )
+-
+- FIND_LIBRARY(KEXIV2_LIBRARIES NAMES kexiv2
+- PATHS
+- ${_KEXIV2LinkDir}
++ find_library(KEXIV2_LIBRARY NAMES kexiv2
++ PATHS ${LIBKEXIV2_LIBRARY_DIRS} ${KDE4_LIB_DIR} NO_DEFAULT_PATH
+ )
+-
+- if (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES)
+- set(KEXIV2_FOUND TRUE)
+- endif (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES)
+- endif(KEXIV2_VERSION_GOOD_FOUND)
+- if (KEXIV2_FOUND)
+- if (NOT Kexiv2_FIND_QUIETLY)
+- message(STATUS "Found libkexiv2: ${KEXIV2_LIBRARIES}")
+- endif (NOT Kexiv2_FIND_QUIETLY)
+- else (KEXIV2_FOUND)
+- if (Kexiv2_FIND_REQUIRED)
+- if (NOT KEXIV2_INCLUDE_DIR)
+- message(FATAL_ERROR "Could NOT find libkexiv2 header files")
+- endif (NOT KEXIV2_INCLUDE_DIR)
+- if (NOT KEXIV2_LIBRARIES)
+- message(FATAL_ERROR "Could NOT find libkexiv2 library")
+- endif (NOT KEXIV2_LIBRARIES)
+- endif (Kexiv2_FIND_REQUIRED)
+- endif (KEXIV2_FOUND)
+-
++ endif(LIBKEXIV2_FOUND)
++
++ include(FindPackageHandleStandardArgs)
++ find_package_handle_standard_args(Kexiv2 DEFAULT_MSG KEXIV2_LIBRARY KEXIV2_INCLUDE_DIR)
++
++ if(KEXIV2_FOUND)
++ set(KEXIV2_LIBRARIES ${KEXIV2_LIBRARY})
++ endif(KEXIV2_FOUND)
++
+ MARK_AS_ADVANCED(KEXIV2_INCLUDE_DIR KEXIV2_LIBRARIES)
+
+ endif(KEXIV2_LOCAL_FOUND)
diff -ruN kdelibs4.orig/files/patch-cmake_modules_FindKipi.cmake kdelibs4/files/patch-cmake_modules_FindKipi.cmake
--- kdelibs4.orig/files/patch-cmake_modules_FindKipi.cmake 2009-08-09 21:42:09.000000000 -0400
+++ kdelibs4/files/patch-cmake_modules_FindKipi.cmake 2009-08-10 02:43:33.000000000 -0400
@@ -1,11 +1,74 @@
--- ../cmake/modules/FindKipi.cmake.orig 2009-01-06 17:27:37.000000000 +0000
+++ ../cmake/modules/FindKipi.cmake 2009-01-25 08:35:05.000000000 +0000
-@@ -50,7 +50,7 @@
- # in the FIND_PATH() and FIND_LIBRARY() calls
- INCLUDE(UsePkgConfig)
+@@ -48,52 +48,29 @@
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+- INCLUDE(UsePkgConfig)
+-
- PKGCONFIG(libkipi _KIPIIncDir _KIPILinkDir _KIPILinkFlags _KIPICflags)
-+ PKGCONFIG(libkipi-kde4 _KIPIIncDir _KIPILinkDir _KIPILinkFlags _KIPICflags)
+-
+- if(_KIPILinkFlags)
+- # query pkg-config asking for a libkipi >= 0.2.0
+- exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkipi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+- if(_return_VALUE STREQUAL "0")
+- message(STATUS "Found libkipi release >= 0.2.0")
+- set(KIPI_VERSION_GOOD_FOUND TRUE)
+- else(_return_VALUE STREQUAL "0")
+- message(STATUS "Found libkipi release < 0.2.0, too old")
+- set(KIPI_VERSION_GOOD_FOUND FALSE)
+- set(KIPI_FOUND FALSE)
+- endif(_return_VALUE STREQUAL "0")
+- else(_KIPILinkFlags)
+- set(KIPI_VERSION_GOOD_FOUND FALSE)
+- set(KIPI_FOUND FALSE)
+- endif(_KIPILinkFlags)
++ include(FindPkgConfig)
++ pkg_check_modules(LIBKIPI libkipi-kde4>=0.2.0)
+ else(NOT WIN32)
+- set(KIPI_VERSION_GOOD_FOUND TRUE)
++ set(LIBKIPI_FOUND 1)
+ endif(NOT WIN32)
+- if(KIPI_VERSION_GOOD_FOUND)
+- set(KIPI_DEFINITIONS ${_KIPICflags})
+
+- find_path(KIPI_INCLUDE_DIR NAMES libkipi/version.h PATHS ${KDE4_INCLUDE_DIR} ${_KIPIIncDir})
+- find_library(KIPI_LIBRARIES NAMES kipi PATHS ${KDE4_LIB_DIR} ${_KIPILinkDir})
++ if(LIBKIPI_FOUND)
++ set(KIPI_DEFINITIONS ${LIBKIPI_CFLAGS})
+
+- if (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
+- set(KIPI_FOUND TRUE)
+- endif (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
+- endif(KIPI_VERSION_GOOD_FOUND)
+- if (KIPI_FOUND)
+- if (NOT Kipi_FIND_QUIETLY)
+- message(STATUS "Found libkipi: ${KIPI_LIBRARIES}")
+- endif (NOT Kipi_FIND_QUIETLY)
+- else (KIPI_FOUND)
+- if (Kipi_FIND_REQUIRED)
+- if (NOT KIPI_INCLUDE_DIR)
+- message(FATAL_ERROR "Could NOT find libkipi header files")
+- endif (NOT KIPI_INCLUDE_DIR)
+- if (NOT KIPI_LIBRARIES)
+- message(FATAL_ERROR "Could NOT find libkipi library")
+- endif (NOT KIPI_LIBRARIES)
+- endif (Kipi_FIND_REQUIRED)
+- endif (KIPI_FOUND)
++ find_path(KIPI_INCLUDE_DIR NAMES libkipi/version.h
++ PATHS ${LIBKIPI_INCLUDE_DIRS} ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH
++ )
++ find_library(KIPI_LIBRARY NAMES kipi
++ PATHS ${LIBKIPI_LIBRARY_DIRS} ${KDE4_LIB_DIR} NO_DEFAULT_PATH
++ )
++ endif(LIBKIPI_FOUND)
++
++ include(FindPackageHandleStandardArgs)
++ find_package_handle_standard_args(Kipi DEFAULT_MSG KIPI_LIBRARY KIPI_INCLUDE_DIR)
++
++ if(KIPI_FOUND)
++ set(KIPI_LIBRARIES ${KIPI_LIBRARY})
++ endif(KIPI_FOUND)
+
+ MARK_AS_ADVANCED(KIPI_INCLUDE_DIR KIPI_LIBRARIES)
- if(_KIPILinkFlags)
- # query pkg-config asking for a libkipi >= 0.2.0
--- 2009-08-09-kdelibs4.diff ends here ---
More information about the kde-freebsd
mailing list