Sun Apr 3 11:54:48 2022 UTC ()
python: Fix cross-build with pkg_resources.

setuptools must still be in TOOL_DEPENDS because we run it during the
build; for pkg_resources it must _also_ be in DEPENDS because the
built package needs it to run.


(riastradh)
diff -r1.36 -r1.37 pkgsrc/lang/python/egg.mk

cvs diff -r1.36 -r1.37 pkgsrc/lang/python/egg.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/egg.mk 2022/02/08 17:19:50 1.36
+++ pkgsrc/lang/python/egg.mk 2022/04/03 11:54:48 1.37
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: egg.mk,v 1.36 2022/02/08 17:19:50 gutteridge Exp $ 1# $NetBSD: egg.mk,v 1.37 2022/04/03 11:54:48 riastradh Exp $
2# 2#
3# Common logic to handle Python Eggs 3# Common logic to handle Python Eggs
4# 4#
5.include "../../mk/bsd.fast.prefs.mk" 5.include "../../mk/bsd.fast.prefs.mk"
6.include "../../lang/python/pyversion.mk" 6.include "../../lang/python/pyversion.mk"
7 7
8# This file should be included to package python "distributions" which 8# This file should be included to package python "distributions" which
9# use setuptools to create an egg. 9# use setuptools to create an egg.
10# 10#
11# For wheel (*.whl) support, look at wheel.mk. 11# For wheel (*.whl) support, look at wheel.mk.
12 12
13EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g} 13EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g}
14EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info 14EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
@@ -45,29 +45,28 @@ TOOL_DEPENDS+= ${PYPKGPREFIX}-expat-[0- @@ -45,29 +45,28 @@ TOOL_DEPENDS+= ${PYPKGPREFIX}-expat-[0-
45do-build: ensurepip 45do-build: ensurepip
46.PHONY: ensurepip 46.PHONY: ensurepip
47 47
48ensurepip: 48ensurepip:
49 ${SETENV} ${MAKE_ENV} ${PYTHONBIN} -m ensurepip --user 49 ${SETENV} ${MAKE_ENV} ${PYTHONBIN} -m ensurepip --user
50.else 50.else
51. if "${PYVERSSUFFIX}" == "2.7" 51. if "${PYVERSSUFFIX}" == "2.7"
52SETUPTOOLS_PATH=../../devel/py-setuptools44 52SETUPTOOLS_PATH=../../devel/py-setuptools44
53. else 53. else
54SETUPTOOLS_PATH=../../devel/py-setuptools 54SETUPTOOLS_PATH=../../devel/py-setuptools
55. endif 55. endif
56. if "${USE_PKG_RESOURCES}" == "yes" 56. if "${USE_PKG_RESOURCES}" == "yes"
57DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:${SETUPTOOLS_PATH} 57DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:${SETUPTOOLS_PATH}
58. else 
59TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:${SETUPTOOLS_PATH} 
60. endif 58. endif
 59TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:${SETUPTOOLS_PATH}
61.endif 60.endif
62 61
63INSTALLATION_DIRS+= ${PYSITELIB} 62INSTALLATION_DIRS+= ${PYSITELIB}
64 63
65privileged-install-hook: fixup-egg-info 64privileged-install-hook: fixup-egg-info
66.PHONY: fixup-egg-info 65.PHONY: fixup-egg-info
67fixup-egg-info: # ensure egg-info directory contents are always 644 66fixup-egg-info: # ensure egg-info directory contents are always 644
68 if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \ 67 if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \
69 ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \ 68 ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \
70 -exec ${CHMOD} ${SHAREMODE} '{}' +; \ 69 -exec ${CHMOD} ${SHAREMODE} '{}' +; \
71 fi 70 fi
72 71
73.include "../../lang/python/extension.mk" 72.include "../../lang/python/extension.mk"