freebsd-ports/editors/ted/Makefile
Tijl Coosemans 074ea5282a converters/libiconv:
- Remove const qualifier from iconv(3) to match POSIX:
  http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html
- Patch iconv.h to expose more GNU extensions when LIBICONV_PLUG is
  defined because the base system iconv supports these extensions too.

Add/remove patches to/from ports to call iconv with non-const arguments.

This breaks some ports on FreeBSD 10 because base system iconv.h still has
the const qualifier.  Fix this by letting USES=iconv add a build dependency
on converters/libiconv so ports can use its iconv.h (with LIBICONV_PLUG
defined) instead of the base system iconv.h.

This exposed some ports that link with libiconv when it is available instead
of using libc iconv.  In these cases one of the following changes has been
made:
- patch configure scripts to test for libc iconv first
- add ac_cv_lib_iconv_libiconv=no or similar to CONFIGURE_ARGS to disable
  some configure tests
- converters/wkhtmltopdf: this includes Qt4 so add a patch from devel/qt4
- lang/gcc5-aux: respect CFLAGS and friends during configure such that
  LIBICONV_PLUG is defined in the iconv test, also switch to external
  gettext
- mail/gnarwl: replace patches with CPPFLAGS/LIBS
- multimedia/ffmpeg2theora: remove iconv test from SConstruct and use
  ICONV_LIB in port Makefile instead, also fix a bug in subtitles.c
- net-im/licq: finish conversion to cmake
- net-mgmt/bandwidthd, net-mgmt/icinga, net-mgmt/nagios, net-mgmt/nagios4:
  don't need iconv
- textproc/p5-XML-TinyXML: finish conversion to USES=perl5

Other changes:
- databases/qdbm and slaves: respect CFLAGS and friends, also enable bzip2
  and lzo support
- games/ldmud: respect CFLAGS and friends
- graphics/inventor: replace some patches with MAKE_ARGS/MAKE_ENV to respect
  CFLAGS and friends, also remove FreeBSD/alpha patch and add missing xorg
  dependencies

PR:		199099
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2015-04-15 08:20:27 +00:00

90 lines
2.6 KiB
Makefile

# Created by: Kris Kennaway <kris@FreeBSD.org>
# $FreeBSD$
PORTNAME= ted
PORTVERSION= 2.23
PORTREVISION= 3
CATEGORIES= editors
MASTER_SITES= ftp://ftp.nluug.nl/pub/editors/ted/ \
http://fossies.org/linux/misc/
EXTRACT_SUFX= .src.tar.gz
MAINTAINER= ports@FreeBSD.org
COMMENT= X11 based RTF editor
LICENSE= GPLv2
LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre \
libpng.so:${PORTSDIR}/graphics/png \
libtiff.so:${PORTSDIR}/graphics/tiff \
libpaper.so:${PORTSDIR}/print/libpaper
RUN_DEPENDS= gsfonts>0:${PORTSDIR}/print/gsfonts
OPTIONS_DEFINE= GTK2 DOCS
GTK2_DESC= Use GTK2 instead of MOTIF
WRKSRC= ${WRKDIR}/Ted-${PORTVERSION}
USE_XORG= xext xft
USES= iconv
USE_GHOSTSCRIPT_RUN= yes
GNU_CONFIGURE= yes
MAKE_ENV= DEF_AFMDIR="-DAFMDIR=\"\\\"${AFMDIR}/\\\"\"" \
DEF_INDDIR="-DINDDIR=\"\\\"${INDDIR}/\\\"\"" \
DEF_DOCUMENT_DIR="-DDOCUMENT_DIR=\"\\\"${DOCSDIR}/\\\"\"" \
DEF_PSSCRIPT_DIR="-DPSSCRIPT_DIR=\"\\\"${DATADIR}/\\\"\""
ALL_TARGET= compile.shared
CONFIGURE_ARGS= --datadir=${PREFIX}/share \
ac_iconv_includes=${LOCALBASE}/include
DATADIR= ${PREFIX}/share/Ted
DOCSDIR= ${PREFIX}/share/doc/Ted
AFMDIR= ${DATADIR}/afm
INDDIR= ${DATADIR}/dfa
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MGTK2}
USE_GNOME= gtk20
CONFIGURE_ARGS+=--with-GTK
.else
USES+= motif
CONFIGURE_ARGS+=--with-MOTIF
.endif
.include <bsd.port.pre.mk>
post-extract:
@cd ${WRKSRC}/tedPackage && ${TAR} xf TedDatadir.tar
@${INSTALL_SCRIPT} ${FILESDIR}/configure ${WRKSRC}
post-patch:
@${FIND} ${WRKSRC} -name "configure" -print0 | ${XARGS} -0 \
${REINPLACE_CMD} -e \
's|/usr/X11R6|${LOCALBASE}|g ; \
s|/usr/local|${LOCALBASE}|g ; \
/paper.h/s|/usr/include|${LOCALBASE}/include|g ; \
/paper.h/s|/usr/lib|${LOCALBASE}/lib|g'
.if ! empty(ICONV_LIB)
@${REINPLACE_CMD} 's|/iconv\.so|/libiconv.so|' \
${WRKSRC}/Ted/configure ${WRKSRC}/textEncoding/configure
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/Ted/Ted ${STAGEDIR}${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/tedPackage/examples/rtf2*.sh ${STAGEDIR}${PREFIX}/bin/
${INSTALL_MAN} ${WRKSRC}/tedPackage/doc/Ted.1 ${STAGEDIR}${MANPREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/tedPackage/doc/rtf2*.1 ${STAGEDIR}${MANPREFIX}/man/man1
@${MKDIR} ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKSRC}/tedPackage/ps/*.ps ${STAGEDIR}${DATADIR}
@${MKDIR} ${STAGEDIR}${AFMDIR}
${INSTALL_DATA} ${WRKSRC}/tedPackage/afm/*.afm ${STAGEDIR}${AFMDIR}
@${MKDIR} ${STAGEDIR}${INDDIR}
${INSTALL_DATA} ${WRKSRC}/tedPackage/dfa/*.dfa ${STAGEDIR}${INDDIR}
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/tedPackage/TedDocument-en_US.rtf ${STAGEDIR}${DOCSDIR}
.endif
.include <bsd.port.post.mk>