[kde-freebsd] ports/134230: graphics/digikam-kde4 does not build from ports

Jason E. Hale bsdkaffee at gmail.com
Fri Jun 5 03:27:21 CEST 2009


The build problem in this PR is caused by QT3 style headers in certain files.
I added a replacement list to fix those headers.

While I was fixing this, I discovered that if KDE3 versions of kipi, kdcraw, or
kexiv2 were installed, the KDE3 version would be picked up instead of the
KDE4 version.  This is because CMake looks in the system paths first and
uses that library even if pkg-config is specifically telling it to use the KDE4
one.  My patch uses the newer pkg-config module and disables the default
path.

I also turned the optional requirements into OPTIONS since not specifically
disabling them or specifically making them dependencies will cause
problems if they are linked to but then deinstalled.  I tested all OPTIONS
and no additional files are installed.

Misc: depend on pkg-config, add more QT_COMPONENTS that digikam
links to, remove share/apps/solid/actions from pkg-plist since it is in kdehier

--- 2009-06-04-digikam-kde4.diff begins here ---
diff -ruN digikam-kde4.orig/Makefile digikam-kde4/Makefile
--- digikam-kde4.orig/Makefile	2009-06-04 05:29:52.000000000 -0400
+++ digikam-kde4/Makefile	2009-06-04 20:43:53.000000000 -0400
@@ -7,7 +7,7 @@
 
 PORTNAME=	digikam
 PORTVERSION=	0.10.0
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	graphics kde
 MASTER_SITES=	SFE
@@ -16,7 +16,6 @@
 COMMENT=	An advanced digital photo management application for KDE4
 
 LIB_DEPENDS=	tiff.4:${PORTSDIR}/graphics/tiff \
-		gphoto2.2:${PORTSDIR}/graphics/libgphoto2 \
 		lcms.1:${PORTSDIR}/graphics/lcms \
 		png.5:${PORTSDIR}/graphics/png \
 		jasper.4:${PORTSDIR}/graphics/jasper \
@@ -25,13 +24,50 @@
 LATEST_LINK=	${PORTNAME}-kde4
 
 USE_BZIP2=	yes
-USE_KDE4=	automoc4 kdehier kdeprefix kdelibs pimlibs
+USE_KDE4=	automoc4 kdehier kdeprefix kdelibs
 USE_QT_VER=	4
-QT_COMPONENTS=	corelib gui sql qmake_build moc_build rcc_build uic_build
+QT_COMPONENTS=	gui dbus network qt3support sql svg xml \
+		qmake_build moc_build rcc_build uic_build
+USE_GNOME=	pkgconfig
 USE_CMAKE=	yes
 USE_GETTEXT=	yes
 USE_LDCONFIG=	yes
 
 MAN1=		digitaglinktree.1
 
