Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2017 09:05:39 +0000 (UTC)
From:      Raphael Kubo da Costa <rakuco@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r437106 - in head/graphics: digikam-kde4 kipi-plugin-ipodexport/files kipi-plugins-kde4/files
Message-ID:  <201703280905.v2S95dXX083469@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rakuco
Date: Tue Mar 28 09:05:39 2017
New Revision: 437106
URL: https://svnweb.freebsd.org/changeset/ports/437106

Log:
  Unbreak kipi-plugin-* after r436971.
  
  The kipi-plugin-* ports are all built from the same tarball, which is also used
  to build kipi-plugins-kde4 as well.
  
  Upstream does not expect this to happen, and refers to libkipiplugins.so as the
  "kipiplugins" target in CMake. Since we build everything separately, each
  plugin's build system code does not know this target, which results in
  -lkipiplugins (without -L/path/to) being passed to the linker instead of
  /path/to/libkipiplugins.so.
  
  Fix it by looking for libkipiplugins.so via CMake and using that result in each
  port.
  
  kipi-plugin-ipodexport needs an additional but similar fix, in that it should
  look for libgpod using CMake instead of using pkg-config's results directly, as
  the latter do not contain full paths.
  
  Reviewed by:	tcberner

Added:
  head/graphics/kipi-plugin-ipodexport/files/
  head/graphics/kipi-plugin-ipodexport/files/patch-cmake_modules_FindIpod.cmake   (contents, props changed)
Modified:
  head/graphics/digikam-kde4/Makefile.common
  head/graphics/kipi-plugins-kde4/files/extrapatch-CMakeLists.txt

Modified: head/graphics/digikam-kde4/Makefile.common
==============================================================================
--- head/graphics/digikam-kde4/Makefile.common	Tue Mar 28 09:02:02 2017	(r437105)
+++ head/graphics/digikam-kde4/Makefile.common	Tue Mar 28 09:05:39 2017	(r437106)
@@ -144,5 +144,20 @@ BUILD_WRKSRC=	${WRKSRC}/${${KIPI_PLUGIN}
 INSTALL_WRKSRC=	${BUILD_WRKSRC}
 
 ${KIPI_PLUGIN}_DIR?=		${KIPI_PLUGIN}
+
+.if ${KIPI_PLUGIN} != "libkipiplugins"
+# Each plugin is built separately from the same tarball. The upstream build
+# process expects a single build for all plugins, which includes building
+# libkipiplugins itself.
+# Adjust it (together with extrapatch-CMakeLists.txt in
+# graphics/kipi-plugins-kde4) by actually looking for libkipiplugins with
+# find_library() and linking against it instead of ending up just passing
+# "-lkipiplugins" to the linker because of the way we build these ports.
+post-patch: kipi-plugin-post-patch
+kipi-plugin-post-patch:
+	${FIND} ${BUILD_WRKSRC} -name CMakeLists.txt | ${XARGS} ${REINPLACE_CMD} -e \
+		's, kipiplugins, $${LIBKIPIPLUGINS_LIBRARIES},' \
+		${BUILD_WRKSRC}/CMakeLists.txt
+.endif
 . endif # defined(KIPI_PLUGIN)
 .endif # !defined(NO_BUILD)

Added: head/graphics/kipi-plugin-ipodexport/files/patch-cmake_modules_FindIpod.cmake
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/kipi-plugin-ipodexport/files/patch-cmake_modules_FindIpod.cmake	Tue Mar 28 09:05:39 2017	(r437106)
@@ -0,0 +1,26 @@
+Always look for libgpod using CMake instead of just using the pkg-config call
+directly, as the latter does not use full paths.
+--- cmake/modules/FindIpod.cmake
++++ cmake/modules/FindIpod.cmake
+@@ -14,12 +14,6 @@ if (IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
+   SET(IPOD_FOUND TRUE)
+ 
+ else (IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
+-  if(NOT WIN32)
+-    # use pkg-config to get the directories and then use these values
+-    # in the FIND_PATH() and FIND_LIBRARY() calls
+-    find_package(PkgConfig)
+-    PKG_SEARCH_MODULE(IPOD libgpod-1.0)
+-  else(NOT WIN32)
+     find_path(IPOD_INCLUDE_DIRS
+     NAMES
+     gpod/itdb.h
+@@ -32,7 +26,7 @@ else (IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
+     if(IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
+        set(IPOD_FOUND ON)
+     endif(IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
+-  endif(NOT WIN32)
++
+   IF (IPOD_FOUND)
+      IF (NOT IPOD_FIND_QUIETLY)
+         MESSAGE(STATUS "Found libgpod-1 ${IPOD_VERSION}")

Modified: head/graphics/kipi-plugins-kde4/files/extrapatch-CMakeLists.txt
==============================================================================
--- head/graphics/kipi-plugins-kde4/files/extrapatch-CMakeLists.txt	Tue Mar 28 09:02:02 2017	(r437105)
+++ head/graphics/kipi-plugins-kde4/files/extrapatch-CMakeLists.txt	Tue Mar 28 09:05:39 2017	(r437106)
@@ -1,10 +1,15 @@
+The first hunk looks for libkipiplugins via CMake, as we split every kipi
+plugin as well as the common code into separate ports. Not using CMake results
+in "kipiplugins" in a target_link_libraries() call becoming a literal
+-lkipiplugins being passed to the linker instead of /path/to/libkipiplugin.so.
 --- ./CMakeLists.txt.orig	2015-02-25 22:15:14.659030000 +0100
 +++ ./CMakeLists.txt	2015-02-25 22:17:07.071209000 +0100
-@@ -356,7 +356,6 @@
+@@ -391,7 +391,7 @@ if(KIPI_FOUND)
  
          # Plugins which will be always compiled
  
 -        add_subdirectory(common)
++        find_library(LIBKIPIPLUGINS_LIBRARIES kipiplugins)
          add_subdirectory(timeadjust)
          add_subdirectory(jpeglossless)
          add_subdirectory(rawconverter)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703280905.v2S95dXX083469>