tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/python/tool.mk: allow setting the desired executable name



Should it perhaps even default to python3 for python-3.x and python2
for python-2.x?

What I worry about is that programs might expect them to be around at
runtime as well, and then we don't notice the problem at build time.
 Thomas

On Fri, Nov 15, 2019 at 03:04:13PM +0000, nia wrote:
> Trying to make tool.mk more useful for resolving problems such as this:
> 
> http://us-east.manta.joyent.com/pkgsrc/public/reports/Darwin/trunk/x86_64/20191112.2308/MesaLib-19.2.3/configure.log
> 
> ok?
> 
> Index: tool.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/lang/python/tool.mk,v
> retrieving revision 1.1
> diff -u -r1.1 tool.mk
> --- tool.mk	14 Oct 2011 08:55:54 -0000	1.1
> +++ tool.mk	15 Nov 2019 15:00:28 -0000
> @@ -3,14 +3,24 @@
>  # Create `python' interpreter wrapper for applicable Python bin.
>  #
>  # This mk fragment can be included in all packages that uses `python'
> -# as a tool without version suffix.
> +# as a tool without a pkgsrc-style version suffix.
>  #
>  # Keywords: python
>  #
> +# === Package-settable variables ===
> +#
> +# PYTHON_TOOL
> +#	The name of the Python executable the package expects to need.
> +#
> +#	Possible values: python3, python2
> +#	Default: python
> +#
>  
>  .if !defined(PYTHON_TOOL_MK)
>  PYTHON_TOOL_MK=	defined
>  
> +PYTHON_TOOL?=	python
> +
>  .if !defined(PYTHON_PYVERSION_MK)
>  .include "../../lang/python/pyversion.mk"
>  .endif
> @@ -21,7 +31,7 @@
>  buildlink-bin-python:
>  	${RUN} \
>  	f="${PYTHONBIN}"; \
> -	t="${BUILDLINK_DIR}/bin/python"; \
> +	t="${BUILDLINK_DIR}/bin/${PYTHON_TOOL}"; \
>  	if ${TEST} -f $$f -a ! -f $$t ; then \
>  		${LN} -sf $$f $$t; \
>  	fi
> 


Home | Main Index | Thread Index | Old Index