Tue Jun 27 10:35:30 2023 UTC ()
python: Override sys.platform with PY_PLATNAME when cross-compiling.

For this purpose, factor the PY_PLATNAME definition out into a new
lang/pythonNN/platname.mk file.  It's not the same for 2.x and 3.x;
perhaps we could factor it out further into a single 2.x vs 3.x
conditional but this is a more mechanical change that makes it easier
to audit for now.


(riastradh)
diff -r1.150 -r1.151 pkgsrc/lang/python/pyversion.mk
diff -r1.106 -r1.107 pkgsrc/lang/python27/Makefile
diff -r0 -r1.1 pkgsrc/lang/python27/platname.mk
diff -r1.17 -r1.18 pkgsrc/lang/python310/Makefile
diff -r0 -r1.1 pkgsrc/lang/python310/platname.mk
diff -r1.6 -r1.7 pkgsrc/lang/python311/Makefile
diff -r0 -r1.1 pkgsrc/lang/python311/platname.mk
diff -r1.36 -r1.37 pkgsrc/lang/python37/Makefile
diff -r0 -r1.1 pkgsrc/lang/python37/platname.mk
diff -r1.28 -r1.29 pkgsrc/lang/python38/Makefile
diff -r0 -r1.1 pkgsrc/lang/python38/platname.mk
diff -r1.23 -r1.24 pkgsrc/lang/python39/Makefile
diff -r0 -r1.1 pkgsrc/lang/python39/platname.mk

cvs diff -r1.150 -r1.151 pkgsrc/lang/python/pyversion.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/pyversion.mk 2023/06/27 10:31:21 1.150
+++ pkgsrc/lang/python/pyversion.mk 2023/06/27 10:35:29 1.151
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: pyversion.mk,v 1.150 2023/06/27 10:31:21 riastradh Exp $ 1# $NetBSD: pyversion.mk,v 1.151 2023/06/27 10:35:29 riastradh Exp $
2 2
3# This file should be included by packages as a way to depend on 3# This file should be included by packages as a way to depend on
4# python when none of the other methods are appropriate, e.g. a 4# python when none of the other methods are appropriate, e.g. a
5# package that produces a binary that embeds python. 5# package that produces a binary that embeds python.
6# It determines which Python version is used as a dependency for 6# It determines which Python version is used as a dependency for
7# a package. 7# a package.
8# 8#
9# === User-settable variables === 9# === User-settable variables ===
10# 10#
11# PYTHON_VERSION_DEFAULT 11# PYTHON_VERSION_DEFAULT
12# The preferred Python version to use. 12# The preferred Python version to use.
13# 13#
14# Possible values: 27 37 38 39 310 311 14# Possible values: 27 37 38 39 310 311
@@ -190,31 +190,33 @@ PYTHON_FOR_BUILD_ONLY?= no @@ -190,31 +190,33 @@ PYTHON_FOR_BUILD_ONLY?= no
190. if !empty(PYTHON_FOR_BUILD_ONLY:M[tT][oO][oO][lL]) 190. if !empty(PYTHON_FOR_BUILD_ONLY:M[tT][oO][oO][lL])
191TOOL_DEPENDS+= ${PYDEPENDENCY} 191TOOL_DEPENDS+= ${PYDEPENDENCY}
192. elif !empty(PYTHON_FOR_BUILD_ONLY:M[tT][eE][sS][tT]) 192. elif !empty(PYTHON_FOR_BUILD_ONLY:M[tT][eE][sS][tT])
193TEST_DEPENDS+= ${PYDEPENDENCY} 193TEST_DEPENDS+= ${PYDEPENDENCY}
194. else 194. else
195. if !empty(PYTHON_FOR_BUILD_ONLY:M[yY][eE][sS]) 195. if !empty(PYTHON_FOR_BUILD_ONLY:M[yY][eE][sS])
196BUILDLINK_DEPMETHOD.python?= build 196BUILDLINK_DEPMETHOD.python?= build
197. endif 197. endif
198. include "${PYPKGSRCDIR}/buildlink3.mk" 198. include "${PYPKGSRCDIR}/buildlink3.mk"
199. if ${USE_CROSS_COMPILE:U:tl} == "yes" 199. if ${USE_CROSS_COMPILE:U:tl} == "yes"
200TOOL_DEPENDS+= ${PYDEPENDENCY} 200TOOL_DEPENDS+= ${PYDEPENDENCY}
201MAKE_ENV+= PYTHONPATH=${WRKDIR:Q}/.pysite:${_CROSS_DESTDIR:Q}${LOCALBASE:Q}/${PYLIB:Q} 201MAKE_ENV+= PYTHONPATH=${WRKDIR:Q}/.pysite:${_CROSS_DESTDIR:Q}${LOCALBASE:Q}/${PYLIB:Q}
202pre-configure: ${WRKDIR}/.pysite/sitecustomize.py 202pre-configure: ${WRKDIR}/.pysite/sitecustomize.py
 203.include "${PYPKGSRCDIR}/platname.mk"