-.include <bsd.port.mk>
+OPTIONS=	GPHOTO2 "Compile with gphoto2 support" on \
+		LENSFUN "Compile lens auto-correction image editor plugin" off \
+		MARBLE "Geolocation support (requires misc/kdeedu4)" off \
+		PIMLIBS "Address book support" on
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITHOUT_GPHOTO2)
+CMAKE_ARGS+=	-DENABLE_GPHOTO2:BOOL=OFF
+.else
+LIB_DEPENDS+=	gphoto2.2:${PORTSDIR}/graphics/libgphoto2
+.endif
+
+.if defined(WITH_LENSFUN)
+LIB_DEPENDS+=	lensfun.0:${PORTSDIR}/graphics/lensfun
+.else
+CMAKE_ARGS+=	-DWITH_LensFun:BOOL=OFF
+.endif
+
+.if defined(WITH_MARBLE)
+LIB_DEPENDS+=	marblewidget.5:${PORTSDIR}/misc/kdeedu4
+.else
+CMAKE_ARGS+=	-DWITH_MarbleWidget:BOOL=OFF
+.endif
+
+.if defined(WITHOUT_PIMLIBS)
+CMAKE_ARGS+=	-DWITH_KdepimLibs:BOOL=OFF
+.else
+USE_KDE4+=	pimlibs
+.endif
+
+post-patch:
+	${GREP} -H -r "#include <q" ${WRKSRC} | ${CUT} -d: -f1 | uniq | \
+		${XARGS} ${REINPLACE_CMD} -f ${FILESDIR}/qt3to4headers.txt
+
+.include <bsd.port.post.mk>
diff -ruN digikam-kde4.orig/files/patch-CMakeLists.txt digikam-kde4/files/patch-CMakeLists.txt
--- digikam-kde4.orig/files/patch-CMakeLists.txt	2009-06-04 05:29:52.000000000 -0400
+++ digikam-kde4/files/patch-CMakeLists.txt	2009-06-04 16:40:17.000000000 -0400
@@ -1,6 +1,6 @@
---- CMakeLists.txt.orig	2009-01-21 12:32:12.000000000 -0600
-+++ CMakeLists.txt	2009-01-27 21:31:03.000000000 -0600
-@@ -45,39 +45,126 @@
+--- ./CMakeLists.txt.orig	2009-03-16 11:39:44.000000000 -0400
++++ ./CMakeLists.txt	2009-06-04 16:40:10.000000000 -0400
+@@ -45,39 +45,55 @@
  MACRO_OPTIONAL_FIND_PACKAGE(PNG)
  MACRO_OPTIONAL_FIND_PACKAGE(TIFF)
  MACRO_OPTIONAL_FIND_PACKAGE(Jasper)
@@ -24,7 +24,14 @@
 -ELSE(NOT WIN32)
 -    SET(KDCRAW_FOR_DIGIKAM TRUE)
 -ENDIF(NOT WIN32)
--
++INCLUDE(FindPkgConfig)
++# Check for KExiv2
++PKG_CHECK_MODULES(LIBKEXIV2 libkexiv2-kde4>=0.5.0)
++FIND_PATH(KEXIV2_INCLUDE_DIR NAMES libkexiv2/version.h
++  PATHS ${LIBKEXIV2_INCLUDE_DIRS} ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH)
++FIND_LIBRARY(KEXIV2_LIBRARY NAMES kexiv2
++  PATHS ${LIBKEXIV2_LIBRARY_DIRS} ${KDE4_LIB_DIR} NO_DEFAULT_PATH)
+ 
 -# Check KExiv2 version installed to compile fine.
 -IF(NOT WIN32)
 -    FIND_PACKAGE(PkgConfig)
@@ -37,121 +44,42 @@
 -ELSE(NOT WIN32)
 -    SET(KEXIV2_FOR_DIGIKAM TRUE)
 -ENDIF(NOT WIN32)
