optional dependencies

Eric P. Scott eps+pcmt0703 at ana.com
Tue Mar 27 22:17:54 UTC 2007


The only reason editors/texmaker has a dependency on xpdf is it's
"hardwired" into the upstream source.  You could try something
like:

[remove xpdf:${PORTSDIR}/graphics/xpdf from RUN_DEPENDS]

OPTIONS=	ACROREAD "Use acroread" off \
		KPDF "Use kpdf" off \
		XPDF "Use xpdf" on

[...]

.include <bsd.port.pre.mk>

.if defined(WITH_ACROREAD)
.if defined(WITH_KPDF) || !defined(WITHOUT_XPDF)
IGNORE=	exactly one PDF viewer must be chosen
.endif
RUN_DEPENDS+= acroread:${PORTSDIR}/print/acroread7
.endif

.if defined(WITH_KPDF)
.if defined(WITH_ACROREAD) || !defined(WITHOUT_XPDF)
IGNORE=	exactly one PDF viewer must be chosen
.endif
RUN_DEPENDS+= kpdf:${PORTSDIR}/graphics/kdegraphics3
.endif

.if !defined(WITHOUT_XPDF)
.if defined(WITH_ACROREAD) || defined(WITH_KPDF)
IGNORE=	exactly one PDF viewer must be chosen
.endif
RUN_DEPENDS+= xpdf:${PORTSDIR}/graphics/xpdf
.endif

post-patch:
.if defined(WITH_ACROREAD)
	@${REINPLACE_CMD} -e "s/xpdf/acroread/" ${WRKSRC}/texmaker.cpp
.elif defined(WITH_KPDF)
	@${REINPLACE_CMD} -e "s/xpdf/kpdf/" ${WRKSRC}/texmaker.cpp
.endif

[...]

.include <bsd.port.post.mk>


This points up a limitation in the current bsd.ports.mk: the
options dialog is always created as a --checklist, and there's no
easy way to request a --menu be used instead.

					-=EPS=-


More information about the freebsd-ports mailing list