Annotation of pkgsrc/lang/python310/Makefile, revision 1.19
1.19 ! riastrad 1: # $NetBSD: Makefile,v 1.18 2023/06/27 10:35:29 riastradh Exp $
1.1 adam 2:
3: .include "dist.mk"
4:
5: PKGNAME= python310-${PY_DISTVERSION}
6: CATEGORIES= lang python
7:
8: MAINTAINER= pkgsrc-users@NetBSD.org
9: HOMEPAGE= https://www.python.org/
10: COMMENT= Interpreted, interactive, object-oriented programming language
11: LICENSE= python-software-foundation
12:
13: CONFLICTS+= python-[0-9]*
14:
15: PLIST_AWK= -f ${PKGSRCDIR}/lang/python/plist-python.awk
16: PLIST_AWK_ENV+= PYVERS=310
17: PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ {
18: PRINT_PLIST_AWK+= sub(/__pycache__\//, "")
19: PRINT_PLIST_AWK+= sub(/\.cpython-310/, "")}
20: PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
21: PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")}
22:
23: USE_LANGUAGES= c c++
24: USE_TOOLS+= pkg-config
25: GNU_CONFIGURE= yes
26: CONFIGURE_ARGS+= --enable-shared
27: CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
28: CONFIGURE_ARGS+= --with-system-ffi
29: CONFIGURE_ARGS+= --without-ensurepip
30: CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q}
31: CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
32: PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in
33:
34: PTHREAD_OPTS+= require
35: .include "../../mk/pthread.buildlink3.mk"
36:
37: .include "../../mk/bsd.prefs.mk"
38:
1.17 riastrad 39: .if ${USE_CROSS_COMPILE:U:tl} == "yes"
1.13 riastrad 40: TOOL_DEPENDS+= ${PKGNAME}:../../${PKGPATH}
1.17 riastrad 41: CONFIGURE_ARGS+= PYTHON_FOR_BUILD=${TOOLBASE:Q}/bin/python3.10
1.13 riastrad 42: CONFIGURE_ARGS+= MACHDEP=${PY_PLATNAME}
43: CONFIGURE_ARGS+= ac_sys_system=${OPSYS}
44: . if ${OPSYS} == "OSF1"
45: CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=true
46: . else
47: CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=false
48: . endif
49: CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptmx=yes
50: CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptc=no
1.19 ! riastrad 51: ALL_ENV+= \
! 52: _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
! 53: ALL_ENV+= \
! 54: _PYTHON_PROJECT_BASE=${WRKSRC:Q}
! 55: ALL_ENV+= \
1.18 riastrad 56: _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_${PY_PLATNAME:Q}
1.13 riastrad 57: .endif
58:
1.1 adam 59: # http://bugs.python.org/issue13241
1.11 schmonz 60: .if !empty(MACHINE_PLATFORM:MDarwin-1[12].*)
1.1 adam 61: PKGSRC_COMPILER= clang
62: PKG_CC= clang
63: PKG_CXX= clang++
64: .endif
65:
1.8 jperkin 66: # Used in socketmodule.c to determine if a sethostname declaration is required
1.10 jperkin 67: CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION}
1.8 jperkin 68: LIBS.SunOS+= -lrt # fdatasync()
69: LIBS.SunOS+= -luuid
70: .if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
71: SUBST_CLASSES+= setup
72: SUBST_MESSAGE.setup= Replacing crypt with crypt_i
73: SUBST_STAGE.setup= pre-configure
74: SUBST_FILES.setup= setup.py
75: SUBST_SED.setup= -e "s,'crypt','crypt_i',"
76: .endif
1.1 adam 77:
78: PY_VER_SUFFIX= 3.10
79:
80: .if ${OPSYS} == "Darwin"
81: USE_TOOLS+= gmake
82: .endif
1.18 riastrad 83:
84: .include "platname.mk"
1.1 adam 85: PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
86:
87: # For Xcode 5 and up, we need to search the SDK path for headers, otherwise
88: # certain modules will not be built.
89: .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
90: CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include
91: .endif
92:
93: PLIST_VARS+= nis
94: .for incdir in ${_OPSYS_INCLUDE_DIRS}
95: . if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h))
96: HAVE_RPC_H= yes
97: . endif
98: . if (exists(${incdir}/rpcsvc/yp_prot.h) || exists(${incdir}/nsl/rpcsvc/yp_prot.h))
99: HAVE_YP_PROT_H= yes
100: . endif
101: .endfor
102: .if (${HAVE_RPC_H:Uno} == yes && ${HAVE_YP_PROT_H:Uno} == yes)
103: PLIST.nis= yes
104: .endif
105:
106: PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
107:
108: PRINT_PLIST_AWK+= { gsub(/${PY_PLATNAME}/, "$${PY_PLATNAME}") }
109: PRINT_PLIST_AWK+= { gsub(/python${PY_VER_SUFFIX}/, \
110: "python$${PY_VER_SUFFIX}") }
111:
112: TEST_TARGET= test
113: INSTALL_TARGET= altinstall
114:
115: REPLACE_INTERPRETER+= python
116: REPLACE.python.old= .*python[^ ]*
117: REPLACE.python.new= ${PREFIX}/bin/python${PY_VER_SUFFIX}
118: REPLACE_FILES.python+= Lib/base64.py
119: REPLACE_FILES.python+= Lib/cProfile.py
120: REPLACE_FILES.python+= Lib/cgi.py
121: REPLACE_FILES.python+= Lib/encodings/rot_13.py
122: REPLACE_FILES.python+= Lib/idlelib/pyshell.py
123: REPLACE_FILES.python+= Lib/keyword.py
124: REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py
125: REPLACE_FILES.python+= Lib/lib2to3/tests/data/different_encoding.py
126: REPLACE_FILES.python+= Lib/lib2to3/tests/data/false_encoding.py
127: REPLACE_FILES.python+= Lib/lib2to3/tests/pytree_idempotency.py
128: REPLACE_FILES.python+= Lib/pdb.py
129: REPLACE_FILES.python+= Lib/platform.py
130: REPLACE_FILES.python+= Lib/profile.py
131: REPLACE_FILES.python+= Lib/pydoc.py
132: REPLACE_FILES.python+= Lib/quopri.py
133: REPLACE_FILES.python+= Lib/smtpd.py
134: REPLACE_FILES.python+= Lib/smtplib.py
135: REPLACE_FILES.python+= Lib/tabnanny.py
136: REPLACE_FILES.python+= Lib/tarfile.py
137: REPLACE_FILES.python+= Lib/test/bisect_cmd.py
138: REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py
139: REPLACE_FILES.python+= Lib/test/curses_tests.py
140: REPLACE_FILES.python+= Lib/test/re_tests.py
141: REPLACE_FILES.python+= Lib/test/regrtest.py
142: REPLACE_FILES.python+= Lib/timeit.py
143: REPLACE_FILES.python+= Lib/trace.py
144: REPLACE_FILES.python+= Lib/turtledemo/__main__.py
145: REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py
146: REPLACE_FILES.python+= Lib/turtledemo/clock.py
147: REPLACE_FILES.python+= Lib/turtledemo/forest.py
148: REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py
149: REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py
150: REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py
151: REPLACE_FILES.python+= Lib/turtledemo/paint.py
152: REPLACE_FILES.python+= Lib/turtledemo/peace.py
153: REPLACE_FILES.python+= Lib/turtledemo/penrose.py
154: REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py
155: REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py
156: REPLACE_FILES.python+= Lib/turtledemo/tree.py
157: REPLACE_FILES.python+= Lib/turtledemo/yinyang.py
158: REPLACE_FILES.python+= Lib/uu.py
159: REPLACE_FILES.python+= Lib/webbrowser.py
160:
1.9 jperkin 161: REPLACE_SH+= Misc/python-config.sh.in
162:
1.1 adam 163: # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
164: # Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));'
165: SUBST_CLASSES+= findlib
166: SUBST_MESSAGE.findlib= Fixing find_library().
167: SUBST_STAGE.findlib= pre-configure
168: SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py
169: SUBST_FILES.findlib+= Lib/ctypes/util.py
170: SUBST_FILES.findlib+= Lib/distutils/unixccompiler.py
171: SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},'
172: SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
173: SUBST_NOOP_OK.findlib= yes
174:
175: SUBST_CLASSES+= pkgversion
176: SUBST_STAGE.pkgversion= pre-configure
177: SUBST_FILES.pkgversion= Lib/lib2to3/pgen2/driver.py
178: SUBST_VARS.pkgversion= PKGVERSION_NOREV
179:
180: .include "options.mk"
181:
182: CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
183: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_z64
184: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip
185: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh
186:
187: # contain CONFIGURE_ARGS and CONFIGURE_ENV
188: CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/_sysconfigdata*
189: CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/__pycache__/_sysconfigdata*
190: CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/config-${PY_VER_SUFFIX}/Makefile
191:
192: # Avoid error: Cannot generate ./Include/opcode.h, python not found !
193: post-configure:
194: touch ${WRKSRC}/Include/opcode.h
195:
196: .if ${OPSYS} == "HPUX"
1.5 wiz 197: post-install: hpux-postinstall
198: .PHONY: hpux-postinstall
199: hpux-postinstall:
1.1 adam 200: ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.10.sl \
201: ${DESTDIR}${PREFIX}/lib/libpython3.10.sl.1.0
202: .endif
203:
1.12 adam 204: INSTALLATION_DIRS+= lib/python${PY_VER_SUFFIX}/site-packages
205:
206: pre-install: setuptools-preinstall
207: .PHONY: setuptools-preinstall
208: setuptools-preinstall:
1.5 wiz 209: ${INSTALL_DATA} ${.CURDIR}/../../devel/py-setuptools/files/_distutils_system_mod \
210: ${DESTDIR}${PREFIX}/lib/python${PY_VER_SUFFIX}/site-packages/_distutils_system_mod.py
211:
1.1 adam 212: # needed to make devel/py-readline pick up the correct readline implementation
213: BUILDLINK_DEPMETHOD.readline= build
214:
215: .include "../../archivers/bzip2/buildlink3.mk"
216: .include "../../archivers/xz/buildlink3.mk"
217: .include "../../devel/gettext-lib/buildlink3.mk"
218: .include "../../devel/libffi/buildlink3.mk"
219: .include "../../devel/libuuid/buildlink3.mk"
220: .include "../../devel/readline/buildlink3.mk"
221: .include "../../devel/zlib/buildlink3.mk"
222: .include "../../security/openssl/buildlink3.mk"
223: .include "../../mk/bdb.buildlink3.mk"
224: .include "../../mk/dlopen.buildlink3.mk"
225: .include "../../mk/oss.buildlink3.mk"
226: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>