freebsd-ports/x11-toolkits/attica/Makefile
Raphael Kubo da Costa 87c262ff1c 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)
2016-03-09 15:14:35 +00:00

40 lines
1.2 KiB
Makefile

# Created by: Dima Panov <fluffy@FreeBSD.org>
# $FreeBSD$
PORTNAME= attica
PORTVERSION= 0.4.2
PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= x11-toolkits
MASTER_SITES= KDE/stable/${PORTNAME}
MAINTAINER= kde@FreeBSD.org
COMMENT= Open Collaboration Services API library
USE_QT4= network qtestlib_build xml \
moc_build qmake_build rcc_build uic_build
USE_LDCONFIG= yes
USES= cmake:outsource tar:bzip2
CMAKE_ARGS= -DATTICA_ENABLE_TESTS:BOOL=OFF \
-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>