203${WRKDIR}/.pysite/sitecustomize.py: 204${WRKDIR}/.pysite/sitecustomize.py:
204 @${STEP_MSG} "Creating Python sitecustomize.py for cross-compiling" 205 @${STEP_MSG} "Creating Python sitecustomize.py for cross-compiling"
205 ${RUN} ${MKDIR} ${.TARGET:H} 206 ${RUN} ${MKDIR} ${.TARGET:H}
206 ${RUN} ( \ 207 ${RUN} ( \
207 ${ECHO} "import sys" && \ 208 ${ECHO} "import sys" && \
 209 ${PRINTF} "sys.platform = '%s'\\n" ${PY_PLATNAME:Q} && \
208 for v in \ 210 for v in \
209 sys.base_exec_prefix \ 211 sys.base_exec_prefix \
210 sys.base_prefix \ 212 sys.base_prefix \
211 sys.exec_prefix \ 213 sys.exec_prefix \
212 sys.prefix \ 214 sys.prefix \
213 ; do \ 215 ; do \
214 ${PRINTF} "%s = '%s'\\n" "$$v" ${LOCALBASE:Q}; \ 216 ${PRINTF} "%s = '%s'\\n" "$$v" ${LOCALBASE:Q}; \
215 done; \ 217 done; \
216 ) >${.TARGET}.tmp 218 ) >${.TARGET}.tmp
217 ${RUN} ${MV} -f ${.TARGET}.tmp ${.TARGET} 219 ${RUN} ${MV} -f ${.TARGET}.tmp ${.TARGET}
218. endif 220. endif
219. endif 221. endif
220.endif 222.endif

cvs diff -r1.106 -r1.107 pkgsrc/lang/python27/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python27/Makefile 2023/05/29 23:33:48 1.106
+++ pkgsrc/lang/python27/Makefile 2023/06/27 10:35:29 1.107
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.106 2023/05/29 23:33:48 gutteridge Exp $ 1# $NetBSD: Makefile,v 1.107 2023/06/27 10:35:29 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python27-${PY_DISTVERSION} 5PKGNAME= python27-${PY_DISTVERSION}
6PKGREVISION= 11 6PKGREVISION= 11
7CATEGORIES= lang python 7CATEGORIES= lang python
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://www.python.org/ 10HOMEPAGE= https://www.python.org/
11COMMENT= Interpreted, interactive, object-oriented programming language 11COMMENT= Interpreted, interactive, object-oriented programming language
12LICENSE= python-software-foundation 12LICENSE= python-software-foundation
13 13
14DEPENDS= mozilla-rootcerts>=1.0.20150804nb1:../../security/mozilla-rootcerts 14DEPENDS= mozilla-rootcerts>=1.0.20150804nb1:../../security/mozilla-rootcerts
@@ -55,41 +55,30 @@ SUBST_MESSAGE.setup= Replacing crypt wit @@ -55,41 +55,30 @@ SUBST_MESSAGE.setup= Replacing crypt wit
55SUBST_STAGE.setup= pre-configure 55SUBST_STAGE.setup= pre-configure
56SUBST_FILES.setup= setup.py 56SUBST_FILES.setup= setup.py
57SUBST_SED.setup= -e "s,\([ \[]\)'crypt',\\1'crypt_i'," 57SUBST_SED.setup= -e "s,\([ \[]\)'crypt',\\1'crypt_i',"
58.endif 58.endif
59 59
60PY_VER_SUFFIX= 2.7 60PY_VER_SUFFIX= 2.7
61 61
62.if ${OPSYS} == "NetBSD" 62.if ${OPSYS} == "NetBSD"
63# XXX work around a botched autoconf check which ignores libintl 63# XXX work around a botched autoconf check which ignores libintl
64CONFIGURE_ENV+= ac_cv_func_bind_textdomain_codeset=yes 64CONFIGURE_ENV+= ac_cv_func_bind_textdomain_codeset=yes
65.endif 65.endif
66 66
67.if ${OPSYS} == "Cygwin" || ${OPSYS} == "Darwin" || ${OPSYS} == "Interix" 67.if ${OPSYS} == "Cygwin" || ${OPSYS} == "Darwin" || ${OPSYS} == "Interix"
68PY_PLATNAME= ${LOWER_OPSYS} 
69USE_TOOLS+= gmake 68USE_TOOLS+= gmake
70.elif ${OPSYS} == "IRIX" 
71PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} 
72.elif ${OPSYS} == "SunOS" 
73PY_PLATNAME= sunos${OS_VERSION:C/\..*//} 
74.elif ${OPSYS} == "HPUX" 
75PY_PLATNAME= hp-ux11 
76.elif ${OPSYS} == "Linux" 
77PY_PLATNAME= linux2 
78.elif ${OS_VARIANT} == "SCOOSR5" 
79PY_PLATNAME= sco_sv3 
80.else 
81PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} 
82.endif 69.endif
 70
 71.include "platname.mk"
83PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} 72PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
84 73
85.if !empty(LP64PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@) || \ 74.if !empty(LP64PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@) || \
86 (defined(ABI) && ${ABI} == "64") 75 (defined(ABI) && ${ABI} == "64")
87IS_64BIT_PLATFORM?= yes 76IS_64BIT_PLATFORM?= yes
88.else 77.else
89IS_64BIT_PLATFORM?= no 78IS_64BIT_PLATFORM?= no
90.endif 79.endif
91 80
92PLIST_VARS+= dl dll extra-so nis qt 81PLIST_VARS+= dl dll extra-so nis qt
93 82
94# the dl module isn't built for 64 bit archs 83# the dl module isn't built for 64 bit archs
95.if empty(IS_64BIT_PLATFORM:M[yY][eE][sS]) 84.if empty(IS_64BIT_PLATFORM:M[yY][eE][sS])

File Added: pkgsrc/lang/python27/platname.mk
#	$NetBSD: platname.mk,v 1.1 2023/06/27 10:35:29 riastradh Exp $

.if ${OPSYS} == "Cygwin" || ${OPSYS} == "Darwin" || ${OPSYS} == "Interix"
PY_PLATNAME=	${LOWER_OPSYS}
.elif ${OPSYS} == "IRIX"
PY_PLATNAME=	${LOWER_OPSYS:C/\..*//}
.elif ${OPSYS} == "SunOS"
PY_PLATNAME=	sunos${OS_VERSION:C/\..*//}
.elif ${OPSYS} == "HPUX"
PY_PLATNAME=	hp-ux11
.elif ${OPSYS} == "Linux"
PY_PLATNAME=	linux2
.elif ${OS_VARIANT} == "SCOOSR5"
PY_PLATNAME=	sco_sv3
.else
PY_PLATNAME=	${LOWER_OPSYS}${OS_VERSION:C/\..*//}
.endif

cvs diff -r1.17 -r1.18 pkgsrc/lang/python310/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python310/Makefile 2023/06/27 10:29:58 1.17
+++ pkgsrc/lang/python310/Makefile 2023/06/27 10:35:29 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.17 2023/06/27 10:29:58 riastradh Exp $ 1# $NetBSD: Makefile,v 1.18 2023/06/27 10:35:29 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python310-${PY_DISTVERSION} 5PKGNAME= python310-${PY_DISTVERSION}
6CATEGORIES= lang python 6CATEGORIES= lang python
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://www.python.org/ 9HOMEPAGE= https://www.python.org/
10COMMENT= Interpreted, interactive, object-oriented programming language 10COMMENT= Interpreted, interactive, object-oriented programming language
11LICENSE= python-software-foundation 11LICENSE= python-software-foundation
12 12
13CONFLICTS+= python-[0-9]* 13CONFLICTS+= python-[0-9]*
14 14
@@ -42,65 +42,58 @@ TOOL_DEPENDS+= ${PKGNAME}:../../${PKGPA @@ -42,65 +42,58 @@ TOOL_DEPENDS+= ${PKGNAME}:../../${PKGPA
42CONFIGURE_ARGS+= PYTHON_FOR_BUILD=${TOOLBASE:Q}/bin/python3.10 42CONFIGURE_ARGS+= PYTHON_FOR_BUILD=${TOOLBASE:Q}/bin/python3.10
43CONFIGURE_ARGS+= MACHDEP=${PY_PLATNAME} 43CONFIGURE_ARGS+= MACHDEP=${PY_PLATNAME}
44CONFIGURE_ARGS+= \ 44CONFIGURE_ARGS+= \
45 _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH} 45 _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
46CONFIGURE_ARGS+= ac_sys_system=${OPSYS} 46CONFIGURE_ARGS+= ac_sys_system=${OPSYS}
47. if ${OPSYS} == "OSF1" 47. if ${OPSYS} == "OSF1"
48CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=true 48CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=true
49. else 49. else
50CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=false 50CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=false
51. endif 51. endif
52CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptmx=yes 52CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptmx=yes
53CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptc=no 53CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptc=no
54MAKE_ENV+= \ 54MAKE_ENV+= \
 55 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_${PY_PLATNAME:Q}
 56MAKE_ENV+= \
55 _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH} 57 _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
56MAKE_ENV+= _PYTHON_PROJECT_BASE=${WRKSRC} 58MAKE_ENV+= _PYTHON_PROJECT_BASE=${WRKSRC}
57.endif 59.endif
58 60
59# http://bugs.python.org/issue13241 61# http://bugs.python.org/issue13241
60.if !empty(MACHINE_PLATFORM:MDarwin-1[12].*) 62.if !empty(MACHINE_PLATFORM:MDarwin-1[12].*)
61PKGSRC_COMPILER= clang 63PKGSRC_COMPILER= clang
62PKG_CC= clang 64PKG_CC= clang
63PKG_CXX= clang++ 65PKG_CXX= clang++
64.endif 66.endif
65 67
66# Used in socketmodule.c to determine if a sethostname declaration is required 68# Used in socketmodule.c to determine if a sethostname declaration is required
67CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION} 69CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION}
68LIBS.SunOS+= -lrt # fdatasync() 70LIBS.SunOS+= -lrt # fdatasync()
69LIBS.SunOS+= -luuid 71LIBS.SunOS+= -luuid
70.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100 72.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
71SUBST_CLASSES+= setup 73SUBST_CLASSES+= setup
72SUBST_MESSAGE.setup= Replacing crypt with crypt_i 74SUBST_MESSAGE.setup= Replacing crypt with crypt_i
73SUBST_STAGE.setup= pre-configure 75SUBST_STAGE.setup= pre-configure
74SUBST_FILES.setup= setup.py 76SUBST_FILES.setup= setup.py
75SUBST_SED.setup= -e "s,'crypt','crypt_i'," 77SUBST_SED.setup= -e "s,'crypt','crypt_i',"
76.endif 78.endif
77 79
78PY_VER_SUFFIX= 3.10 80PY_VER_SUFFIX= 3.10
79 81
80.if ${OPSYS} == "Darwin" 82.if ${OPSYS} == "Darwin"
81PY_PLATNAME= ${LOWER_OPSYS} 
82USE_TOOLS+= gmake 83USE_TOOLS+= gmake
83.elif ${OPSYS} == "IRIX" 
84PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} 
85.elif ${OPSYS} == "SunOS" 
86PY_PLATNAME= sunos${OS_VERSION:C/\..*//} 
87.elif ${OPSYS} == "HPUX" 
88PY_PLATNAME= hp-ux11 
89.elif ${OPSYS} == "Linux" 
90PY_PLATNAME= linux 
91.else 
92PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} 
93.endif 84.endif
 85
 86.include "platname.mk"
94PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} 87PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
95 88
96# For Xcode 5 and up, we need to search the SDK path for headers, otherwise 89# For Xcode 5 and up, we need to search the SDK path for headers, otherwise
97# certain modules will not be built. 90# certain modules will not be built.
98.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include) 91.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
99CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include 92CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include
100.endif 93.endif
101 94
102PLIST_VARS+= nis 95PLIST_VARS+= nis
103.for incdir in ${_OPSYS_INCLUDE_DIRS} 96.for incdir in ${_OPSYS_INCLUDE_DIRS}
104. if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h)) 97. if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h))
105HAVE_RPC_H= yes 98HAVE_RPC_H= yes
106. endif 99. endif

File Added: pkgsrc/lang/python310/platname.mk
#	$NetBSD: platname.mk,v 1.1 2023/06/27 10:35:29 riastradh Exp $

.if ${OPSYS} == "Darwin"
PY_PLATNAME=	${LOWER_OPSYS}
.elif ${OPSYS} == "IRIX"
PY_PLATNAME=	${LOWER_OPSYS:C/\..*//}
.elif ${OPSYS} == "SunOS"
PY_PLATNAME=	sunos${OS_VERSION:C/\..*//}
.elif ${OPSYS} == "HPUX"
PY_PLATNAME=	hp-ux11
.elif ${OPSYS} == "Linux"
PY_PLATNAME=	linux
.else
PY_PLATNAME=	${LOWER_OPSYS}${OS_VERSION:C/\..*//}
.endif

cvs diff -r1.6 -r1.7 pkgsrc/lang/python311/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python311/Makefile 2023/06/27 10:29:58 1.6
+++ pkgsrc/lang/python311/Makefile 2023/06/27 10:35:30 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.6 2023/06/27 10:29:58 riastradh Exp $ 1# $NetBSD: Makefile,v 1.7 2023/06/27 10:35:30 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python311-${PY_DISTVERSION} 5PKGNAME= python311-${PY_DISTVERSION}
6PKGREVISION= 1 6PKGREVISION= 1
7CATEGORIES= lang python 7CATEGORIES= lang python
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://www.python.org/ 10HOMEPAGE= https://www.python.org/
11COMMENT= Interpreted, interactive, object-oriented programming language 11COMMENT= Interpreted, interactive, object-oriented programming language
12LICENSE= python-software-foundation 12LICENSE= python-software-foundation
13 13
14CONFLICTS+= python-[0-9]* 14CONFLICTS+= python-[0-9]*
@@ -69,39 +69,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$ @@ -69,39 +69,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$
69LIBS.SunOS+= -lrt # fdatasync() 69LIBS.SunOS+= -lrt # fdatasync()
70LIBS.SunOS+= -luuid 70LIBS.SunOS+= -luuid
71.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100 71.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
72SUBST_CLASSES+= setup 72SUBST_CLASSES+= setup
73SUBST_MESSAGE.setup= Replacing crypt with crypt_i 73SUBST_MESSAGE.setup= Replacing crypt with crypt_i
74SUBST_STAGE.setup= pre-configure 74SUBST_STAGE.setup= pre-configure
75SUBST_FILES.setup= setup.py 75SUBST_FILES.setup= setup.py
76SUBST_SED.setup= -e "s,'crypt','crypt_i'," 76SUBST_SED.setup= -e "s,'crypt','crypt_i',"
77.endif 77.endif
78 78
79PY_VER_SUFFIX= 3.11 79PY_VER_SUFFIX= 3.11
80 80
81.if ${OPSYS} == "Darwin" 81.if ${OPSYS} == "Darwin"
82PY_PLATNAME= ${LOWER_OPSYS} 
83USE_TOOLS+= gmake 82USE_TOOLS+= gmake
84.elif ${OPSYS} == "IRIX" 
85PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} 
86.elif ${OPSYS} == "SunOS" 
87PY_PLATNAME= sunos${OS_VERSION:C/\..*//} 
88.elif ${OPSYS} == "HPUX" 
89PY_PLATNAME= hp-ux11 
90.elif ${OPSYS} == "Linux" 
91PY_PLATNAME= linux 
92.else 
93PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} 
94.endif 83.endif
 84
 85.include "platname.mk"
95PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} 86PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
96 87
97# For Xcode 5 and up, we need to search the SDK path for headers, otherwise 88# For Xcode 5 and up, we need to search the SDK path for headers, otherwise
98# certain modules will not be built. 89# certain modules will not be built.
99.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include) 90.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
100CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include 91CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include
101.endif 92.endif
102 93
103LDFLAGS.SunOS+= -lresolv 94LDFLAGS.SunOS+= -lresolv
104 95
105PLIST_VARS+= nis 96PLIST_VARS+= nis
106.for incdir in ${_OPSYS_INCLUDE_DIRS} 97.for incdir in ${_OPSYS_INCLUDE_DIRS}
107. if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h)) 98. if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h))

