Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jun 2012 23:54:06 +0200
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Roland Smith <rsmith@xs4all.nl>
Cc:        freebsd-ports@FreeBSD.org
Subject:   Re: optionsng ignores /var/db/ports/<portname>/options
Message-ID:  <20120603215406.GC98939@ithaqua.etoilebsd.net>
In-Reply-To: <20120603200101.GB98939@ithaqua.etoilebsd.net>
References:  <20120603192023.GA8350@slackbox.erewhon.net> <20120603200101.GB98939@ithaqua.etoilebsd.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--1ccMZA6j1vT5UqiK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 aske=
d this
> > on questions@.]
> >=20
> > Hi,
> >=20
> > With the release of the new options framework for ports, I've run into a
> > problem trying to convert one of my ports.
> >=20
> > The nature of the problem is that the port seems to ignore the setting =
stored
> > in /var/db/ports/<portname>/options:
> >=20
> > I've used 'make config' to set the PYCAIRO option to on;
> >=20
> > 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=3Dpy27-py-stl-3.1
> > _FILE_COMPLETE_OPTIONS_LIST=3DPYCAIRO
> > OPTIONS_FILE_SET+=3DPYCAIRO
> >=20
> > But the port seems to ignore it:
> >=20
> > slackbox# make showconfig
> > =3D=3D=3D> The following configuration options are available for py27-p=
y-stl-3.1:
> >      PYCAIRO=3Doff: Use (py)Cairo to enable stl2pdf
> > =3D=3D=3D> Use 'make config' to modify these settings
> >=20
> > slackbox# make -V PORT_OPTIONS
> > DOCS EXAMPLES NLS
> >=20
> > Every time I do 'make config', the PYCAIRO option will be unset, even i=
f it
> > shows as set in /var/db/ports/<portname>/options!
> >=20
> > My port Makefile is as follows:
> > ------------ port Makefile ----------------
> > # New ports collection makefile for:    py-stl
> > # Date created:                         28 Dec 2011
> > # Whom:                                 rsmith@xs4all.nl
> > #
> > # $FreeBSD$
> >=20
> > PORTNAME=3D		py-stl
> > PORTVERSION=3D		3.1
> > CATEGORIES=3D		graphics python
> > MASTER_SITES=3D		http://rsmith.home.xs4all.nl/software/
> > PKGNAMEPREFIX=3D		${PYTHON_PKGNAMEPREFIX}
> >=20
> > MAINTAINER=3D		rsmith@xs4all.nl
> > COMMENT=3D		Converts STL models to POV-Ray meshes or PostScript/PDF ima=
ges
> >=20
> > USE_ZIP=3D		YES
> > USE_PYTHON=3D		2.5+
> > USE_PYDISTUTILS=3D	YES
> >=20
> > CONFLICTS=3D		stl2pov-[0-9]*
> >=20
> > MAN1=3D			stl2ps.1 stlinfo.1
> >=20
> > OPTIONS_DEFINE=3D	PYCAIRO
> > PYCAIRO_DESC=3D	Use (py)Cairo to enable stl2pdf
> >=20
> > .include <bsd.port.options.mk>
> >=20
> > .if ${PORT_OPTIONS:MPYCAIRO}
> > RUN_DEPENDS+=3D		${PYTHON_PKGNAMEPREFIX}cairo>1.8:${PORTSDIR}/graphics/=
py-cairo
> > MAN1+=3D			stl2pdf.1
> > PLIST_SUB+=3D		STL2PDF=3D""
> > .else
> > PLIST_SUB+=3D		STL2PDF=3D"@comment "
> > .endif
> >=20
> > NO_BUILD=3D		YES
> >=20
> > 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}
> >=20
> > .include <bsd.port.mk>
> > ------------ port Makefile ----------------
> >=20
> > I've looked at other ports makefiles and see no obvious defects. Help?
> >=20
> > Roland
> > --=20
> > R.F.Smith                                   http://rsmith.home.xs4all.n=
l/
> > [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciate=
d]
> > pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A72=
5)
>=20
> You found a nice bug.
>=20
> 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 w=
ritten.
>=20
> I don't know why yet, I'll fix it asap.
>=20
> 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=
=2E*.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

--1ccMZA6j1vT5UqiK
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAk/L3P4ACgkQ8kTtMUmk6ExSMwCgiWWz24Y4f2mL1Lg/CH4LCc/p
w+cAnjiOV1XyvvvRmLcWVuy1uv6ti5iH
=BDj4
-----END PGP SIGNATURE-----

--1ccMZA6j1vT5UqiK--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120603215406.GC98939>