Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Mar 2016 15:14:36 +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: r410702 - in head: audio/tomahawk/files x11-toolkits/attica
Message-ID:  <201603091514.u29FEaUt054232@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rakuco
Date: Wed Mar  9 15:14:35 2016
New Revision: 410702
URL: https://svnweb.freebsd.org/changeset/ports/410702

Log:
  x11-toolkits/attica: Change the location where we install its headers.
  
  In preparation for the upcoming KDE Frameworks 5 and Plasma 5 ports, install
  attica's headers into include/attica/attica instead of include/attica.
  
  Users of attica reference the headers in the code with
      #include <attica/foo.h>
  which means the compiler is passed -I${LOCALBASE}/include for the headers to
  be found.
  
  The KDE Frameworks 5 version of attica installs the headers into
  include/KF5/attica, so depending on the other of the arguments the compiler
  can end up being passed
      -I${LOCALBASE}/include -I${LOCALBASE}/include/KF5
  leading to the wrong attica headers being used instead.
  
  By changing the header location, we make sure one passes
  -I${LOCALBASE}/include/attica to use the attica 0.4.2 headers.
  
  The original idea and code came from Tobias Berner <tcberner@gmail.com>,
  with further improvements from myself.
  
  While here, add some comments explaining why some sed calls are made in the
  post-patch target.
  
  Last but not least, audio/tomahawk had to be patched for the attica headers
  to be properly found now that they are no longer in ${LOCALBASE}/include.
  The patch itself contains a larger explanation of what had to be done. All
  other ports depending on x11-toolkits/attica work fine without any changes.
  
  Submitted by:	Tobias Berner <tcberner@gmail.com> (original version)

Added:
  head/audio/tomahawk/files/patch-src_libtomahawk_CMakeLists.txt   (contents, props changed)
Modified:
  head/x11-toolkits/attica/Makefile
  head/x11-toolkits/attica/pkg-plist

Added: head/audio/tomahawk/files/patch-src_libtomahawk_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/tomahawk/files/patch-src_libtomahawk_CMakeLists.txt	Wed Mar  9 15:14:35 2016	(r410702)
@@ -0,0 +1,21 @@
+Make sure targets depending on tomahawklib also include LIBATTICA_INCLUDE_DIR.
+
+If x11-toolkits/attica is not installed in a location such as
+${LOCALBASE}/include, we risk breaking the build like this:
+
+  In file included from /wrkdirs/usr/ports/audio/tomahawk/work/tomahawk-0.8.4/src/infoplugins/generic/charts/ChartsPlugin.cpp:29:
+  In file included from /wrkdirs/usr/ports/audio/tomahawk/work/tomahawk-0.8.4/src/libtomahawk/TomahawkSettings.h:28:
+  /wrkdirs/usr/ports/audio/tomahawk/work/tomahawk-0.8.4/src/libtomahawk/AtticaManager.h:30:10: fatal error: 'attica/provider.h' file not found
+  #include <attica/provider.h>
+--- src/libtomahawk/CMakeLists.txt.orig	2015-04-15 04:41:40 UTC
++++ src/libtomahawk/CMakeLists.txt
+@@ -488,6 +488,9 @@ set_target_properties(
+             OUTPUT_NAME "tomahawk"
+ )
+ 
++if(LIBATTICA_FOUND)
++    TARGET_INCLUDE_DIRECTORIES(tomahawklib INTERFACE ${LIBATTICA_INCLUDE_DIR})
++endif(LIBATTICA_FOUND)
+ 
+ qt5_use_modules(tomahawklib Widgets Network Sql WebKitWidgets Concurrent Xml UiTools Svg)
+ 

Modified: head/x11-toolkits/attica/Makefile
==============================================================================
--- head/x11-toolkits/attica/Makefile	Wed Mar  9 14:33:56 2016	(r410701)
+++ head/x11-toolkits/attica/Makefile	Wed Mar  9 15:14:35 2016	(r410702)
@@ -3,6 +3,7 @@
 
 PORTNAME=	attica
 PORTVERSION=	0.4.2
+PORTREVISION=	1
 PORTEPOCH=	2
 CATEGORIES=	x11-toolkits
 MASTER_SITES=	KDE/stable/${PORTNAME}
@@ -18,9 +19,22 @@ CMAKE_ARGS=	-DATTICA_ENABLE_TESTS:BOOL=O
 		-DQT4_BUILD:BOOL=ON
 
 post-patch:
+# LIB_DESTINATION is not caught by USES=pathfix.
 	${REINPLACE_CMD} \
 		-e 's,$${LIB_DESTINATION}/pkgconfig,libdata/pkgconfig,' \
+		${WRKSRC}/lib/CMakeLists.txt
+# By default attica will produce libattica.0.4.so but not libattica.0.so.
+	${REINPLACE_CMD} \
 		-e 's,.$${CMAKE_LIBATTICA_VERSION_MINOR},,' \
 		${WRKSRC}/lib/CMakeLists.txt
+# Install headers into a subdirectory of ${LOCALBASE}/include so that passing
+# -I${LOCALBASE}/include does not cause it to be preferred over the KF5 version
+# installed into ${LOCALBASE}/include/KF5.
+	${REINPLACE_CMD} \
+                -e "s,include/attica,include/attica/attica," \
+		${WRKSRC}/lib/CMakeLists.txt
+	${REINPLACE_CMD} \
+		-e "s,/include,/include/attica," \
+		${WRKSRC}/lib/cmake/libattica.pc.cmake
 
 .include <bsd.port.mk>

Modified: head/x11-toolkits/attica/pkg-plist
==============================================================================
--- head/x11-toolkits/attica/pkg-plist	Wed Mar  9 14:33:56 2016	(r410701)
+++ head/x11-toolkits/attica/pkg-plist	Wed Mar  9 15:14:35 2016	(r410702)
@@ -1,46 +1,46 @@
-include/attica/accountbalance.h
-include/attica/achievement.h
-include/attica/activity.h
-include/attica/atticabasejob.h
-include/attica/atticaclient_export.h
-include/attica/atticautils.h
-include/attica/buildservice.h
-include/attica/buildservicejob.h
-include/attica/buildservicejoboutput.h
-include/attica/category.h
-include/attica/comment.h
-include/attica/content.h
-include/attica/deletejob.h
-include/attica/distribution.h
-include/attica/downloaddescription.h
-include/attica/downloaditem.h
-include/attica/event.h
-include/attica/folder.h
-include/attica/forum.h
-include/attica/getjob.h
-include/attica/homepageentry.h
-include/attica/homepagetype.h
-include/attica/icon.h
-include/attica/itemjob.h
-include/attica/knowledgebaseentry.h
-include/attica/license.h
-include/attica/listjob.h
-include/attica/message.h
-include/attica/metadata.h
-include/attica/person.h
-include/attica/platformdependent.h
-include/attica/platformdependent_v2.h
-include/attica/postjob.h
-include/attica/privatedata.h
-include/attica/project.h
-include/attica/provider.h
-include/attica/providermanager.h
-include/attica/publisher.h
-include/attica/publisherfield.h
-include/attica/putjob.h
-include/attica/remoteaccount.h
-include/attica/topic.h
-include/attica/version.h
+include/attica/attica/accountbalance.h
+include/attica/attica/achievement.h
+include/attica/attica/activity.h
+include/attica/attica/atticabasejob.h
+include/attica/attica/atticaclient_export.h
+include/attica/attica/atticautils.h
+include/attica/attica/buildservice.h
+include/attica/attica/buildservicejob.h
+include/attica/attica/buildservicejoboutput.h
+include/attica/attica/category.h
+include/attica/attica/comment.h
+include/attica/attica/content.h
+include/attica/attica/deletejob.h
+include/attica/attica/distribution.h
+include/attica/attica/downloaddescription.h
+include/attica/attica/downloaditem.h
+include/attica/attica/event.h
+include/attica/attica/folder.h
+include/attica/attica/forum.h
+include/attica/attica/getjob.h
+include/attica/attica/homepageentry.h
+include/attica/attica/homepagetype.h
+include/attica/attica/icon.h
+include/attica/attica/itemjob.h
+include/attica/attica/knowledgebaseentry.h
+include/attica/attica/license.h
+include/attica/attica/listjob.h
+include/attica/attica/message.h
+include/attica/attica/metadata.h
+include/attica/attica/person.h
+include/attica/attica/platformdependent.h
+include/attica/attica/platformdependent_v2.h
+include/attica/attica/postjob.h
+include/attica/attica/privatedata.h
+include/attica/attica/project.h
+include/attica/attica/provider.h
+include/attica/attica/providermanager.h
+include/attica/attica/publisher.h
+include/attica/attica/publisherfield.h
+include/attica/attica/putjob.h
+include/attica/attica/remoteaccount.h
+include/attica/attica/topic.h
+include/attica/attica/version.h
 lib/libattica.so
 lib/libattica.so.0
 lib/libattica.so.0.4.2



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