File Added: pkgsrc/lang/python311/platname.mk
#	$NetBSD: platname.mk,v 1.1 2023/06/27 10:35:30 riastradh Exp $

.if ${OPSYS} == "Darwin"
PY_PLATNAME=	${LOWER_OPSYS}
.elif ${OPSYS} == "IRIX"
PY_PLATNAME=	${LOWER_OPSYS:C/\..*//}
.elif ${OPSYS} == "SunOS"
PY_PLATNAME=	sunos${OS_VERSION:C/\..*//}
.elif ${OPSYS} == "HPUX"
PY_PLATNAME=	hp-ux11
.elif ${OPSYS} == "Linux"
PY_PLATNAME=	linux
.else
PY_PLATNAME=	${LOWER_OPSYS}${OS_VERSION:C/\..*//}
.endif

cvs diff -r1.36 -r1.37 pkgsrc/lang/python37/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python37/Makefile 2022/07/29 20:37:48 1.36
+++ pkgsrc/lang/python37/Makefile 2023/06/27 10:35:30 1.37
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.36 2022/07/29 20:37:48 jperkin Exp $ 1# $NetBSD: Makefile,v 1.37 2023/06/27 10:35:30 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python37-${PY_DISTVERSION} 5PKGNAME= python37-${PY_DISTVERSION}
6CATEGORIES= lang python 6CATEGORIES= lang python
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://www.python.org/ 9HOMEPAGE= https://www.python.org/
10COMMENT= Interpreted, interactive, object-oriented programming language 10COMMENT= Interpreted, interactive, object-oriented programming language
11LICENSE= python-software-foundation 11LICENSE= python-software-foundation
12 12
13CONFLICTS+= python-[0-9]* 13CONFLICTS+= python-[0-9]*
14 14
@@ -47,39 +47,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$ @@ -47,39 +47,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$
47# fdatasync() 47# fdatasync()
48LIBS.SunOS+= -lrt 48LIBS.SunOS+= -lrt
49.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100 49.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
50SUBST_CLASSES+= setup 50SUBST_CLASSES+= setup
51SUBST_MESSAGE.setup= Replacing crypt with crypt_i 51SUBST_MESSAGE.setup= Replacing crypt with crypt_i
52SUBST_STAGE.setup= pre-configure 52SUBST_STAGE.setup= pre-configure
53SUBST_FILES.setup= setup.py 53SUBST_FILES.setup= setup.py
54SUBST_SED.setup= -e "s,'crypt','crypt_i'," 54SUBST_SED.setup= -e "s,'crypt','crypt_i',"
55.endif 55.endif
56 56
57PY_VER_SUFFIX= 3.7 57PY_VER_SUFFIX= 3.7
58 58
59.if ${OPSYS} == "Darwin" 59.if ${OPSYS} == "Darwin"
60PY_PLATNAME= ${LOWER_OPSYS} 
61USE_TOOLS+= gmake 60USE_TOOLS+= gmake
62.elif ${OPSYS} == "IRIX" 
63PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} 
64.elif ${OPSYS} == "SunOS" 
65PY_PLATNAME= sunos${OS_VERSION:C/\..*//} 
66.elif ${OPSYS} == "HPUX" 
67PY_PLATNAME= hp-ux11 
68.elif ${OPSYS} == "Linux" 
69PY_PLATNAME= linux 
70.else 
71PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} 
72.endif 61.endif
 62
 63.include "platname.mk"
73PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} 64PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
74 65
75# ossaudiodev is only available on x86 for the following platforms 66# ossaudiodev is only available on x86 for the following platforms
76PLIST_VARS+= oss 67PLIST_VARS+= oss
77.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \ 68.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
78 (${PY_PLATNAME} == "linux" || ${OPSYS} == "FreeBSD") 69 (${PY_PLATNAME} == "linux" || ${OPSYS} == "FreeBSD")
79PLIST.oss= yes 70PLIST.oss= yes
80.endif 71.endif
81 72
82# For Xcode 5 and up, we need to search the SDK path for headers, otherwise 73# For Xcode 5 and up, we need to search the SDK path for headers, otherwise
83# certain modules will not be built. 74# certain modules will not be built.
84.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include) 75.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
85CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include 76CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include

