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