Subject: Re: Python buildlink?
To: None <tech-pkg@netbsd.org>
From: Amitai Schlair <schmonz@schmonz.com>
List: tech-pkg
Date: 07/26/2002 18:10:20
"Julio Merino" <jmmv@hispabsd.org> wrote:

> I'm trying to package subversion, a CVS replacement tool:
http://subversion.tigris.org
> The package needs to use python greater than 2.0. As somebody
suggested for
> the mailman package, I've included pyversion.mk in the Makefile.

Cool!

You don't need to (and probably shouldn't) include pyversion.mk
directly. Instead, include either application.buildlink.mk or
extension.buildlink.mk (or both, in some cases), and they will include
pyversion.mk for you.

The default version requirements are as follows:

- If no Python is installed, or the installed Pythons are all older than
2.0, lang/python21 will be installed.

- If a Python package >= 2.0 is installed, it will be used.

If that meets Subversion's needs, you don't need to do anything further.

> Although, the package itself wants to run python as "python" itself,
hoping
> it's in the path.
>
> The first problem is that there is no such python binary. I was
thinking of adding
> some kind of stuff to link the choosed binary by pyversion.mk into
> ${BUILDLINK_DIR}/bin/python. But... where should this stuff go? Maybe
in
> pyversion.mk? Maybe in a buildlink.mk? (note that this is not really a
buildlink)...
>
> Patching the package itself is not a good idea, as the patch would
need to include
> something like python2.1, hardcoding a version number inside.

I'd recommend fixing those paths in two steps. First, patch the
problematic instances of "python" to @PYTHONBIN@. Then, override the
pre-configure target and use sed to replace @PYTHONBIN@ with
${PYTHONBIN}.

- Amitai