summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2011-10-14 08:55:54 +0000
committerobache <obache@pkgsrc.org>2011-10-14 08:55:54 +0000
commit1d0f6a1bc80a3660cbc7d47f3b880a960b57ab9c (patch)
tree683ff25da428aec2eaffba313fd18d3666e94cc1 /lang/python
parent9ed55cc5143ffbc6190a44691dbd603510256311 (diff)
downloadpkgsrc-1d0f6a1bc80a3660cbc7d47f3b880a960b57ab9c.tar.gz
Add make fragment for easy to use python as tool.
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/tool.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/lang/python/tool.mk b/lang/python/tool.mk
new file mode 100644
index 00000000000..df406612c23
--- /dev/null
+++ b/lang/python/tool.mk
@@ -0,0 +1,29 @@
+# $NetBSD: tool.mk,v 1.1 2011/10/14 08:55:54 obache Exp $
+#
+# 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.
+#
+# Keywords: python
+#
+
+.if !defined(PYTHON_TOOL_MK)
+PYTHON_TOOL_MK= defined
+
+.if !defined(PYTHON_PYVERSION_MK)
+.include "../../lang/python/pyversion.mk"
+.endif
+
+BUILDLINK_TARGETS+= buildlink-bin-python
+
+.PHONY: buildlink-bin-python
+buildlink-bin-python:
+ ${RUN} \
+ f="${PYTHONBIN}"; \
+ t="${BUILDLINK_DIR}/bin/python"; \
+ if ${TEST} -f $$f -a ! -f $$t ; then \
+ ${LN} -sf $$f $$t; \
+ fi
+
+.endif # PYTHON_TOOL_MK