Thu Nov 23 11:00:52 2023 UTC ()
python: Default tool.mk to PYTHON_FOR_BUILD_ONLY=tool.

Helps to avoid buildlinking unnecessarily which can lead to dependency
issues with packages that are pulled in by python's buildlink3.mk.


(jperkin)
diff -r1.4 -r1.5 pkgsrc/lang/python/tool.mk

cvs diff -r1.4 -r1.5 pkgsrc/lang/python/tool.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/tool.mk 2023/06/27 10:31:21 1.4
+++ pkgsrc/lang/python/tool.mk 2023/11/23 11:00:52 1.5
@@ -1,27 +1,28 @@ @@ -1,27 +1,28 @@
1# $NetBSD: tool.mk,v 1.4 2023/06/27 10:31:21 riastradh Exp $ 1# $NetBSD: tool.mk,v 1.5 2023/11/23 11:00:52 jperkin Exp $
2# 2#
3# Create `python' interpreter wrapper for applicable Python bin. 3# Create `python' interpreter wrapper for applicable Python bin.
4# 4#
5# This mk fragment can be included in all packages that use `python' 5# This mk fragment can be included in all packages that use `python'
6# as a tool without a pkgsrc-style version suffix. 6# as a tool without a pkgsrc-style version suffix.
7# 7#
8# Keywords: python 8# Keywords: python
9# 9#
10 10
11.if !defined(PYTHON_TOOL_MK) 11.if !defined(PYTHON_TOOL_MK)
12PYTHON_TOOL_MK= defined 12PYTHON_TOOL_MK= defined
13 13
14.if !defined(PYTHON_PYVERSION_MK) 14.if !defined(PYTHON_PYVERSION_MK)
 15PYTHON_FOR_BUILD_ONLY?= tool
15.include "../../lang/python/pyversion.mk" 16.include "../../lang/python/pyversion.mk"
16.endif 17.endif
17 18
18BUILDLINK_TARGETS+= buildlink-bin-python 19BUILDLINK_TARGETS+= buildlink-bin-python
19 20
20.PHONY: buildlink-bin-python 21.PHONY: buildlink-bin-python
21buildlink-bin-python: 22buildlink-bin-python:
22.for bin in python python${PYVERSSUFFIX:R} 23.for bin in python python${PYVERSSUFFIX:R}
23 ${RUN} \ 24 ${RUN} \
24 t=${BUILDLINK_DIR}/bin/${bin}; \ 25 t=${BUILDLINK_DIR}/bin/${bin}; \
25 if ${TEST} -f "${TOOL_PYTHONBIN}" -a ! -f $$t; then \ 26 if ${TEST} -f "${TOOL_PYTHONBIN}" -a ! -f $$t; then \
26 ${LN} -sf "${TOOL_PYTHONBIN}" $$t; \ 27 ${LN} -sf "${TOOL_PYTHONBIN}" $$t; \
27 fi 28 fi