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