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