File Added: pkgsrc/lang/python37/platname.mk
#	$NetBSD: platname.mk,v 1.1 2023/06/27 10:35:30 riastradh Exp $

.if ${OPSYS} == "Darwin"
PY_PLATNAME=	${LOWER_OPSYS}
.elif ${OPSYS} == "IRIX"
PY_PLATNAME=	${LOWER_OPSYS:C/\..*//}
.elif ${OPSYS} == "SunOS"
PY_PLATNAME=	sunos${OS_VERSION:C/\..*//}
.elif ${OPSYS} == "HPUX"
PY_PLATNAME=	hp-ux11
.elif ${OPSYS} == "Linux"
PY_PLATNAME=	linux
.else
PY_PLATNAME=	${LOWER_OPSYS}${OS_VERSION:C/\..*//}
.endif

cvs diff -r1.28 -r1.29 pkgsrc/lang/python38/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python38/Makefile 2022/03/19 18:56:44 1.28
+++ pkgsrc/lang/python38/Makefile 2023/06/27 10:35:30 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.28 2022/03/19 18:56:44 adam Exp $ 1# $NetBSD: Makefile,v 1.29 2023/06/27 10:35:30 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python38-${PY_DISTVERSION} 5PKGNAME= python38-${PY_DISTVERSION}
6CATEGORIES= lang python 6CATEGORIES= lang python
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://www.python.org/ 9HOMEPAGE= https://www.python.org/
10COMMENT= Interpreted, interactive, object-oriented programming language 10COMMENT= Interpreted, interactive, object-oriented programming language
11LICENSE= python-software-foundation 11LICENSE= python-software-foundation
12 12
13CONFLICTS+= python-[0-9]* 13CONFLICTS+= python-[0-9]*
14 14
@@ -49,39 +49,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$ @@ -49,39 +49,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$
49.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100 49.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
50SUBST_CLASSES+= setup 50SUBST_CLASSES+= setup
51SUBST_MESSAGE.setup= Replacing crypt with crypt_i 51SUBST_MESSAGE.setup= Replacing crypt with crypt_i
52SUBST_STAGE.setup= pre-configure 52SUBST_STAGE.setup= pre-configure
53SUBST_FILES.setup= setup.py 53SUBST_FILES.setup= setup.py
54SUBST_SED.setup= -e "s,'crypt','crypt_i'," 54SUBST_SED.setup= -e "s,'crypt','crypt_i',"
55.endif 55.endif
56 56
57LIBS.SunOS+= -lrt # fdatasync() 57LIBS.SunOS+= -lrt # fdatasync()
58 58
59PY_VER_SUFFIX= 3.8 59PY_VER_SUFFIX= 3.8
60 60
61.if ${OPSYS} == "Darwin" 61.if ${OPSYS} == "Darwin"
62PY_PLATNAME= ${LOWER_OPSYS} 
63USE_TOOLS+= gmake 62USE_TOOLS+= gmake
64.elif ${OPSYS} == "IRIX" 
65PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} 
66.elif ${OPSYS} == "SunOS" 
67PY_PLATNAME= sunos${OS_VERSION:C/\..*//} 
68.elif ${OPSYS} == "HPUX" 
69PY_PLATNAME= hp-ux11 
70.elif ${OPSYS} == "Linux" 
71PY_PLATNAME= linux 
72.else 
73PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} 
74.endif 63.endif
 64
 65.include "platname.mk"
75PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} 66PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
76 67
77# ossaudiodev is only available on x86 for the following platforms 68# ossaudiodev is only available on x86 for the following platforms
78PLIST_VARS+= oss 69PLIST_VARS+= oss
79.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \ 70.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
80 (${PY_PLATNAME} == "linux" || ${OPSYS} == "FreeBSD") 71 (${PY_PLATNAME} == "linux" || ${OPSYS} == "FreeBSD")
81PLIST.oss= yes 72PLIST.oss= yes
82.endif 73.endif
83 74
84# For Xcode 5 and up, we need to search the SDK path for headers, otherwise 75# For Xcode 5 and up, we need to search the SDK path for headers, otherwise
85# certain modules will not be built. 76# certain modules will not be built.
86.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include) 77.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
87CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include 78CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include

