optionsng ignores /var/db/ports/<portname>/options

Baptiste Daroussin bapt at FreeBSD.org
Sun Jun 3 21:54:09 UTC 2012


On Sun, Jun 03, 2012 at 10:01:01PM +0200, Baptiste Daroussin wrote:
> On Sun, Jun 03, 2012 at 09:20:23PM +0200, Roland Smith wrote:
> > [Please cc me, since I'm not subscribed to this list. I originally asked this
> > on questions at .]
> > 
> > Hi,
> > 
> > With the release of the new options framework for ports, I've run into a
> > problem trying to convert one of my ports.
> > 
> > The nature of the problem is that the port seems to ignore the setting stored
> > in /var/db/ports/<portname>/options:
> > 
> > I've used 'make config' to set the PYCAIRO option to on;
> > 
> > slackbox# cat /var/db/ports/py27-py-stl/options
> > # This file is auto-generated by 'make config'.
> > # Options for py27-py-stl-3.1
> > _OPTIONS_READ=py27-py-stl-3.1
> > _FILE_COMPLETE_OPTIONS_LIST=PYCAIRO
> > OPTIONS_FILE_SET+=PYCAIRO
> > 
> > But the port seems to ignore it:
> > 
> > slackbox# make showconfig
> > ===> The following configuration options are available for py27-py-stl-3.1:
> >      PYCAIRO=off: Use (py)Cairo to enable stl2pdf
> > ===> Use 'make config' to modify these settings
> > 
> > slackbox# make -V PORT_OPTIONS
> > DOCS EXAMPLES NLS
> > 
> > Every time I do 'make config', the PYCAIRO option will be unset, even if it
> > shows as set in /var/db/ports/<portname>/options!
> > 
> > My port Makefile is as follows:
> > ------------ port Makefile ----------------
> > # New ports collection makefile for:    py-stl
> > # Date created:                         28 Dec 2011
> > # Whom:                                 rsmith at xs4all.nl
> > #
> > # $FreeBSD$
> > 
> > PORTNAME=		py-stl
> > PORTVERSION=		3.1
> > CATEGORIES=		graphics python
> > MASTER_SITES=		http://rsmith.home.xs4all.nl/software/
> > PKGNAMEPREFIX=		${PYTHON_PKGNAMEPREFIX}
> > 
> > MAINTAINER=		rsmith at xs4all.nl
> > COMMENT=		Converts STL models to POV-Ray meshes or PostScript/PDF images
> > 
> > USE_ZIP=		YES
> > USE_PYTHON=		2.5+
> > USE_PYDISTUTILS=	YES
> > 
> > CONFLICTS=		stl2pov-[0-9]*
> > 
> > MAN1=			stl2ps.1 stlinfo.1
> > 
> > OPTIONS_DEFINE=	PYCAIRO
> > PYCAIRO_DESC=	Use (py)Cairo to enable stl2pdf
> > 
> > .include <bsd.port.options.mk>
> > 
> > .if ${PORT_OPTIONS:MPYCAIRO}
> > RUN_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}cairo>1.8:${PORTSDIR}/graphics/py-cairo
> > MAN1+=			stl2pdf.1
> > PLIST_SUB+=		STL2PDF=""
> > .else
> > PLIST_SUB+=		STL2PDF="@comment "
> > .endif
> > 
> > NO_BUILD=		YES
> > 
> > post-install:
> > .if ${PORT_OPTIONS:MPYCAIRO}
> > 	@${INSTALL_MAN} ${WRKSRC}/stl2pdf.1 ${MANPREFIX}/man/man1
> > 	@${MV} ${PREFIX}/bin/stl2pdf.py ${PREFIX}/bin/stl2pdf
> > .else
> > 	@${RM} -f ${PREFIX}/bin/stl2pdf.py
> > 	@${RM} -f  ${MANPREFIX}/man/man1/stl2pdf.1*
> > .endif
> > 	@${INSTALL_MAN} ${WRKSRC}/stl2ps.1 ${MANPREFIX}/man/man1
> > 	@${INSTALL_MAN} ${WRKSRC}/stlinfo.1 ${MANPREFIX}/man/man1
> > 	@${MV} ${PREFIX}/bin/stl2ps.py  ${PREFIX}/bin/stl2ps
> > 	@${MV} ${PREFIX}/bin/stl2pov.py ${PREFIX}/bin/stl2pov
> > 	@${MV} ${PREFIX}/bin/stlinfo.py ${PREFIX}/bin/stlinfo
> > 	@${MV} ${PYTHON_SITELIBDIR}/py_stl-${PORTVERSION}-py${PYTHON_VER}.egg-info ${PYTHON_SITELIBDIR}/${PYDISTUTILS_EGGINFO}
> > 
> > .include <bsd.port.mk>
> > ------------ port Makefile ----------------
> > 
> > I've looked at other ports makefiles and see no obvious defects. Help?
> > 
> > Roland
> > -- 
> > R.F.Smith                                   http://rsmith.home.xs4all.nl/
> > [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
> > pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
> 
> You found a nice bug.
> 
> The options file is read the thing is that the UNIQUENAME is changed is
> py-py-stl when the optionsfile is read and it is py27-py-stl when it is written.
> 
> I don't know why yet, I'll fix it asap.
> 
> regards,
> Bapt

FYI the bug you found also happen with python and rubygem ports, it can also
happen with apache ports, in fact any ports depending on bsd.*.mk where bsd.*.mk
defines the pkgnameprefix.

nothing directly related to optionsNG a good example of workaround is: look at
py-yaml

You can have multiple workarounds:
first one: define OPTIONSFILE in your ports like py-yaml
second one: replace bsd.port.options.mk by bsd.port.pre.mk (do not forget in
that case the bsd.port.post.mk in the end)
thrid define LATEST_LINK in your port.

The real fix which will be long term, any volunteer? would be to define a
PKGNAMEEXTRAPREFIX in bsd.port.mk that bsd.*.mk can overwrite and create a
UNIQUENAME that is independant from that EXTRAPREFIX.

regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20120603/e3b2f376/attachment.pgp


More information about the freebsd-ports mailing list