-+# use pkg-config to get the directories and then use these values
-+# in the FIND_PATH() and FIND_LIBRARY() calls
-+INCLUDE(UsePkgConfig)
-+
-+message(STATUS "Check Kexiv2 library using pkg-config...")
-+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-kde4 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE 
_pkgconfigDevNull)
-+  if(_return_VALUE STREQUAL "0")
-+    message(STATUS "Found libkexiv2 release >= 0.2.0")
-+    set(KEXIV2_FOR_DIGIKAM TRUE)
-+  else(_return_VALUE STREQUAL "0")
-+    message(STATUS "Found libkexiv2 release < 0.2.0, too old")
-+    set(KEXIV2_FOR_DIGIKAM FALSE)
-+    set(KEXIV2_FOUND FALSE)
-+  endif(_return_VALUE STREQUAL "0")
-+else(_KEXIV2LinkFlags)
-+  set(KEXIV2_FOR_DIGIKAM FALSE)
-+  set(KEXIV2_FOUND FALSE)
-+endif(_KEXIV2LinkFlags)
-+if(KEXIV2_FOR_DIGIKAM)
-+  set(KEXIV2_DEFINITIONS "${_KEXIV2Cflags}")
-+  FIND_PATH(KEXIV2_INCLUDE_DIR libkexiv2/version.h ${_KEXIV2IncDir})
-+  FIND_LIBRARY(KEXIV2_LIBRARIES NAMES kexiv2 PATHS ${_KEXIV2LinkDir})
-+  if(KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES)
-+    set(KEXIV2_FOUND TRUE)
-+  endif(KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES)
-+endif(KEXIV2_FOR_DIGIKAM)
-+if(KEXIV2_FOUND)
-+  message(STATUS "Found libkexiv2: ${KEXIV2_LIBRARIES}")
-+else(KEXIV2_FOUND)
-+  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_FOUND)
-+MARK_AS_ADVANCED(KEXIV2_INCLUDE_DIR KEXIV2_LIBRARIES)
-+
-+message(STATUS "Check Kdcraw library using pkg-config...")
-+PKGCONFIG(libkdcraw-kde4 _KDCRAWIncDir _KDCRAWLinkDir _KDCRAWLinkFlags _KDCRAWCflags) 
-+if(_KDCRAWLinkFlags)
-+  # query pkg-config asking for a libkdcraw >= 0.4.0
-+  EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.4.0 libkdcraw-kde4 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE 
_pkgconfigDevNull)
-+  if(_return_VALUE STREQUAL "0")
-+    message(STATUS "Found libkdcraw release >= 0.4.0")
-+    set(KDCRAW_FOR_DIGIKAM TRUE)
-+  else(_return_VALUE STREQUAL "0")
-+    message(STATUS "Found libkdcraw release < 0.4.0, too old")
-+    set(KDCRAW_FOR_DIGIKAM FALSE)
-+    set(KDCRAW_FOUND FALSE)
-+  endif(_return_VALUE STREQUAL "0")
-+else(_KDCRAWLinkFlags)
-+  set(KDCRAW_FOR_DIGIKAM FALSE)
-+  set(KDCRAW_FOUND FALSE)
-+endif(_KDCRAWLinkFlags)
-+if(KDCRAW_FOR_DIGIKAM)
-+  set(KDCRAW_DEFINITIONS "${_KDCRAWCflags}")
-+  FIND_PATH(KDCRAW_INCLUDE_DIR libkdcraw/version.h ${_KDCRAWIncDir})
-+  FIND_LIBRARY(KDCRAW_LIBRARIES NAMES kdcraw PATHS ${_KDCRAWLinkDir})
-+  if(KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES)
-+    set(KDCRAW_FOUND TRUE)
-+  endif(KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES)
-+endif(KDCRAW_FOR_DIGIKAM)
-+if(KDCRAW_FOUND)
-+  message(STATUS "Found libkdcraw: ${KDCRAW_LIBRARIES}")
-+else(KDCRAW_FOUND)
-+  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_FOUND)
-+MARK_AS_ADVANCED(KDCRAW_INCLUDE_DIR KDCRAW_LIBRARIES)
-+
-+# Check Kipi version installed to compile fine.
-+message(STATUS "Check Kipi library using pkg-config...")
-+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-kde4 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE 
_pkgconfigDevNull)
-+  if(_return_VALUE STREQUAL "0")
-+    message(STATUS "Found libkipi release >= 0.2.0")
-+    set(KIPI_FOR_DIGIKAM TRUE)
-+  else(_return_VALUE STREQUAL "0")
-+    message(STATUS "Found libkipi release < 0.2.0, too old")
-+    set(KIPI_FOR_DIGIKAM FALSE)
-+    set(KIPI_FOUND FALSE)
-+  endif(_return_VALUE STREQUAL "0")
-+else(_KIPILinkFlags)
-+  set(KIPI_FOR_DIGIKAM FALSE)
-+  set(KIPI_FOUND FALSE)
-+endif(_KIPILinkFlags)
-+if(KIPI_FOR_DIGIKAM)
-+  set(KIPI_DEFINITIONS "${_KIPICflags}")
-+  FIND_PATH(KIPI_INCLUDE_DIR libkipi/version.h ${_KIPIIncDir})
-+  FIND_LIBRARY(KIPI_LIBRARIES NAMES kipi PATHS ${_KIPILinkDir})
-+  if(KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
-+    set(KIPI_FOUND TRUE)
-+  endif(KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
-+endif(KIPI_FOR_DIGIKAM)
-+if(KIPI_FOUND)
-+  message(STATUS "Found libkipi: ${KIPI_LIBRARIES}")
-+else(KIPI_FOUND)
-+  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_FOUND)
-+MARK_AS_ADVANCED(KIPI_INCLUDE_DIR KIPI_LIBRARIES)
++INCLUDE(FindPackageHandleStandardArgs)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(KEXIV2 DEFAULT_MSG KEXIV2_LIBRARY KEXIV2_INCLUDE_DIR)
++
++IF(KEXIV2_FOUND)
++  SET(KEXIV2_LIBRARIES ${KEXIV2_LIBRARY})
++  SET(KEXIV2_FOR_DIGIKAM TRUE)
++ENDIF(KEXIV2_FOUND)
++
++# Check for Kdcraw
++PKG_CHECK_MODULES(LIBKDCRAW libkdcraw-kde4>=0.4.0)
++FIND_PATH(KDCRAW_INCLUDE_DIR NAMES libkdcraw/version.h
++  PATHS ${LIBKDCRAW_INCLUDE_DIRS} ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH)
++FIND_LIBRARY(KDCRAW_LIBRARY NAMES kdcraw
++  PATHS ${LIBKDCRAW_LIBRARY_DIRS} ${KDE4_LIB_DIR} NO_DEFAULT_PATH)
++
++INCLUDE(FindPackageHandleStandardArgs)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(KDCRAW DEFAULT_MSG KDCRAW_LIBRARY KDCRAW_INCLUDE_DIR)
++
++IF(KDCRAW_FOUND)
++  SET(KDCRAW_LIBRARIES ${KDCRAW_LIBRARY})
++  SET(KDCRAW_FOR_DIGIKAM TRUE)
++ENDIF(KDCRAW_FOUND)
++
++# Check for Kipi
++PKG_CHECK_MODULES(LIBKIPI libkipi-kde4>=0.2.0)
++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)
++
++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)
  
  # ==================================================================================================
  # Optional depencies
