Annotation of pkgsrc/lang/python/egg.mk, revision 1.37
1.37 ! riastrad 1: # $NetBSD: egg.mk,v 1.36 2022/02/08 17:19:50 gutteridge Exp $
1.1 joerg 2: #
3: # Common logic to handle Python Eggs
4: #
1.8 joerg 5: .include "../../mk/bsd.fast.prefs.mk"
1.14 drochner 6: .include "../../lang/python/pyversion.mk"
1.1 joerg 7:
1.11 gdt 8: # This file should be included to package python "distributions" which
1.35 wiz 9: # use setuptools to create an egg.
10: #
11: # For wheel (*.whl) support, look at wheel.mk.
1.11 gdt 12:
1.20 wiz 13: EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g}
1.18 rodent 14: EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
1.6 epg 15:
1.1 joerg 16: PYDISTUTILSPKG= yes
17: PY_PATCHPLIST= yes
18:
1.36 gutterid 19: # True eggs always have an egg-info directory. egg.mk can also
1.35 wiz 20: # be used for distutils packages, in which case there will be no
1.13 gdt 21: # egg-info directory.
22:
1.35 wiz 23: # Please note that some packages do not provide this directory
24: # with the last setuptools version that supports python 2.7.
25: # In this case, the ${EGG_INFODIR} lines in the PLIST need to
26: # be prefixed with ${PLIST.py3x} - please always test with both
27: # python 2.7 and the current python 3.x default!
1.13 gdt 28:
1.2 joerg 29: PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX}
1.18 rodent 30: PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR}
1.28 rillig 31: PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX:S,.,\.,g}.egg-info/, \
1.5 epg 32: "$${EGG_INFODIR}") }
1.28 rillig 33: PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX:S,.,\.,g}-nspkg.pth/, \
1.5 epg 34: "$${EGG_NAME}-nspkg.pth") }
1.28 rillig 35: PRINT_PLIST_AWK+= { gsub(/${PYVERSSUFFIX:S,.,\.,g}/, \
1.24 richard 36: "$${PYVERSSUFFIX}") }
1.1 joerg 37:
1.33 wiz 38: USE_PKG_RESOURCES?= no
39:
1.35 wiz 40: # py-setuptools needs to be bootstrapped from python itself, without using
41: # py-setuptools.
1.27 wiz 42: BOOTSTRAP_SETUPTOOLS?= no
43: .if ${BOOTSTRAP_SETUPTOOLS} == "yes"
1.32 wiz 44: TOOL_DEPENDS+= ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat
1.27 wiz 45: do-build: ensurepip
46: .PHONY: ensurepip
47:
48: ensurepip:
49: ${SETENV} ${MAKE_ENV} ${PYTHONBIN} -m ensurepip --user
50: .else
1.31 gdt 51: . if "${PYVERSSUFFIX}" == "2.7"
1.33 wiz 52: SETUPTOOLS_PATH=../../devel/py-setuptools44
53: . else
54: SETUPTOOLS_PATH=../../devel/py-setuptools
55: . endif
56: . if "${USE_PKG_RESOURCES}" == "yes"
57: DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:${SETUPTOOLS_PATH}
1.37 ! riastrad 58: . endif
1.33 wiz 59: TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:${SETUPTOOLS_PATH}
1.27 wiz 60: .endif
1.1 joerg 61:
62: INSTALLATION_DIRS+= ${PYSITELIB}
63:
1.22 richard 64: privileged-install-hook: fixup-egg-info
65: .PHONY: fixup-egg-info
66: fixup-egg-info: # ensure egg-info directory contents are always 644
1.23 wiz 67: if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \
1.22 richard 68: ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \
1.26 wiz 69: -exec ${CHMOD} ${SHAREMODE} '{}' +; \
1.23 wiz 70: fi
1.22 richard 71:
1.1 joerg 72: .include "../../lang/python/extension.mk"
CVSweb <webmaster@jp.NetBSD.org>