Annotation of pkgsrc/lang/python310/Makefile, revision 1.16
1.16 ! adam 1: # $NetBSD: Makefile,v 1.15 2022/08/02 18:27:22 adam 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.13 riastrad 39: .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
40: TOOL_DEPENDS+= ${PKGNAME}:../../${PKGPATH}
41: # XXX copied from ../../lang/python/pyversion.mk to avoid including it
42: # XXX should use NATIVE_PREFIX but we don't have that
1.16 ! adam 43: CONFIGURE_ARGS+= PYTHON_FOR_BUILD=${PREFIX}/bin/python3.10
1.13 riastrad 44: CONFIGURE_ARGS+= MACHDEP=${PY_PLATNAME}
45: CONFIGURE_ARGS+= \
46: _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
47: CONFIGURE_ARGS+= ac_sys_system=${OPSYS}
48: . if ${OPSYS} == "OSF1"
49: CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=true
50: . else
51: CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=false
52: . endif
53: CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptmx=yes
54: CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptc=no
55: MAKE_ENV+= \
56: _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
1.16 ! adam 57: MAKE_ENV+= _PYTHON_PROJECT_BASE=${WRKSRC}
1.13 riastrad 58: .endif
59:
1.1 adam 60: # http://bugs.python.org/issue13241
1.11 schmonz 61: .if !empty(MACHINE_PLATFORM:MDarwin-1[12].*)
1.1 adam 62: PKGSRC_COMPILER= clang
63: PKG_CC= clang
64: PKG_CXX= clang++
65: .endif
66:
1.8 jperkin 67: # Used in socketmodule.c to determine if a sethostname declaration is required
1.10 jperkin 68: CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION}
1.8 jperkin 69: LIBS.SunOS+= -lrt # fdatasync()
70: LIBS.SunOS+= -luuid
71: .if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100
72: SUBST_CLASSES+= setup
73: SUBST_MESSAGE.setup= Replacing crypt with crypt_i
74: SUBST_STAGE.setup= pre-configure
75: SUBST_FILES.setup= setup.py
76: SUBST_SED.setup= -e "s,'crypt','crypt_i',"
77: .endif
1.1 adam 78:
79: PY_VER_SUFFIX= 3.10
80:
81: .if ${OPSYS} == "Darwin"
82: PY_PLATNAME= ${LOWER_OPSYS}
83: USE_TOOLS+= gmake
84: .elif ${OPSYS} == "IRIX"
85: PY_PLATNAME= ${LOWER_OPSYS:C/\..*//}
86: .elif ${OPSYS} == "SunOS"
87: PY_PLATNAME= sunos${OS_VERSION:C/\..*//}
88: .elif ${OPSYS} == "HPUX"
89: PY_PLATNAME= hp-ux11
90: .elif ${OPSYS} == "Linux"
91: PY_PLATNAME= linux
92: .else
93: PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//}
94: .endif
95: PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
96:
97: # For Xcode 5 and up, we need to search the SDK path for headers, otherwise
98: # certain modules will not be built.
99: .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
100: CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include
101: .endif
102:
103: PLIST_VARS+= nis
104: .for incdir in ${_OPSYS_INCLUDE_DIRS}
105: . if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h))
106: HAVE_RPC_H= yes
107: . endif
108: . if (exists(${incdir}/rpcsvc/yp_prot.h) || exists(${incdir}/nsl/rpcsvc/yp_prot.h))
109: HAVE_YP_PROT_H= yes
110: . endif
111: .endfor
112: .if (${HAVE_RPC_H:Uno} == yes && ${HAVE_YP_PROT_H:Uno} == yes)
113: PLIST.nis= yes
114: .endif
115:
116: PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
117:
118: PRINT_PLIST_AWK+= { gsub(/${PY_PLATNAME}/, "$${PY_PLATNAME}") }
119: PRINT_PLIST_AWK+= { gsub(/python${PY_VER_SUFFIX}/, \
120: "python$${PY_VER_SUFFIX}") }
121:
122: TEST_TARGET= test
123: INSTALL_TARGET= altinstall
124:
125: REPLACE_INTERPRETER+= python
126: REPLACE.python.old= .*python[^ ]*
127: REPLACE.python.new= ${PREFIX}/bin/python${PY_VER_SUFFIX}
128: REPLACE_FILES.python+= Lib/base64.py
129: REPLACE_FILES.python+= Lib/cProfile.py
130: REPLACE_FILES.python+= Lib/cgi.py
131: REPLACE_FILES.python+= Lib/encodings/rot_13.py
132: REPLACE_FILES.python+= Lib/idlelib/pyshell.py
133: REPLACE_FILES.python+= Lib/keyword.py
134: REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py
135: REPLACE_FILES.python+= Lib/lib2to3/tests/data/different_encoding.py
136: REPLACE_FILES.python+= Lib/lib2to3/tests/data/false_encoding.py
137: REPLACE_FILES.python+= Lib/lib2to3/tests/pytree_idempotency.py
138: REPLACE_FILES.python+= Lib/pdb.py
139: REPLACE_FILES.python+= Lib/platform.py
140: REPLACE_FILES.python+= Lib/profile.py
141: REPLACE_FILES.python+= Lib/pydoc.py
142: REPLACE_FILES.python+= Lib/quopri.py
143: REPLACE_FILES.python+= Lib/smtpd.py
144: REPLACE_FILES.python+= Lib/smtplib.py
145: REPLACE_FILES.python+= Lib/tabnanny.py
146: REPLACE_FILES.python+= Lib/tarfile.py
147: REPLACE_FILES.python+= Lib/test/bisect_cmd.py
148: REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py
149: REPLACE_FILES.python+= Lib/test/curses_tests.py
150: REPLACE_FILES.python+= Lib/test/re_tests.py
151: REPLACE_FILES.python+= Lib/test/regrtest.py
152: REPLACE_FILES.python+= Lib/timeit.py
153: REPLACE_FILES.python+= Lib/trace.py
154: REPLACE_FILES.python+= Lib/turtledemo/__main__.py
155: REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py
156: REPLACE_FILES.python+= Lib/turtledemo/clock.py
157: REPLACE_FILES.python+= Lib/turtledemo/forest.py
158: REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py
159: REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py
160: REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py
161: REPLACE_FILES.python+= Lib/turtledemo/paint.py
162: REPLACE_FILES.python+= Lib/turtledemo/peace.py
163: REPLACE_FILES.python+= Lib/turtledemo/penrose.py
164: REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py
165: REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py
166: REPLACE_FILES.python+= Lib/turtledemo/tree.py
167: REPLACE_FILES.python+= Lib/turtledemo/yinyang.py
168: REPLACE_FILES.python+= Lib/uu.py
169: REPLACE_FILES.python+= Lib/webbrowser.py
170:
1.9 jperkin 171: REPLACE_SH+= Misc/python-config.sh.in
172:
1.1 adam 173: # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
174: # Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));'
175: SUBST_CLASSES+= findlib
176: SUBST_MESSAGE.findlib= Fixing find_library().
177: SUBST_STAGE.findlib= pre-configure
178: SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py
179: SUBST_FILES.findlib+= Lib/ctypes/util.py
180: SUBST_FILES.findlib+= Lib/distutils/unixccompiler.py
181: SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},'
182: SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
183: SUBST_NOOP_OK.findlib= yes
184:
185: SUBST_CLASSES+= pkgversion
186: SUBST_STAGE.pkgversion= pre-configure
187: SUBST_FILES.pkgversion= Lib/lib2to3/pgen2/driver.py
188: SUBST_VARS.pkgversion= PKGVERSION_NOREV
189:
190: .include "options.mk"
191:
192: CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
193: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_z64
194: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip
195: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh
196:
197: # contain CONFIGURE_ARGS and CONFIGURE_ENV
198: CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/_sysconfigdata*
199: CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/__pycache__/_sysconfigdata*
200: CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/config-${PY_VER_SUFFIX}/Makefile
201:
202: # Avoid error: Cannot generate ./Include/opcode.h, python not found !
203: post-configure:
204: touch ${WRKSRC}/Include/opcode.h
205:
206: .if ${OPSYS} == "HPUX"
1.5 wiz 207: post-install: hpux-postinstall
208: .PHONY: hpux-postinstall
209: hpux-postinstall:
1.1 adam 210: ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.10.sl \
211: ${DESTDIR}${PREFIX}/lib/libpython3.10.sl.1.0
212: .endif
213:
1.12 adam 214: INSTALLATION_DIRS+= lib/python${PY_VER_SUFFIX}/site-packages
215:
216: pre-install: setuptools-preinstall
217: .PHONY: setuptools-preinstall
218: setuptools-preinstall:
1.5 wiz 219: ${INSTALL_DATA} ${.CURDIR}/../../devel/py-setuptools/files/_distutils_system_mod \
220: ${DESTDIR}${PREFIX}/lib/python${PY_VER_SUFFIX}/site-packages/_distutils_system_mod.py
221:
1.1 adam 222: # needed to make devel/py-readline pick up the correct readline implementation
223: BUILDLINK_DEPMETHOD.readline= build
224:
225: .include "../../archivers/bzip2/buildlink3.mk"
226: .include "../../archivers/xz/buildlink3.mk"
227: .include "../../devel/gettext-lib/buildlink3.mk"
228: .include "../../devel/libffi/buildlink3.mk"
229: .include "../../devel/libuuid/buildlink3.mk"
230: .include "../../devel/readline/buildlink3.mk"
231: .include "../../devel/zlib/buildlink3.mk"
232: .include "../../security/openssl/buildlink3.mk"
233: .include "../../mk/bdb.buildlink3.mk"
234: .include "../../mk/dlopen.buildlink3.mk"
235: .include "../../mk/oss.buildlink3.mk"
236: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>