diff -ruN digikam-kde4.orig/files/qt3to4headers.txt digikam-kde4/files/qt3to4headers.txt
--- digikam-kde4.orig/files/qt3to4headers.txt	1969-12-31 19:00:00.000000000 -0500
+++ digikam-kde4/files/qt3to4headers.txt	2009-06-04 05:44:55.000000000 -0400
@@ -0,0 +1,19 @@
+s/<qapplication.h>/<QApplication>/g
+s/<qbrush.h>/<QBrush>/g
+s/<qcolor.h>/<QColor>/g
+s/<qcoreapplication.h>/<QCoreApplication>/g
+s/<qdatastream.h>/<QDataStream>/g
+s/<qevent.h>/<QEvent>/g
+s/<qfileinfo.h>/<QFileInfo>/g
+s/<qfont.h>/<QFont>/g
+s/<qfontmetrics.h>/<QFontMetrics>/g
+s/<qimage.h>/<QImage>/g
+s/<qobject.h>/<QObject>/g
+s/<qpainter.h>/<QPainter>/g
+s/<qpen.h>/<QPen>/g
+s/<qpixmap.h>/<QPixmap>/g
+s/<qprogressbar.h>/<QProgressBar>/g
+s/<qrect.h>/<QRect>/g
+s/<qtimer.h>/<QTimer>/g
+s/<qtooltip.h>/<QToolTip>/g
+s/<qwidget.h>/<QWidget>/g
diff -ruN digikam-kde4.orig/pkg-plist digikam-kde4/pkg-plist
--- digikam-kde4.orig/pkg-plist	2009-06-04 05:29:52.000000000 -0400
+++ digikam-kde4/pkg-plist	2009-06-04 17:57:27.000000000 -0400
@@ -624,8 +624,6 @@
 share/locale/zh_TW/LC_MESSAGES/digikam.mo
 @dirrmtry share/locale/se/LC_MESSAGES
 @dirrmtry share/locale/se
- at dirrmtry share/apps/solid/actions
- at dirrmtry share/apps/solid
 @dirrm share/apps/showfoto/data
 @dirrm share/apps/showfoto
 @dirrm share/apps/digikam/utils
--- 2009-06-04-digikam-kde4.diff ends here ---


More information about the kde-freebsd mailing list