Annotation of pkgsrc/lang/python/pyversion.mk, revision 1.3
1.3 ! drochner 1: # $NetBSD: pyversion.mk,v 1.2 2002/01/15 17:18:01 drochner Exp $
1.2 drochner 2:
3: .if !defined(PYTHON_PYVERSION_MK)
4: PYTHON_PYVERSION_MK= defined
1.1 drochner 5:
6: .include "../../mk/bsd.prefs.mk"
7:
8: PYTHON_VERSION_DEFAULT?= 21
1.2 drochner 9: PYTHON_VERSIONS_ACCEPTED?= 22 21 20
1.1 drochner 10:
11: # transform the list into individual variables
12: .for pv in ${PYTHON_VERSIONS_ACCEPTED}
13: _PYTHON_VERSION_${pv}_OK= yes
14: .endfor
15:
16: # check what is installed
1.2 drochner 17: .if exists(${LOCALBASE}/bin/python2.2)
18: _PYTHON_VERSION_22_INSTALLED= yes
19: .endif
1.1 drochner 20: .if exists(${LOCALBASE}/bin/python2.1)
21: _PYTHON_VERSION_21_INSTALLED= yes
22: .endif
23: .if exists(${LOCALBASE}/bin/python2.0)
24: _PYTHON_VERSION_20_INSTALLED= yes
25: .endif
26:
27: #
28: # choose a python version where to add,
29: # try to be intelligent
30: #
1.2 drochner 31: # if a version is explicitely required, take it
32: .if defined(PYTHON_VERSION_REQD)
33: _PYTHON_VERSION= ${PYTHON_VERSION_REQD}
34: .endif
1.1 drochner 35: # if the default is already installed, it is first choice
1.2 drochner 36: .if !defined(_PYTHON_VERSION)
1.1 drochner 37: .if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_OK)
38: .if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_INSTALLED)
39: _PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
40: .endif
41: .endif
1.2 drochner 42: .endif
1.1 drochner 43: # prefer an already installed version, in order of "accepted"
44: .if !defined(_PYTHON_VERSION)
45: .for pv in ${PYTHON_VERSIONS_ACCEPTED}
46: .if defined(_PYTHON_VERSION_${pv}_INSTALLED)
47: _PYTHON_VERSION?= ${pv}
48: .else
49: # keep information as last resort - see below
50: _PYTHON_VERSION_FIRSTACCEPTED?= ${pv}
51: .endif
52: .endfor
53: .endif
54: # if the default is OK for the addon pkg, take this
55: .if !defined(_PYTHON_VERSION)
56: .if defined(_PYTHON_VERSION_${PYTHON_VERSION_DEFAULT}_OK)
57: _PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
58: .endif
59: .endif
60: # take the first one accepted by the package
61: .if !defined(_PYTHON_VERSION)
62: _PYTHON_VERSION= ${_PYTHON_VERSION_FIRSTACCEPTED}
63: .endif
64:
65: #
66: # set variables for the version we decided to use
67: #
1.2 drochner 68: .if ${_PYTHON_VERSION} == "22"
69: DEPENDS+= python22>=2.2:../../lang/python22
70: PYTHONBIN= ${LOCALBASE}/bin/python2.2
71: PYPKGPREFIX= py22
72: .elif ${_PYTHON_VERSION} == "21"
1.1 drochner 73: DEPENDS+= python21>=2.1:../../lang/python21
74: PYTHONBIN= ${LOCALBASE}/bin/python2.1
75: PYPKGPREFIX= py21
76: .elif ${_PYTHON_VERSION} == "20"
1.3 ! drochner 77: DEPENDS+= python20>=2.0:../../lang/python20
1.1 drochner 78: PYTHONBIN= ${LOCALBASE}/bin/python2.0
79: PYPKGPREFIX= py20
80: .endif
1.2 drochner 81:
82: .endif # PYTHON_PYVERSION_MK
CVSweb <webmaster@jp.NetBSD.org>