freebsd-ports/graphics/poppler/Makefile
Tobias C. Berner f3c180c343 Update Qt5 to 5.7.1, and unify the Qt4 and Qt5 ports some more
* Update Qt5 to 5.7.1
* Move Qt4 binaries to lib/qt4/bin
* Move Qt5 libraries to lib/qt5/lib
  By moving the libraries we should finally be able to get rid of the inplace
  upgrade bug (see ports bugs 194088, 195105 and 198720):  when Qt5's libraries
  were lying in /usr/local/lib, which would often get added by pkgconfig to the
  linker paths via dependencies, the already installed libraries were linked
  against, instead of the ones that were being built. This forced us to make
  sure, that -L${WRKSRC}/lib was always coming before -L/usr/local/lib in the
  linker flags. With this change this should no longer be the case.
* Rename some ports to match the rest (foo-qtX -> qtX-foo)
* Depend on new port misc/qtchooser [see UPDATING & CHANGES]

There are several new Qt5 ports which all have been created by Marie Loise Nolden
<nolden@kde.org>. Thanks again.

PR:		216797
Exp-Run by:	antoine
Reviewed by:	rakuco, mat, groot_kde.org
Approved by:	rakuco (mentor)
Differential Revision:	https://reviews.freebsd.org/D9213
2017-02-18 19:48:05 +00:00

142 lines
3.3 KiB
Makefile

# Created by: marcus@FreeBSD.org
# $FreeBSD$
PORTNAME= poppler
PORTVERSION= 0.50.0
CATEGORIES= graphics print
MASTER_SITES= http://poppler.freedesktop.org/
MAINTAINER?= gnome@FreeBSD.org
COMMENT?= PDF rendering library
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libpng.so:graphics/png \
libtiff.so:graphics/tiff \
libfontconfig.so:x11-fonts/fontconfig \
liblcms2.so:graphics/lcms2 \
libfreetype.so:print/freetype2 \
libnss3.so:security/nss \
libnspr4.so:devel/nspr
RUN_DEPENDS= poppler-data>0:graphics/poppler-data
USES= cpe gmake jpeg libtool localbase pathfix pkgconfig tar:xz
CPE_VENDOR= freedesktop
USE_GNOME= libxml2
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
CONFIGURE_ARGS= --enable-zlib \
--enable-xpdf-headers \
--disable-libnss \
--disable-gtk-test \
--without-html-dir \
--disable-static \
--enable-libnss
INSTALL_TARGET= install-strip
.if !defined(SLAVEPORT)
PORTSCOUT= limitw:1,even
OPTIONS_DEFINE= CAIRO CURL OPENJPEG
OPTIONS_DEFAULT=CAIRO OPENJPEG
USES+= iconv
.endif
.include <bsd.port.options.mk>
.if defined(SLAVEPORT)
PORTSCOUT= ignore:1
LIB_DEPENDS+= libpoppler.so:graphics/poppler
.if ${SLAVEPORT}==glib
CONFIGURE_ARGS+=--enable-poppler-glib --enable-introspection=yes
USE_GNOME+= cairo glib20 introspection:build
BUILD_WRKSRC= ${WRKSRC}/glib
INSTALL_WRKSRC= ${WRKSRC}/glib
.else
CONFIGURE_ARGS+=--disable-poppler-glib
.endif
.if ${SLAVEPORT}==qt4
CONFIGURE_ARGS+=--enable-poppler-qt4
CONFIGURE_ENV+= MOCQT4=${MOC}
USE_QT4= gui corelib xml qtestlib moc_build
BUILD_WRKSRC= ${WRKSRC}/qt4
INSTALL_WRKSRC= ${WRKSRC}/qt4
.else
CONFIGURE_ARGS+=--disable-poppler-qt4
.endif
.if ${SLAVEPORT}==qt5
CONFIGURE_ARGS+=--enable-poppler-qt5
CONFIGURE_ENV+= MOCQT5=${MOC}
USE_QT5= core gui widgets xml buildtools_build testlib_build
# Qt from 5.7.0 on requires c++11.
USE_CXXSTD= c++11
BUILD_WRKSRC= ${WRKSRC}/qt5
INSTALL_WRKSRC= ${WRKSRC}/qt5
.else
CONFIGURE_ARGS+=--disable-poppler-qt5
.endif
.if ${SLAVEPORT}==utils
LIB_DEPENDS+= libpoppler-glib.so:graphics/poppler-glib
CONFIGURE_ARGS+=--enable-utils
BUILD_WRKSRC= ${WRKSRC}/utils
INSTALL_WRKSRC= ${WRKSRC}/utils
.else
CONFIGURE_ARGS+=--disable-utils
.endif
.else # ! SLAVE options below
CONFIGURE_ARGS+=--disable-poppler-glib \
--disable-poppler-qt4 \
--disable-poppler-qt5 \
--disable-utils
.if ${PORT_OPTIONS:MCAIRO}
LIB_DEPENDS+= libcairo.so:graphics/cairo
PLIST_SUB+= CAIRO=""
.else
CONFIGURE_ARGS+=--disable-cairo-output
PLIST_SUB+= CAIRO="@comment "
.endif
.if ${PORT_OPTIONS:MCURL}
LIB_DEPENDS+= libcurl.so:ftp/curl
CONFIGURE_ARGS+=--enable-libcurl
PLIST_SUB+= CURL=""
.else
CONFIGURE_ARGS+=--disable-libcurl
PLIST_SUB+= CURL="@comment "
.endif
.if ${PORT_OPTIONS:MOPENJPEG}
CONFIGURE_ARGS+=--enable-libopenjpeg=openjpeg2
LIB_DEPENDS+= libopenjp2.so:graphics/openjpeg
.else
CONFIGURE_ARGS+=--disable-libopenjpeg
.endif
.endif # end of options
post-patch:
@${REINPLACE_CMD} -e 's|-fno-check-new||g' ${WRKSRC}/configure
post-install:
.if defined(SLAVEPORT)
. if ${SLAVEPORT}==glib
${INSTALL_DATA} ${WRKSRC}/poppler-glib.pc \
${STAGEDIR}${PREFIX}/libdata/pkgconfig
. elif ${SLAVEPORT}==qt4
${INSTALL_DATA} ${WRKSRC}/poppler-qt4.pc \
${STAGEDIR}${PREFIX}/libdata/pkgconfig
. elif ${SLAVEPORT}==qt5
${INSTALL_DATA} ${WRKSRC}/poppler-qt5.pc \
${STAGEDIR}${PREFIX}/libdata/pkgconfig
. endif
.endif
.include <bsd.port.mk>