lang/python310: Make it cross-compile.diff -r1.12 -r1.13 pkgsrc/lang/python310/Makefile
(riastradh)
@@ -1,215 +1,236 @@ | @@ -1,215 +1,236 @@ | |||
1 | # $NetBSD: Makefile,v 1.12 2022/03/19 18:59:40 adam Exp $ | 1 | # $NetBSD: Makefile,v 1.13 2022/04/03 10:54:52 riastradh Exp $ | |
2 | 2 | |||
3 | .include "dist.mk" | 3 | .include "dist.mk" | |
4 | 4 | |||
5 | PKGNAME= python310-${PY_DISTVERSION} | 5 | PKGNAME= python310-${PY_DISTVERSION} | |
6 | CATEGORIES= lang python | 6 | CATEGORIES= lang python | |
7 | 7 | |||
8 | MAINTAINER= pkgsrc-users@NetBSD.org | 8 | MAINTAINER= pkgsrc-users@NetBSD.org | |
9 | HOMEPAGE= https://www.python.org/ | 9 | HOMEPAGE= https://www.python.org/ | |
10 | COMMENT= Interpreted, interactive, object-oriented programming language | 10 | COMMENT= Interpreted, interactive, object-oriented programming language | |
11 | LICENSE= python-software-foundation | 11 | LICENSE= python-software-foundation | |
12 | 12 | |||
13 | CONFLICTS+= python-[0-9]* | 13 | CONFLICTS+= python-[0-9]* | |
14 | 14 | |||
15 | PLIST_AWK= -f ${PKGSRCDIR}/lang/python/plist-python.awk | 15 | PLIST_AWK= -f ${PKGSRCDIR}/lang/python/plist-python.awk | |
16 | PLIST_AWK_ENV+= PYVERS=310 | 16 | PLIST_AWK_ENV+= PYVERS=310 | |
17 | PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ { | 17 | PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ { | |
18 | PRINT_PLIST_AWK+= sub(/__pycache__\//, "") | 18 | PRINT_PLIST_AWK+= sub(/__pycache__\//, "") | |
19 | PRINT_PLIST_AWK+= sub(/\.cpython-310/, "")} | 19 | PRINT_PLIST_AWK+= sub(/\.cpython-310/, "")} | |
20 | PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ { | 20 | PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ { | |
21 | PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")} | 21 | PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")} | |
22 | 22 | |||
23 | USE_LANGUAGES= c c++ | 23 | USE_LANGUAGES= c c++ | |
24 | USE_TOOLS+= pkg-config | 24 | USE_TOOLS+= pkg-config | |
25 | GNU_CONFIGURE= yes | 25 | GNU_CONFIGURE= yes | |
26 | CONFIGURE_ARGS+= --enable-shared | 26 | CONFIGURE_ARGS+= --enable-shared | |
27 | CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl} | 27 | CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl} | |
28 | CONFIGURE_ARGS+= --with-system-ffi | 28 | CONFIGURE_ARGS+= --with-system-ffi | |
29 | CONFIGURE_ARGS+= --without-ensurepip | 29 | CONFIGURE_ARGS+= --without-ensurepip | |
30 | CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q} | 30 | CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q} | |
31 | CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir} | 31 | CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir} | |
32 | PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in | 32 | PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in | |
33 | 33 | |||
34 | PTHREAD_OPTS+= require | 34 | PTHREAD_OPTS+= require | |
35 | .include "../../mk/pthread.buildlink3.mk" | 35 | .include "../../mk/pthread.buildlink3.mk" | |
36 | 36 | |||
37 | .include "../../mk/bsd.prefs.mk" | 37 | .include "../../mk/bsd.prefs.mk" | |
38 | 38 | |||
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 | |||
43 | CONFIGURE_ARGS+= PYTHON_FOR_BUILD=${PREFIX:Q}/bin/python3.10 | |||
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} | |||
57 | MAKE_ENV+= _PYTHON_PROJECT_BASE=${WRKSRC:Q} | |||
58 | .endif | |||
59 | ||||
39 | # http://bugs.python.org/issue13241 | 60 | # http://bugs.python.org/issue13241 | |
40 | .if !empty(MACHINE_PLATFORM:MDarwin-1[12].*) | 61 | .if !empty(MACHINE_PLATFORM:MDarwin-1[12].*) | |
41 | PKGSRC_COMPILER= clang | 62 | PKGSRC_COMPILER= clang | |
42 | PKG_CC= clang | 63 | PKG_CC= clang | |
43 | PKG_CXX= clang++ | 64 | PKG_CXX= clang++ | |
44 | .endif | 65 | .endif | |
45 | 66 | |||
46 | # Used in socketmodule.c to determine if a sethostname declaration is required | 67 | # Used in socketmodule.c to determine if a sethostname declaration is required | |
47 | CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION} | 68 | CFLAGS.SunOS+= -DPKGSRC_OPSYS_VERSION=${OPSYS_VERSION} | |
48 | LIBS.SunOS+= -lrt # fdatasync() | 69 | LIBS.SunOS+= -lrt # fdatasync() | |
49 | LIBS.SunOS+= -luuid | 70 | LIBS.SunOS+= -luuid | |
50 | .if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100 | 71 | .if ${OPSYS} == "SunOS" && ${OPSYS_VERSION} < 051100 | |
51 | SUBST_CLASSES+= setup | 72 | SUBST_CLASSES+= setup | |
52 | SUBST_MESSAGE.setup= Replacing crypt with crypt_i | 73 | SUBST_MESSAGE.setup= Replacing crypt with crypt_i | |
53 | SUBST_STAGE.setup= pre-configure | 74 | SUBST_STAGE.setup= pre-configure | |
54 | SUBST_FILES.setup= setup.py | 75 | SUBST_FILES.setup= setup.py | |
55 | SUBST_SED.setup= -e "s,'crypt','crypt_i'," | 76 | SUBST_SED.setup= -e "s,'crypt','crypt_i'," | |
56 | .endif | 77 | .endif | |
57 | 78 | |||
58 | PY_VER_SUFFIX= 3.10 | 79 | PY_VER_SUFFIX= 3.10 | |
59 | 80 | |||
60 | .if ${OPSYS} == "Darwin" | 81 | .if ${OPSYS} == "Darwin" | |
61 | PY_PLATNAME= ${LOWER_OPSYS} | 82 | PY_PLATNAME= ${LOWER_OPSYS} | |
62 | USE_TOOLS+= gmake | 83 | USE_TOOLS+= gmake | |
63 | .elif ${OPSYS} == "IRIX" | 84 | .elif ${OPSYS} == "IRIX" | |
64 | PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} | 85 | PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} | |
65 | .elif ${OPSYS} == "SunOS" | 86 | .elif ${OPSYS} == "SunOS" | |
66 | PY_PLATNAME= sunos${OS_VERSION:C/\..*//} | 87 | PY_PLATNAME= sunos${OS_VERSION:C/\..*//} | |
67 | .elif ${OPSYS} == "HPUX" | 88 | .elif ${OPSYS} == "HPUX" | |
68 | PY_PLATNAME= hp-ux11 | 89 | PY_PLATNAME= hp-ux11 | |
69 | .elif ${OPSYS} == "Linux" | 90 | .elif ${OPSYS} == "Linux" | |
70 | PY_PLATNAME= linux | 91 | PY_PLATNAME= linux | |
71 | .else | 92 | .else | |
72 | PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} | 93 | PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} | |
73 | .endif | 94 | .endif | |
74 | PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} | 95 | PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} | |
75 | 96 | |||
76 | # For Xcode 5 and up, we need to search the SDK path for headers, otherwise | 97 | # For Xcode 5 and up, we need to search the SDK path for headers, otherwise | |
77 | # certain modules will not be built. | 98 | # certain modules will not be built. | |
78 | .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include) | 99 | .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH:Q}/usr/include) | |
79 | CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include | 100 | CFLAGS+= -I${OSX_SDK_PATH:Q}/usr/include | |
80 | .endif | 101 | .endif | |
81 | 102 | |||
82 | PLIST_VARS+= nis | 103 | PLIST_VARS+= nis | |
83 | .for incdir in ${_OPSYS_INCLUDE_DIRS} | 104 | .for incdir in ${_OPSYS_INCLUDE_DIRS} | |
84 | . if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h)) | 105 | . if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h)) | |
85 | HAVE_RPC_H= yes | 106 | HAVE_RPC_H= yes | |
86 | . endif | 107 | . endif | |
87 | . if (exists(${incdir}/rpcsvc/yp_prot.h) || exists(${incdir}/nsl/rpcsvc/yp_prot.h)) | 108 | . if (exists(${incdir}/rpcsvc/yp_prot.h) || exists(${incdir}/nsl/rpcsvc/yp_prot.h)) | |
88 | HAVE_YP_PROT_H= yes | 109 | HAVE_YP_PROT_H= yes | |
89 | . endif | 110 | . endif | |
90 | .endfor | 111 | .endfor | |
91 | .if (${HAVE_RPC_H:Uno} == yes && ${HAVE_YP_PROT_H:Uno} == yes) | 112 | .if (${HAVE_RPC_H:Uno} == yes && ${HAVE_YP_PROT_H:Uno} == yes) | |
92 | PLIST.nis= yes | 113 | PLIST.nis= yes | |
93 | .endif | 114 | .endif | |
94 | 115 | |||
95 | PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q} | 116 | PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q} | |
96 | 117 | |||
97 | PRINT_PLIST_AWK+= { gsub(/${PY_PLATNAME}/, "$${PY_PLATNAME}") } | 118 | PRINT_PLIST_AWK+= { gsub(/${PY_PLATNAME}/, "$${PY_PLATNAME}") } | |
98 | PRINT_PLIST_AWK+= { gsub(/python${PY_VER_SUFFIX}/, \ | 119 | PRINT_PLIST_AWK+= { gsub(/python${PY_VER_SUFFIX}/, \ | |
99 | "python$${PY_VER_SUFFIX}") } | 120 | "python$${PY_VER_SUFFIX}") } | |
100 | 121 | |||
101 | TEST_TARGET= test | 122 | TEST_TARGET= test | |
102 | INSTALL_TARGET= altinstall | 123 | INSTALL_TARGET= altinstall | |
103 | 124 | |||
104 | REPLACE_INTERPRETER+= python | 125 | REPLACE_INTERPRETER+= python | |
105 | REPLACE.python.old= .*python[^ ]* | 126 | REPLACE.python.old= .*python[^ ]* | |
106 | REPLACE.python.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} | 127 | REPLACE.python.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} | |
107 | REPLACE_FILES.python+= Lib/base64.py | 128 | REPLACE_FILES.python+= Lib/base64.py | |
108 | REPLACE_FILES.python+= Lib/cProfile.py | 129 | REPLACE_FILES.python+= Lib/cProfile.py | |
109 | REPLACE_FILES.python+= Lib/cgi.py | 130 | REPLACE_FILES.python+= Lib/cgi.py | |
110 | REPLACE_FILES.python+= Lib/encodings/rot_13.py | 131 | REPLACE_FILES.python+= Lib/encodings/rot_13.py | |
111 | REPLACE_FILES.python+= Lib/idlelib/pyshell.py | 132 | REPLACE_FILES.python+= Lib/idlelib/pyshell.py | |
112 | REPLACE_FILES.python+= Lib/keyword.py | 133 | REPLACE_FILES.python+= Lib/keyword.py | |
113 | REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py | 134 | REPLACE_FILES.python+= Lib/lib2to3/pgen2/token.py | |
114 | REPLACE_FILES.python+= Lib/lib2to3/tests/data/different_encoding.py | 135 | REPLACE_FILES.python+= Lib/lib2to3/tests/data/different_encoding.py | |
115 | REPLACE_FILES.python+= Lib/lib2to3/tests/data/false_encoding.py | 136 | REPLACE_FILES.python+= Lib/lib2to3/tests/data/false_encoding.py | |
116 | REPLACE_FILES.python+= Lib/lib2to3/tests/pytree_idempotency.py | 137 | REPLACE_FILES.python+= Lib/lib2to3/tests/pytree_idempotency.py | |
117 | REPLACE_FILES.python+= Lib/pdb.py | 138 | REPLACE_FILES.python+= Lib/pdb.py | |
118 | REPLACE_FILES.python+= Lib/platform.py | 139 | REPLACE_FILES.python+= Lib/platform.py | |
119 | REPLACE_FILES.python+= Lib/profile.py | 140 | REPLACE_FILES.python+= Lib/profile.py | |
120 | REPLACE_FILES.python+= Lib/pydoc.py | 141 | REPLACE_FILES.python+= Lib/pydoc.py | |
121 | REPLACE_FILES.python+= Lib/quopri.py | 142 | REPLACE_FILES.python+= Lib/quopri.py | |
122 | REPLACE_FILES.python+= Lib/smtpd.py | 143 | REPLACE_FILES.python+= Lib/smtpd.py | |
123 | REPLACE_FILES.python+= Lib/smtplib.py | 144 | REPLACE_FILES.python+= Lib/smtplib.py | |
124 | REPLACE_FILES.python+= Lib/tabnanny.py | 145 | REPLACE_FILES.python+= Lib/tabnanny.py | |
125 | REPLACE_FILES.python+= Lib/tarfile.py | 146 | REPLACE_FILES.python+= Lib/tarfile.py | |
126 | REPLACE_FILES.python+= Lib/test/bisect_cmd.py | 147 | REPLACE_FILES.python+= Lib/test/bisect_cmd.py | |
127 | REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py | 148 | REPLACE_FILES.python+= Lib/test/crashers/recursive_call.py | |
128 | REPLACE_FILES.python+= Lib/test/curses_tests.py | 149 | REPLACE_FILES.python+= Lib/test/curses_tests.py | |
129 | REPLACE_FILES.python+= Lib/test/re_tests.py | 150 | REPLACE_FILES.python+= Lib/test/re_tests.py | |
130 | REPLACE_FILES.python+= Lib/test/regrtest.py | 151 | REPLACE_FILES.python+= Lib/test/regrtest.py | |
131 | REPLACE_FILES.python+= Lib/timeit.py | 152 | REPLACE_FILES.python+= Lib/timeit.py | |
132 | REPLACE_FILES.python+= Lib/trace.py | 153 | REPLACE_FILES.python+= Lib/trace.py | |
133 | REPLACE_FILES.python+= Lib/turtledemo/__main__.py | 154 | REPLACE_FILES.python+= Lib/turtledemo/__main__.py | |
134 | REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py | 155 | REPLACE_FILES.python+= Lib/turtledemo/bytedesign.py | |
135 | REPLACE_FILES.python+= Lib/turtledemo/clock.py | 156 | REPLACE_FILES.python+= Lib/turtledemo/clock.py | |
136 | REPLACE_FILES.python+= Lib/turtledemo/forest.py | 157 | REPLACE_FILES.python+= Lib/turtledemo/forest.py | |
137 | REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py | 158 | REPLACE_FILES.python+= Lib/turtledemo/fractalcurves.py | |
138 | REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py | 159 | REPLACE_FILES.python+= Lib/turtledemo/lindenmayer.py | |
139 | REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py | 160 | REPLACE_FILES.python+= Lib/turtledemo/minimal_hanoi.py | |
140 | REPLACE_FILES.python+= Lib/turtledemo/paint.py | 161 | REPLACE_FILES.python+= Lib/turtledemo/paint.py | |
141 | REPLACE_FILES.python+= Lib/turtledemo/peace.py | 162 | REPLACE_FILES.python+= Lib/turtledemo/peace.py | |
142 | REPLACE_FILES.python+= Lib/turtledemo/penrose.py | 163 | REPLACE_FILES.python+= Lib/turtledemo/penrose.py | |
143 | REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py | 164 | REPLACE_FILES.python+= Lib/turtledemo/planet_and_moon.py | |
144 | REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py | 165 | REPLACE_FILES.python+= Lib/turtledemo/sorting_animate.py | |
145 | REPLACE_FILES.python+= Lib/turtledemo/tree.py | 166 | REPLACE_FILES.python+= Lib/turtledemo/tree.py | |
146 | REPLACE_FILES.python+= Lib/turtledemo/yinyang.py | 167 | REPLACE_FILES.python+= Lib/turtledemo/yinyang.py | |
147 | REPLACE_FILES.python+= Lib/uu.py | 168 | REPLACE_FILES.python+= Lib/uu.py | |
148 | REPLACE_FILES.python+= Lib/webbrowser.py | 169 | REPLACE_FILES.python+= Lib/webbrowser.py | |
149 | 170 | |||
150 | REPLACE_SH+= Misc/python-config.sh.in | 171 | REPLACE_SH+= Misc/python-config.sh.in | |
151 | 172 | |||
152 | # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib | 173 | # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib | |
153 | # Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));' | 174 | # Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));' | |
154 | SUBST_CLASSES+= findlib | 175 | SUBST_CLASSES+= findlib | |
155 | SUBST_MESSAGE.findlib= Fixing find_library(). | 176 | SUBST_MESSAGE.findlib= Fixing find_library(). | |
156 | SUBST_STAGE.findlib= pre-configure | 177 | SUBST_STAGE.findlib= pre-configure | |
157 | SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py | 178 | SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py | |
158 | SUBST_FILES.findlib+= Lib/ctypes/util.py | 179 | SUBST_FILES.findlib+= Lib/ctypes/util.py | |
159 | SUBST_FILES.findlib+= Lib/distutils/unixccompiler.py | 180 | SUBST_FILES.findlib+= Lib/distutils/unixccompiler.py | |
160 | SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' | 181 | SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' | |
161 | SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!" | 182 | SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!" | |
162 | SUBST_NOOP_OK.findlib= yes | 183 | SUBST_NOOP_OK.findlib= yes | |
163 | 184 | |||
164 | SUBST_CLASSES+= pkgversion | 185 | SUBST_CLASSES+= pkgversion | |
165 | SUBST_STAGE.pkgversion= pre-configure | 186 | SUBST_STAGE.pkgversion= pre-configure | |
166 | SUBST_FILES.pkgversion= Lib/lib2to3/pgen2/driver.py | 187 | SUBST_FILES.pkgversion= Lib/lib2to3/pgen2/driver.py | |
167 | SUBST_VARS.pkgversion= PKGVERSION_NOREV | 188 | SUBST_VARS.pkgversion= PKGVERSION_NOREV | |
168 | 189 | |||
169 | .include "options.mk" | 190 | .include "options.mk" | |
170 | 191 | |||
171 | CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc | 192 | CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc | |
172 | CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_z64 | 193 | CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_z64 | |
173 | CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip | 194 | CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/exe_with_zip | |
174 | CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh | 195 | CHECK_INTERPRETER_SKIP+= lib/python${PY_VER_SUFFIX}/test/ziptestdata/header.sh | |
175 | 196 | |||
176 | # contain CONFIGURE_ARGS and CONFIGURE_ENV | 197 | # contain CONFIGURE_ARGS and CONFIGURE_ENV | |
177 | CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/_sysconfigdata* | 198 | CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/_sysconfigdata* | |
178 | CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/__pycache__/_sysconfigdata* | 199 | CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/__pycache__/_sysconfigdata* | |
179 | CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/config-${PY_VER_SUFFIX}/Makefile | 200 | CHECK_WRKREF_SKIP+= lib/python${PY_VER_SUFFIX}/config-${PY_VER_SUFFIX}/Makefile | |
180 | 201 | |||
181 | # Avoid error: Cannot generate ./Include/opcode.h, python not found ! | 202 | # Avoid error: Cannot generate ./Include/opcode.h, python not found ! | |
182 | post-configure: | 203 | post-configure: | |
183 | touch ${WRKSRC}/Include/opcode.h | 204 | touch ${WRKSRC}/Include/opcode.h | |
184 | 205 | |||
185 | .if ${OPSYS} == "HPUX" | 206 | .if ${OPSYS} == "HPUX" | |
186 | post-install: hpux-postinstall | 207 | post-install: hpux-postinstall | |
187 | .PHONY: hpux-postinstall | 208 | .PHONY: hpux-postinstall | |
188 | hpux-postinstall: | 209 | hpux-postinstall: | |
189 | ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.10.sl \ | 210 | ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython3.10.sl \ | |
190 | ${DESTDIR}${PREFIX}/lib/libpython3.10.sl.1.0 | 211 | ${DESTDIR}${PREFIX}/lib/libpython3.10.sl.1.0 | |
191 | .endif | 212 | .endif | |
192 | 213 | |||
193 | INSTALLATION_DIRS+= lib/python${PY_VER_SUFFIX}/site-packages | 214 | INSTALLATION_DIRS+= lib/python${PY_VER_SUFFIX}/site-packages | |
194 | 215 | |||
195 | pre-install: setuptools-preinstall | 216 | pre-install: setuptools-preinstall | |
196 | .PHONY: setuptools-preinstall | 217 | .PHONY: setuptools-preinstall | |
197 | setuptools-preinstall: | 218 | setuptools-preinstall: | |
198 | ${INSTALL_DATA} ${.CURDIR}/../../devel/py-setuptools/files/_distutils_system_mod \ | 219 | ${INSTALL_DATA} ${.CURDIR}/../../devel/py-setuptools/files/_distutils_system_mod \ | |
199 | ${DESTDIR}${PREFIX}/lib/python${PY_VER_SUFFIX}/site-packages/_distutils_system_mod.py | 220 | ${DESTDIR}${PREFIX}/lib/python${PY_VER_SUFFIX}/site-packages/_distutils_system_mod.py | |
200 | 221 | |||
201 | # needed to make devel/py-readline pick up the correct readline implementation | 222 | # needed to make devel/py-readline pick up the correct readline implementation | |
202 | BUILDLINK_DEPMETHOD.readline= build | 223 | BUILDLINK_DEPMETHOD.readline= build | |
203 | 224 | |||
204 | .include "../../archivers/bzip2/buildlink3.mk" | 225 | .include "../../archivers/bzip2/buildlink3.mk" | |
205 | .include "../../archivers/xz/buildlink3.mk" | 226 | .include "../../archivers/xz/buildlink3.mk" | |
206 | .include "../../devel/gettext-lib/buildlink3.mk" | 227 | .include "../../devel/gettext-lib/buildlink3.mk" | |
207 | .include "../../devel/libffi/buildlink3.mk" | 228 | .include "../../devel/libffi/buildlink3.mk" | |
208 | .include "../../devel/libuuid/buildlink3.mk" | 229 | .include "../../devel/libuuid/buildlink3.mk" | |
209 | .include "../../devel/readline/buildlink3.mk" | 230 | .include "../../devel/readline/buildlink3.mk" | |
210 | .include "../../devel/zlib/buildlink3.mk" | 231 | .include "../../devel/zlib/buildlink3.mk" | |
211 | .include "../../security/openssl/buildlink3.mk" | 232 | .include "../../security/openssl/buildlink3.mk" | |
212 | .include "../../mk/bdb.buildlink3.mk" | 233 | .include "../../mk/bdb.buildlink3.mk" | |
213 | .include "../../mk/dlopen.buildlink3.mk" | 234 | .include "../../mk/dlopen.buildlink3.mk" | |
214 | .include "../../mk/oss.buildlink3.mk" | 235 | .include "../../mk/oss.buildlink3.mk" | |
215 | .include "../../mk/bsd.pkg.mk" | 236 | .include "../../mk/bsd.pkg.mk" |
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | $NetBSD: distinfo,v 1.14 2022/03/25 17:55:19 adam Exp $ | 1 | $NetBSD: distinfo,v 1.15 2022/04/03 10:54:52 riastradh Exp $ | |
2 | 2 | |||
3 | BLAKE2s (Python-3.10.4.tar.xz) = 764967513abd194f54dbed2ef7520c1aeca19628627337947542b24c1ac50bb3 | 3 | BLAKE2s (Python-3.10.4.tar.xz) = 764967513abd194f54dbed2ef7520c1aeca19628627337947542b24c1ac50bb3 | |
4 | SHA512 (Python-3.10.4.tar.xz) = 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113 | 4 | SHA512 (Python-3.10.4.tar.xz) = 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113 | |
5 | Size (Python-3.10.4.tar.xz) = 19342692 bytes | 5 | Size (Python-3.10.4.tar.xz) = 19342692 bytes | |
6 | SHA1 (patch-Lib_ctypes_util.py) = 3dec1b6b7a36e46cbfa0dfcd71c5e7fac9f60764 | 6 | SHA1 (patch-Lib_ctypes_util.py) = 3dec1b6b7a36e46cbfa0dfcd71c5e7fac9f60764 | |
7 | SHA1 (patch-Lib_distutils_unixccompiler.py) = 8a91e8f4f86517a62408c3a10ed5eb50c4091fbf | 7 | SHA1 (patch-Lib_distutils_unixccompiler.py) = 8a91e8f4f86517a62408c3a10ed5eb50c4091fbf | |
8 | SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 593c4e93c5653ab400f0a98b91db92630c0a7390 | 8 | SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 593c4e93c5653ab400f0a98b91db92630c0a7390 | |
9 | SHA1 (patch-Lib_sysconfig.py) = bc6d91bf8f7121456b26ea7f080f588c96f2596f | 9 | SHA1 (patch-Lib_sysconfig.py) = bc6d91bf8f7121456b26ea7f080f588c96f2596f | |
10 | SHA1 (patch-Makefile.pre.in) = 932a89313e8f26c435675f2487eb2141876a5f5a | 10 | SHA1 (patch-Makefile.pre.in) = 932a89313e8f26c435675f2487eb2141876a5f5a | |
11 | SHA1 (patch-Modules_socketmodule.c) = 3e2db474b4ef08edd25528465605fff1d3d0f61b | 11 | SHA1 (patch-Modules_socketmodule.c) = 3e2db474b4ef08edd25528465605fff1d3d0f61b | |
12 | SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c | 12 | SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c | |
13 | SHA1 (patch-Python_thread__pthread.h) = bf1aeab011b3afedc02e68fcf5cef091b3e0aefa | 13 | SHA1 (patch-Python_thread__pthread.h) = bf1aeab011b3afedc02e68fcf5cef091b3e0aefa | |
14 | SHA1 (patch-configure) = b238289b98d85128d0b0ad02ce926e36c0febc02 | 14 | SHA1 (patch-configure) = 8ffe98e51407d10e46e7d1531f2e0e0b58e1cfa6 | |
15 | SHA1 (patch-pyconfig.h.in) = 1ab77914315acbf0352d242ed66200bea54548f6 | 15 | SHA1 (patch-pyconfig.h.in) = 1ab77914315acbf0352d242ed66200bea54548f6 | |
16 | SHA1 (patch-setup.py) = 491b5ff230dd6393fabe787b429a131c88a14f45 | 16 | SHA1 (patch-setup.py) = f71085603ac5d343ee60c1d18f4f4bde0791fa6b |
@@ -1,72 +1,82 @@ | @@ -1,72 +1,82 @@ | |||
1 | $NetBSD: patch-configure,v 1.3 2022/01/15 16:23:47 adam Exp $ | 1 | $NetBSD: patch-configure,v 1.4 2022/04/03 10:54:52 riastradh Exp $ | |
2 | 2 | |||
3 | Use gnu99 instead of c99 to avoid "alloca() undefined" problems. | 3 | Use gnu99 instead of c99 to avoid "alloca() undefined" problems. | |
4 | Fix linking on Darwin; don't use -stack_size. | 4 | Fix linking on Darwin; don't use -stack_size. | |
5 | Changes for consistency across pkgsrc platforms. | 5 | Changes for consistency across pkgsrc platforms. | |
6 | Simplify _sysconfigdata to include only platform name. | 6 | Simplify _sysconfigdata to include only platform name. | |
7 | detect netcan/can.h on NetBSD | 7 | detect netcan/can.h on NetBSD | |
8 | Disable barrier to cross-compilation. | |||
8 | 9 | |||
9 | --- configure.orig 2022-01-13 18:52:14.000000000 +0000 | 10 | --- configure.orig 2022-03-23 20:12:04.000000000 +0000 | |
10 | +++ configure | 11 | +++ configure | |
12 | @@ -3380,7 +3380,7 @@ fi | |||
13 | $as_echo "\"$MACHDEP\"" >&6; } | |||
14 | ||||
15 | ||||
16 | -if test "$cross_compiling" = yes; then | |||
17 | +if false && test "$cross_compiling" = yes; then | |||
18 | case "$host" in | |||
19 | *-*-linux*) | |||
20 | case "$host_cpu" in | |||
11 | @@ -7051,7 +7051,7 @@ UNIVERSAL_ARCH_FLAGS= | 21 | @@ -7051,7 +7051,7 @@ UNIVERSAL_ARCH_FLAGS= | |
12 | # tweak BASECFLAGS based on compiler and platform | 22 | # tweak BASECFLAGS based on compiler and platform | |
13 | case $GCC in | 23 | case $GCC in | |
14 | yes) | 24 | yes) | |
15 | - CFLAGS_NODIST="$CFLAGS_NODIST -std=c99" | 25 | - CFLAGS_NODIST="$CFLAGS_NODIST -std=c99" | |
16 | + CFLAGS_NODIST="$CFLAGS_NODIST -std=gnu99" | 26 | + CFLAGS_NODIST="$CFLAGS_NODIST -std=gnu99" | |
17 | 27 | |||
18 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5 | 28 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5 | |
19 | $as_echo_n "checking for -Wextra... " >&6; } | 29 | $as_echo_n "checking for -Wextra... " >&6; } | |
20 | @@ -8675,6 +8675,17 @@ if test "x$ac_cv_type___uint128_t" = xye | 30 | @@ -8675,6 +8675,17 @@ if test "x$ac_cv_type___uint128_t" = xye | |
21 | $as_echo "#define HAVE_GCC_UINT128_T 1" >>confdefs.h | 31 | $as_echo "#define HAVE_GCC_UINT128_T 1" >>confdefs.h | |
22 | 32 | |||
23 | fi | 33 | fi | |
24 | +ac_fn_c_check_header_compile "$LINENO" "netcan/can.h" "ac_cv_header_netcan_can_h" " | 34 | +ac_fn_c_check_header_compile "$LINENO" "netcan/can.h" "ac_cv_header_netcan_can_h" " | |
25 | +#ifdef HAVE_SYS_SOCKET_H | 35 | +#ifdef HAVE_SYS_SOCKET_H | |
26 | +#include <sys/socket.h> | 36 | +#include <sys/socket.h> | |
27 | +#endif | 37 | +#endif | |
28 | + | 38 | + | |
29 | +" | 39 | +" | |
30 | +if test "x$ac_cv_header_netcan_can_h" = xyes | 40 | +if test "x$ac_cv_header_netcan_can_h" = xyes | |
31 | +then : | 41 | +then : | |
32 | + printf "%s\n" "#define HAVE_NETCAN_CAN_H 1" >>confdefs.h | 42 | + printf "%s\n" "#define HAVE_NETCAN_CAN_H 1" >>confdefs.h | |
33 | + | 43 | + | |
34 | +fi | 44 | +fi | |
35 | 45 | |||
36 | 46 | |||
37 | # Sizes and alignments of various common basic types | 47 | # Sizes and alignments of various common basic types | |
38 | @@ -14762,10 +14773,10 @@ _ACEOF | 48 | @@ -14729,10 +14740,10 @@ _ACEOF | |
39 | if ac_fn_c_try_compile "$LINENO"; then : | 49 | if ac_fn_c_try_compile "$LINENO"; then : | |
40 | 50 | |||
41 | 51 | |||
42 | -if grep noonsees conftest.$ac_objext >/dev/null ; then | 52 | -if grep noonsees conftest.$ac_objext >/dev/null ; then | |
43 | +if strings -a conftest.$ac_objext | grep noonsees >/dev/null ; then | 53 | +if strings -a conftest.$ac_objext | grep noonsees >/dev/null ; then | |
44 | ax_cv_c_float_words_bigendian=yes | 54 | ax_cv_c_float_words_bigendian=yes | |
45 | fi | 55 | fi | |
46 | -if grep seesnoon conftest.$ac_objext >/dev/null ; then | 56 | -if grep seesnoon conftest.$ac_objext >/dev/null ; then | |
47 | +if strings -a conftest.$ac_objext | grep seesnoon >/dev/null ; then | 57 | +if strings -a conftest.$ac_objext | grep seesnoon >/dev/null ; then | |
48 | if test "$ax_cv_c_float_words_bigendian" = unknown; then | 58 | if test "$ax_cv_c_float_words_bigendian" = unknown; then | |
49 | ax_cv_c_float_words_bigendian=no | 59 | ax_cv_c_float_words_bigendian=no | |
50 | else | 60 | else | |
51 | @@ -15666,7 +15677,7 @@ _ACEOF | 61 | @@ -15633,7 +15644,7 @@ _ACEOF | |
52 | fi | 62 | fi | |
53 | 63 | |||
54 | 64 | |||
55 | -EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} | 65 | -EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} | |
56 | +EXT_SUFFIX=${SHLIB_SUFFIX} | 66 | +EXT_SUFFIX=${SHLIB_SUFFIX} | |
57 | 67 | |||
58 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 | 68 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 | |
59 | $as_echo_n "checking LDVERSION... " >&6; } | 69 | $as_echo_n "checking LDVERSION... " >&6; } | |
60 | @@ -15719,11 +15730,7 @@ fi | 70 | @@ -15686,11 +15697,7 @@ fi | |
61 | 71 | |||
62 | 72 | |||
63 | 73 | |||
64 | -if test x$PLATFORM_TRIPLET = x; then | 74 | -if test x$PLATFORM_TRIPLET = x; then | |
65 | - LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}" | 75 | - LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}" | |
66 | -else | 76 | -else | |
67 | - LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" | 77 | - LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" | |
68 | -fi | 78 | -fi | |
69 | +LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}" | 79 | +LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}" | |
70 | 80 | |||
71 | 81 | |||
72 | # Check for --with-wheel-pkg-dir=PATH | 82 | # Check for --with-wheel-pkg-dir=PATH |
@@ -1,169 +1,182 @@ | @@ -1,169 +1,182 @@ | |||
1 | $NetBSD: patch-setup.py,v 1.4 2022/01/14 10:32:28 tnn Exp $ | 1 | $NetBSD: patch-setup.py,v 1.5 2022/04/03 10:54:52 riastradh Exp $ | |
2 | 2 | |||
3 | Disable certain modules, so they can be built as separate packages. | 3 | Disable certain modules, so they can be built as separate packages. | |
4 | Do not look for ncursesw. | 4 | Do not look for ncursesw. | |
5 | Assume panel_library is correct; this is a fix for ncurses' gnupanel | 5 | Assume panel_library is correct; this is a fix for ncurses' gnupanel | |
6 | which will get transformed to panel in buildlink. | 6 | which will get transformed to panel in buildlink. | |
7 | Don't search for modules in PREFIX. Fixes build failure when py-setuptools | 7 | Don't search for modules in PREFIX. Fixes build failure when py-setuptools | |
8 | are installed. | 8 | are installed. | |
9 | Enable cross-build by setting sys._home and sys.path to build directory | |||
9 | 10 | |||
10 | --- setup.py.orig 2021-12-06 18:23:39.000000000 +0000 | 11 | --- setup.py.orig 2022-03-23 20:12:04.000000000 +0000 | |
11 | +++ setup.py | 12 | +++ setup.py | |
12 | @@ -13,6 +13,7 @@ import warnings | 13 | @@ -1,5 +1,11 @@ | |
14 | # Autodetecting setup.py script for building the Python extensions | |||
15 | ||||
16 | +import sys | |||
17 | +sys._home = __file__[:-len('/setup.py')] | |||
18 | +sys.path.append(__file__[:-len('/setup.py')] + '/Lib') | |||
19 | +with open('pybuilddir.txt') as pybuilddir: | |||
20 | + sys.path.append(__file__[:-len('/setup.py')] + '/' + next(pybuilddir)) | |||
21 | + | |||
22 | import argparse | |||
23 | import importlib._bootstrap | |||
24 | import importlib.machinery | |||
25 | @@ -13,6 +19,7 @@ import warnings | |||
13 | from glob import glob, escape | 26 | from glob import glob, escape | |
14 | import _osx_support | 27 | import _osx_support | |
15 | 28 | |||
16 | +sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/').match(p)] | 29 | +sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/').match(p)] | |
17 | 30 | |||
18 | try: | 31 | try: | |
19 | import subprocess | 32 | import subprocess | |
20 | @@ -45,6 +46,7 @@ with warnings.catch_warnings(): | 33 | @@ -45,6 +52,7 @@ with warnings.catch_warnings(): | |
21 | DeprecationWarning | 34 | DeprecationWarning | |
22 | ) | 35 | ) | |
23 | 36 | |||
24 | + from distutils import text_file | 37 | + from distutils import text_file | |
25 | from distutils.command.build_ext import build_ext | 38 | from distutils.command.build_ext import build_ext | |
26 | from distutils.command.build_scripts import build_scripts | 39 | from distutils.command.build_scripts import build_scripts | |
27 | from distutils.command.install import install | 40 | from distutils.command.install import install | |
28 | @@ -58,7 +60,7 @@ with warnings.catch_warnings(): | 41 | @@ -58,7 +66,7 @@ with warnings.catch_warnings(): | |
29 | TEST_EXTENSIONS = (sysconfig.get_config_var('TEST_MODULES') == 'yes') | 42 | TEST_EXTENSIONS = (sysconfig.get_config_var('TEST_MODULES') == 'yes') | |
30 | 43 | |||
31 | # This global variable is used to hold the list of modules to be disabled. | 44 | # This global variable is used to hold the list of modules to be disabled. | |
32 | -DISABLED_MODULE_LIST = [] | 45 | -DISABLED_MODULE_LIST = [] | |
33 | +DISABLED_MODULE_LIST = ["_curses", "_curses_panel", "_elementtree", "_gdbm", "pyexpat", "readline", "_sqlite3", "_tkinter", "xxlimited"] | 46 | +DISABLED_MODULE_LIST = ["_curses", "_curses_panel", "_elementtree", "_gdbm", "pyexpat", "readline", "_sqlite3", "_tkinter", "xxlimited"] | |
34 | 47 | |||
35 | # --list-module-names option used by Tools/scripts/generate_module_names.py | 48 | # --list-module-names option used by Tools/scripts/generate_module_names.py | |
36 | LIST_MODULE_NAMES = False | 49 | LIST_MODULE_NAMES = False | |
37 | @@ -249,6 +251,16 @@ def grep_headers_for(function, headers): | 50 | @@ -249,6 +257,16 @@ def grep_headers_for(function, headers): | |
38 | return False | 51 | return False | |
39 | 52 | |||
40 | 53 | |||
41 | +def grep_headers_for(function, headers): | 54 | +def grep_headers_for(function, headers): | |
42 | + for header in headers: | 55 | + for header in headers: | |
43 | + try: | 56 | + try: | |
44 | + with open(header, 'r') as f: | 57 | + with open(header, 'r') as f: | |
45 | + if function in f.read(): | 58 | + if function in f.read(): | |
46 | + return True | 59 | + return True | |
47 | + except UnicodeDecodeError: | 60 | + except UnicodeDecodeError: | |
48 | + pass | 61 | + pass | |
49 | + return False | 62 | + return False | |
50 | + | 63 | + | |
51 | def find_file(filename, std_dirs, paths): | 64 | def find_file(filename, std_dirs, paths): | |
52 | """Searches for the directory where a given file is located, | 65 | """Searches for the directory where a given file is located, | |
53 | and returns a possibly-empty list of additional directories, or None | 66 | and returns a possibly-empty list of additional directories, or None | |
54 | @@ -821,15 +833,15 @@ class PyBuildExt(build_ext): | 67 | @@ -823,15 +841,15 @@ class PyBuildExt(build_ext): | |
55 | add_dir_to_list(dir_list, directory) | 68 | add_dir_to_list(dir_list, directory) | |
56 | 69 | |||
57 | def configure_compiler(self): | 70 | def configure_compiler(self): | |
58 | - # Ensure that /usr/local is always used, but the local build | 71 | - # Ensure that /usr/local is always used, but the local build | |
59 | - # directories (i.e. '.' and 'Include') must be first. See issue | 72 | - # directories (i.e. '.' and 'Include') must be first. See issue | |
60 | - # 10520. | 73 | - # 10520. | |
61 | - if not CROSS_COMPILING: | 74 | - if not CROSS_COMPILING: | |
62 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | 75 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | |
63 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 76 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | |
64 | - # only change this for cross builds for 3.3, issues on Mageia | 77 | - # only change this for cross builds for 3.3, issues on Mageia | |
65 | - if CROSS_COMPILING: | 78 | - if CROSS_COMPILING: | |
66 | - self.add_cross_compiling_paths() | 79 | - self.add_cross_compiling_paths() | |
67 | + # Add the buildlink directories for pkgsrc | 80 | + # Add the buildlink directories for pkgsrc | |
68 | + if os.environ.get('BUILDLINK_DIR'): | 81 | + if os.environ.get('BUILDLINK_DIR'): | |
69 | + dir = os.environ['BUILDLINK_DIR'] | 82 | + dir = os.environ['BUILDLINK_DIR'] | |
70 | + libdir = dir + '/lib' | 83 | + libdir = dir + '/lib' | |
71 | + incdir = dir + '/include' | 84 | + incdir = dir + '/include' | |
72 | + if libdir not in self.compiler.library_dirs: | 85 | + if libdir not in self.compiler.library_dirs: | |
73 | + self.compiler.library_dirs.insert(0, libdir) | 86 | + self.compiler.library_dirs.insert(0, libdir) | |
74 | + if incdir not in self.compiler.include_dirs: | 87 | + if incdir not in self.compiler.include_dirs: | |
75 | + self.compiler.include_dirs.insert(0, incdir) | 88 | + self.compiler.include_dirs.insert(0, incdir) | |
76 | self.add_multiarch_paths() | 89 | self.add_multiarch_paths() | |
77 | self.add_ldflags_cppflags() | 90 | self.add_ldflags_cppflags() | |
78 | 91 | |||
79 | @@ -877,6 +889,9 @@ class PyBuildExt(build_ext): | 92 | @@ -879,6 +897,9 @@ class PyBuildExt(build_ext): | |
80 | self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] | 93 | self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] | |
81 | 94 | |||
82 | if MACOS: | 95 | if MACOS: | |
83 | + self.inc_dirs.append(macosx_sdk_root() + '/usr/include') | 96 | + self.inc_dirs.append(macosx_sdk_root() + '/usr/include') | |
84 | + self.lib_dirs.append(macosx_sdk_root() + '/usr/lib') | 97 | + self.lib_dirs.append(macosx_sdk_root() + '/usr/lib') | |
85 | + | 98 | + | |
86 | # This should work on any unixy platform ;-) | 99 | # This should work on any unixy platform ;-) | |
87 | # If the user has bothered specifying additional -I and -L flags | 100 | # If the user has bothered specifying additional -I and -L flags | |
88 | # in OPT and LDFLAGS we might as well use them here. | 101 | # in OPT and LDFLAGS we might as well use them here. | |
89 | @@ -1104,8 +1119,6 @@ class PyBuildExt(build_ext): | 102 | @@ -1106,8 +1127,6 @@ class PyBuildExt(build_ext): | |
90 | # use the same library for the readline and curses modules. | 103 | # use the same library for the readline and curses modules. | |
91 | if 'curses' in readline_termcap_library: | 104 | if 'curses' in readline_termcap_library: | |
92 | curses_library = readline_termcap_library | 105 | curses_library = readline_termcap_library | |
93 | - elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'): | 106 | - elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'): | |
94 | - curses_library = 'ncursesw' | 107 | - curses_library = 'ncursesw' | |
95 | # Issue 36210: OSS provided ncurses does not link on AIX | 108 | # Issue 36210: OSS provided ncurses does not link on AIX | |
96 | # Use IBM supplied 'curses' for successful build of _curses | 109 | # Use IBM supplied 'curses' for successful build of _curses | |
97 | elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'): | 110 | elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'): | |
98 | @@ -1209,8 +1222,7 @@ class PyBuildExt(build_ext): | 111 | @@ -1211,8 +1230,7 @@ class PyBuildExt(build_ext): | |
99 | # If the curses module is enabled, check for the panel module | 112 | # If the curses module is enabled, check for the panel module | |
100 | # _curses_panel needs some form of ncurses | 113 | # _curses_panel needs some form of ncurses | |
101 | skip_curses_panel = True if AIX else False | 114 | skip_curses_panel = True if AIX else False | |
102 | - if (curses_enabled and not skip_curses_panel and | 115 | - if (curses_enabled and not skip_curses_panel and | |
103 | - self.compiler.find_library_file(self.lib_dirs, panel_library)): | 116 | - self.compiler.find_library_file(self.lib_dirs, panel_library)): | |
104 | + if curses_enabled and not skip_curses_panel: | 117 | + if curses_enabled and not skip_curses_panel: | |
105 | self.add(Extension('_curses_panel', ['_curses_panel.c'], | 118 | self.add(Extension('_curses_panel', ['_curses_panel.c'], | |
106 | include_dirs=curses_includes, | 119 | include_dirs=curses_includes, | |
107 | define_macros=curses_defines, | 120 | define_macros=curses_defines, | |
108 | @@ -1455,6 +1467,31 @@ class PyBuildExt(build_ext): | 121 | @@ -1457,6 +1475,31 @@ class PyBuildExt(build_ext): | |
109 | dbm_order = ['gdbm'] | 122 | dbm_order = ['gdbm'] | |
110 | # The standard Unix dbm module: | 123 | # The standard Unix dbm module: | |
111 | if not CYGWIN: | 124 | if not CYGWIN: | |
112 | + # Top half based on find_file | 125 | + # Top half based on find_file | |
113 | + def find_ndbm_h(dirs): | 126 | + def find_ndbm_h(dirs): | |
114 | + ret = None | 127 | + ret = None | |
115 | + if MACOS: | 128 | + if MACOS: | |
116 | + sysroot = macosx_sdk_root() | 129 | + sysroot = macosx_sdk_root() | |
117 | + for dir in dirs: | 130 | + for dir in dirs: | |
118 | + f = os.path.join(dir, 'ndbm.h') | 131 | + f = os.path.join(dir, 'ndbm.h') | |
119 | + if MACOS and is_macosx_sdk_path(dir): | 132 | + if MACOS and is_macosx_sdk_path(dir): | |
120 | + f = os.path.join(sysroot, dir[1:], 'ndbm.h') | 133 | + f = os.path.join(sysroot, dir[1:], 'ndbm.h') | |
121 | + if not os.path.exists(f): | 134 | + if not os.path.exists(f): | |
122 | + continue | 135 | + continue | |
123 | + | 136 | + | |
124 | + ret = True | 137 | + ret = True | |
125 | + input = text_file.TextFile(f) | 138 | + input = text_file.TextFile(f) | |
126 | + while True: | 139 | + while True: | |
127 | + line = input.readline() | 140 | + line = input.readline() | |
128 | + if not line: | 141 | + if not line: | |
129 | + break | 142 | + break | |
130 | + if re.search('This file is part of GDBM', line): | 143 | + if re.search('This file is part of GDBM', line): | |
131 | + ret = None | 144 | + ret = None | |
132 | + break | 145 | + break | |
133 | + input.close() | 146 | + input.close() | |
134 | + break | 147 | + break | |
135 | + return ret | 148 | + return ret | |
136 | + | 149 | + | |
137 | config_args = [arg.strip("'") | 150 | config_args = [arg.strip("'") | |
138 | for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] | 151 | for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] | |
139 | dbm_args = [arg for arg in config_args | 152 | dbm_args = [arg for arg in config_args | |
140 | @@ -1466,7 +1503,7 @@ class PyBuildExt(build_ext): | 153 | @@ -1468,7 +1511,7 @@ class PyBuildExt(build_ext): | |
141 | dbmext = None | 154 | dbmext = None | |
142 | for cand in dbm_order: | 155 | for cand in dbm_order: | |
143 | if cand == "ndbm": | 156 | if cand == "ndbm": | |
144 | - if find_file("ndbm.h", self.inc_dirs, []) is not None: | 157 | - if find_file("ndbm.h", self.inc_dirs, []) is not None: | |
145 | + if find_ndbm_h(self.inc_dirs) is not None: | 158 | + if find_ndbm_h(self.inc_dirs) is not None: | |
146 | # Some systems have -lndbm, others have -lgdbm_compat, | 159 | # Some systems have -lndbm, others have -lgdbm_compat, | |
147 | # others don't have either | 160 | # others don't have either | |
148 | if self.compiler.find_library_file(self.lib_dirs, | 161 | if self.compiler.find_library_file(self.lib_dirs, | |
149 | @@ -2326,10 +2363,7 @@ class PyBuildExt(build_ext): | 162 | @@ -2328,10 +2371,7 @@ class PyBuildExt(build_ext): | |
150 | sources = ['_decimal/_decimal.c'] | 163 | sources = ['_decimal/_decimal.c'] | |
151 | depends = ['_decimal/docstrings.h'] | 164 | depends = ['_decimal/docstrings.h'] | |
152 | else: | 165 | else: | |
153 | - include_dirs = [os.path.abspath(os.path.join(self.srcdir, | 166 | - include_dirs = [os.path.abspath(os.path.join(self.srcdir, | |
154 | - 'Modules', | 167 | - 'Modules', | |
155 | - '_decimal', | 168 | - '_decimal', | |
156 | - 'libmpdec'))] | 169 | - 'libmpdec'))] | |
157 | + include_dirs = ['Modules/_decimal/libmpdec'] | 170 | + include_dirs = ['Modules/_decimal/libmpdec'] | |
158 | libraries = ['m'] | 171 | libraries = ['m'] | |
159 | sources = [ | 172 | sources = [ | |
160 | '_decimal/_decimal.c', | 173 | '_decimal/_decimal.c', | |
161 | @@ -2745,7 +2779,7 @@ def main(): | 174 | @@ -2747,7 +2787,7 @@ def main(): | |
162 | # If you change the scripts installed here, you also need to | 175 | # If you change the scripts installed here, you also need to | |
163 | # check the PyBuildScripts command above, and change the links | 176 | # check the PyBuildScripts command above, and change the links | |
164 | # created by the bininstall target in Makefile.pre.in | 177 | # created by the bininstall target in Makefile.pre.in | |
165 | - scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", | 178 | - scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", | |
166 | + scripts = ["Tools/scripts/pydoc3", | 179 | + scripts = ["Tools/scripts/pydoc3", | |
167 | "Tools/scripts/2to3"] | 180 | "Tools/scripts/2to3"] | |
168 | ) | 181 | ) | |
169 | 182 |