File Added: pkgsrc/lang/python38/platname.mk
#	$NetBSD: platname.mk,v 1.1 2023/06/27 10:35:30 riastradh Exp $

.if ${OPSYS} == "Darwin"
PY_PLATNAME=	${LOWER_OPSYS}
.elif ${OPSYS} == "IRIX"
PY_PLATNAME=	${LOWER_OPSYS:C/\..*//}
.elif ${OPSYS} == "SunOS"
PY_PLATNAME=	sunos${OS_VERSION:C/\..*//}
.elif ${OPSYS} == "HPUX"
PY_PLATNAME=	hp-ux11
.elif ${OPSYS} == "Linux"
PY_PLATNAME=	linux
.else
PY_PLATNAME=	${LOWER_OPSYS}${OS_VERSION:C/\..*//}
.endif

cvs diff -r1.23 -r1.24 pkgsrc/lang/python39/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python39/Makefile 2023/06/27 10:29:58 1.23
+++ pkgsrc/lang/python39/Makefile 2023/06/27 10:35:30 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.23 2023/06/27 10:29:58 riastradh Exp $ 1# $NetBSD: Makefile,v 1.24 2023/06/27 10:35:30 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python39-${PY_DISTVERSION} 5PKGNAME= python39-${PY_DISTVERSION}
6CATEGORIES= lang python 6CATEGORIES= lang python
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://www.python.org/ 9HOMEPAGE= https://www.python.org/
10COMMENT= Interpreted, interactive, object-oriented programming language 10COMMENT= Interpreted, interactive, object-oriented programming language
11LICENSE= python-software-foundation 11LICENSE= python-software-foundation
12 12
13CONFLICTS+= python-[0-9]* 13CONFLICTS+= python-[0-9]*
14 14
@@ -68,39 +68,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$ @@ -68,39 +68,30 @@ CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=$
68LIBS.SunOS+= -lrt # fdatasync() 68LIBS.SunOS+= -lrt # fdatasync()
69LIBS.SunOS+= -luuid 69LIBS.SunOS+= -luuid
70.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100 70.if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
71SUBST_CLASSES+= setup 71SUBST_CLASSES+= setup
72SUBST_MESSAGE.setup= Replacing crypt with crypt_i 72SUBST_MESSAGE.setup= Replacing crypt with crypt_i
73SUBST_STAGE.setup= pre-configure 73SUBST_STAGE.setup= pre-configure
74SUBST_FILES.setup= setup.py 74SUBST_FILES.setup= setup.py
75SUBST_SED.setup= -e "s,'crypt','crypt_i'," 75SUBST_SED.setup= -e "s,'crypt','crypt_i',"
76.endif 76.endif
77 77
78PY_VER_SUFFIX= 3.9 78PY_VER_SUFFIX= 3.9
79 79
80.if ${OPSYS} == "Darwin" 80.if ${OPSYS} == "Darwin"
81PY_PLATNAME= ${LOWER_OPSYS} 
82USE_TOOLS+= gmake 81USE_TOOLS+= gmake
83.elif ${OPSYS} == "IRIX" 
84PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} 
85.elif ${OPSYS} == "SunOS" 
86PY_PLATNAME= sunos${OS_VERSION:C/\..*//} 
87.elif ${OPSYS} == "HPUX" 
88PY_PLATNAME= hp-ux11 
89.elif ${OPSYS} == "Linux" 
90PY_PLATNAME= linux 
91.else 
92PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} 
93.endif 82.endif
 83
 84.include "platname.mk"
94PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} 85PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
95 86
96# For Xcode 5 and up, we need to search the SDK path for headers, otherwise 87# For Xcode 5 and up, we need to search the SDK path for headers, otherwise
97# certain modules will not be built. 88# certain modules will not be built.
98.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include) 89.if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
99CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include 90CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include
100.endif 91.endif
101 92
102PLIST_VARS+= nis 93PLIST_VARS+= nis
103.for incdir in ${_OPSYS_INCLUDE_DIRS} 94.for incdir in ${_OPSYS_INCLUDE_DIRS}
104. if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h)) 95. if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h))
105HAVE_RPC_H= yes 96HAVE_RPC_H= yes
106. endif 97. endif

File Added: pkgsrc/lang/python39/platname.mk
#	$NetBSD: platname.mk,v 1.1 2023/06/27 10:35:30 riastradh Exp $

.if ${OPSYS} == "Darwin"
PY_PLATNAME=	${LOWER_OPSYS}
.elif ${OPSYS} == "IRIX"
PY_PLATNAME=	${LOWER_OPSYS:C/\..*//}
.elif ${OPSYS} == "SunOS"
PY_PLATNAME=	sunos${OS_VERSION:C/\..*//}
.elif ${OPSYS} == "HPUX"
PY_PLATNAME=	hp-ux11
.elif ${OPSYS} == "Linux"
PY_PLATNAME=	linux
.else
PY_PLATNAME=	${LOWER_OPSYS}${OS_VERSION:C/\..*//}
.endif