Annotation of pkgsrc/lang/python312/Makefile, revision 1.26
1.26 ! riastrad 1: # $NetBSD: Makefile,v 1.25 2025/01/07 19:34:41 riastradh Exp $
1.1 adam 2:
1.24 wiz 3: PKGREVISION= 2
1.1 adam 4: .include "dist.mk"
5:
6: PKGNAME= python312-${PY_DISTVERSION}
7: CATEGORIES= lang python
8:
9: MAINTAINER= pkgsrc-users@NetBSD.org
10: HOMEPAGE= https://www.python.org/
11: COMMENT= Interpreted, interactive, object-oriented programming language
12: LICENSE= python-software-foundation
13:
14: CONFLICTS+= python-[0-9]*
1.2 wiz 15: CONFLICTS+= py312-cElementTree-[0-9]*
16: CONFLICTS+= py312-curses-[0-9]*
17: CONFLICTS+= py312-cursespanel-[0-9]*
18: CONFLICTS+= py312-expat-[0-9]*
19: CONFLICTS+= py312-readline-[0-9]*
20: CONFLICTS+= py312-sqlite3-[0-9]*
1.3 wiz 21: SUPERSEDES+= py312-cElementTree-[0-9]*
22: SUPERSEDES+= py312-curses-[0-9]*
23: SUPERSEDES+= py312-cursespanel-[0-9]*
24: SUPERSEDES+= py312-expat-[0-9]*
25: SUPERSEDES+= py312-readline-[0-9]*
26: SUPERSEDES+= py312-sqlite3-[0-9]*
1.1 adam 27:
28: PLIST_AWK= -f ${PKGSRCDIR}/lang/python/plist-python.awk
29: PLIST_AWK_ENV+= PYVERS=312
30: PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ {
31: PRINT_PLIST_AWK+= sub(/__pycache__\//, "")
32: PRINT_PLIST_AWK+= sub(/\.cpython-312/, "")}
33: PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
34: PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")}
35:
36: USE_LANGUAGES= c c++
37: USE_TOOLS+= pkg-config
1.7 nia 38: USE_CC_FEATURES+= c11
1.1 adam 39: GNU_CONFIGURE= yes
40: CONFIGURE_ARGS+= --enable-shared
41: CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
1.4 wiz 42: CONFIGURE_ARGS+= --with-system-expat
1.1 adam 43: CONFIGURE_ARGS+= --without-ensurepip
44: CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q}
45: CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
46: CONFIGURE_ENV+= py_cv_module__gdbm="n/a"
1.2 wiz 47: # example module
1.1 adam 48: CONFIGURE_ENV+= py_cv_module_xxlimited="n/a"
49: PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in
50:
1.2 wiz 51: # libpanelw seems to be a Linux thing?
52: SUBST_CLASSES+= panel
53: SUBST_MESSAGE.panel= Replacing panelw with panel.
54: SUBST_STAGE.panel= pre-configure
55: SUBST_FILES.panel+= configure
56: SUBST_SED.panel+= -e "s,panelw,panel,"
57:
1.1 adam 58: PTHREAD_OPTS+= require
59: .include "../../mk/pthread.buildlink3.mk"
60:
61: .include "../../mk/bsd.prefs.mk"
62:
1.16 cheusov 63: # NetBSD-8 curses has enough support for py-curses
64: USE_CURSES= getsyx update_panels wide
65: # But we build as ncurses still to get the full feature set easily
66: .if ${OPSYS} == "NetBSD"
67: FAKE_NCURSES= yes
68: .endif
69:
1.26 ! riastrad 70: .if ${USE_CROSS_COMPILE:tl} == yes
1.1 adam 71: TOOL_DEPENDS+= ${PKGNAME}:../../${PKGPATH}
1.25 riastrad 72: CONFIGURE_ARGS+= \
73: --with-build-python=${TOOLBASE:Q}/bin/python${PY_VER_SUFFIX}
1.1 adam 74: CONFIGURE_ARGS+= MACHDEP=${PY_PLATNAME}
75: CONFIGURE_ARGS+= \
76: _PYTHON_HOST_PLATFORM=${LOWER_OPSYS}-${MACHINE_GNU_ARCH}
77: CONFIGURE_ARGS+= ac_sys_system=${OPSYS}
78: . if ${OPSYS} == "OSF1"
79: CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=true
80: . else
81: CONFIGURE_ARGS+= ac_cv_buggy_getaddrinfo=false
82: . endif
83: CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptmx=yes
84: CONFIGURE_ARGS.NetBSD+= ac_cv_file__dev_ptc=no
85: .endif
86:
87: # http://bugs.python.org/issue13241
88: .if ${MACHINE_PLATFORM:MDarwin-1[12].*}
89: PKGSRC_COMPILER= clang
90: PKG_CC= clang
91: PKG_CXX= clang++
92: .endif
93:
94: # Used in socketmodule.c to determine if a sethostname declaration is required
95: CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION}
96: LIBS.SunOS+= -lrt # fdatasync()
97:
1.15 charlott 98: LIBS.DragonFly+= -lcrypt
1.1 adam 99: LIBS.NetBSD+= -lcrypt
100:
101: PY_VER_SUFFIX= 3.12
102:
103: .if ${OPSYS} == "Darwin"
104: USE_TOOLS+= gmake
105: .endif
106:
107: .include "platname.mk"
108: PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
109:
110: # For Xcode 5 and up, we need to search the SDK path for headers, otherwise
111: # certain modules will not be built.
112: .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include)
113: CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include
114: .endif
115:
116: LDFLAGS.SunOS+= -lresolv
117:
1.16 cheusov 118: PLIST_VARS+= nis tkinter
1.1 adam 119: .for incdir in ${_OPSYS_INCLUDE_DIRS}
1.13 thor 120: . if exists(${incdir}/rpc/rpc.h)
121: HAVE_RPC_H= yes
122: . elif exists(${incdir}/tirpc/rpc/rpc.h)
123: CPPFLAGS+= -I${incdir}/tirpc
1.1 adam 124: HAVE_RPC_H= yes
125: . endif
1.13 thor 126: . if exists(${incdir}/rpcsvc/yp_prot.h)
127: HAVE_YP_PROT_H= yes
128: . elif exists(${incdir}/nsl/rpcsvc/yp_prot.h)
129: CPPFLAGS+= -I${incdir}/nsl
1.1 adam 130: HAVE_YP_PROT_H= yes
131: . endif
132: .endfor
133: .if (${HAVE_RPC_H:Uno} == yes && ${HAVE_YP_PROT_H:Uno} == yes)
134: PLIST.nis= yes
135: .endif
136:
137: PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
138:
139: PRINT_PLIST_AWK+= { gsub(/${PY_PLATNAME}/, "$${PY_PLATNAME}") }
140: PRINT_PLIST_AWK+= { gsub(/python${PY_VER_SUFFIX}/, \
141: "python$${PY_VER_SUFFIX}") }
142:
143: TEST_TARGET= test
144: INSTALL_TARGET= altinstall
145:
146: REPLACE_INTERPRETER+= python
147: REPLACE.python.old= .*python[^ ]*
148: REPLACE.python.new= ${PREFIX}/bin/python${PY_VER_SUFFIX}
149: REPLACE_FILES.python+= Lib/base64.py
150: REPLACE_FILES.python+= Lib/cProfile.py
151: REPLACE_FILES.python+= Lib/cgi.py
152: REPLACE_FILES.python+= Lib/encodings/rot_13.py
153: REPLACE_FILES.python+= Lib/idlelib/pyshell.py
154: REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py
155: REPLACE_FILES.python+= Lib/pdb.py
156: REPLACE_FILES.python+= Lib/platform.py
157: REPLACE_FILES.python+= Lib/profile.py
158: REPLACE_FILES.python+= Lib/pydoc.py
159: REPLACE_FILES.python+= Lib/quopri.py
160: REPLACE_FILES.python+= Lib/smtplib.py
161: REPLACE_FILES.python+= Lib/tabnanny.py
162: REPLACE_FILES.python+= Lib/tarfile.py
163: REPLACE_FILES.python+= Lib/test/bisect_cmd.py
164: REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py
165: REPLACE_FILES.python+= Lib/test/curses_tests.py
166: REPLACE_FILES.python+= Lib/test/re_tests.py
167: REPLACE_FILES.python+= Lib/test/regrtest.py
1.14 adam 168: REPLACE_FILES.python+= Lib/test/support/smtpd.py
1.1 adam 169: REPLACE_FILES.python+= Lib/test/test_lib2to3/data/different_encoding.py
170: REPLACE_FILES.python+= Lib/test/test_lib2to3/data/false_encoding.py
171: REPLACE_FILES.python+= Lib/test/test_lib2to3/pytree_idempotency.py
172: REPLACE_FILES.python+= Lib/timeit.py
173: REPLACE_FILES.python+= Lib/trace.py
174: REPLACE_FILES.python+= Lib/turtledemo/__main__.py
175: REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py
176: REPLACE_FILES.python+= Lib/turtledemo/clock.py
177: REPLACE_FILES.python+= Lib/turtledemo/forest.py
178: REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py
179: REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py
180: REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py
181: REPLACE_FILES.python+= Lib/turtledemo/paint.py
182: REPLACE_FILES.python+= Lib/turtledemo/peace.py
183: REPLACE_FILES.python+= Lib/turtledemo/penrose.py
184: REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py
185: REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py
186: REPLACE_FILES.python+= Lib/turtledemo/tree.py
187: REPLACE_FILES.python+= Lib/turtledemo/yinyang.py
188: REPLACE_FILES.python+= Lib/uu.py
189: REPLACE_FILES.python+= Lib/webbrowser.py
190:
191: # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
192: # Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));'
193: SUBST_CLASSES+= findlib
194: SUBST_MESSAGE.findlib= Fixing find_library().
195: SUBST_STAGE.findlib= pre-configure
196: SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py
197: SUBST_FILES.findlib+= Lib/ctypes/util.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}/test/ziptestdata/exe_with_z64
210: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip
211: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh
212: CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
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.12.sl \
228: ${DESTDIR}${PREFIX}/lib/libpython3.12.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:
1.16 cheusov 239: .if ${OPSYS} == "Linux"
240: .include "../../databases/gdbm_compat/buildlink3.mk"
241: .endif
1.1 adam 242: .include "../../archivers/bzip2/buildlink3.mk"
243: .include "../../archivers/xz/buildlink3.mk"
1.2 wiz 244: .include "../../databases/sqlite3/buildlink3.mk"
1.1 adam 245: .if ${USE_BUILTIN.gettext:U:tl} == no
246: CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=yes
247: .endif
248: .include "../../devel/libffi/buildlink3.mk"
249: .include "../../devel/libuuid/buildlink3.mk"
250: .include "../../devel/zlib/buildlink3.mk"
251: .include "../../security/openssl/buildlink3.mk"
1.2 wiz 252: .include "../../textproc/expat/buildlink3.mk"
1.1 adam 253: .include "../../mk/bdb.buildlink3.mk"
1.2 wiz 254: .include "../../mk/curses.buildlink3.mk"
1.1 adam 255: .include "../../mk/dlopen.buildlink3.mk"
256: .include "../../mk/oss.buildlink3.mk"
257: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>