| @@ -1,212 +1,213 @@ | | | @@ -1,212 +1,213 @@ |
1 | # $NetBSD: Makefile,v 1.69 2017/01/26 23:10:35 wiz Exp $ | | 1 | # $NetBSD: Makefile,v 1.70 2017/02/01 11:31:50 jperkin Exp $ |
2 | | | 2 | |
3 | .include "dist.mk" | | 3 | .include "dist.mk" |
4 | | | 4 | |
5 | PKGNAME= python27-${PY_DISTVERSION} | | 5 | PKGNAME= python27-${PY_DISTVERSION} |
6 | PKGREVISION= 1 | | 6 | PKGREVISION= 1 |
7 | CATEGORIES= lang python | | 7 | CATEGORIES= lang python |
8 | | | 8 | |
9 | MAINTAINER= pkgsrc-users@NetBSD.org | | 9 | MAINTAINER= pkgsrc-users@NetBSD.org |
10 | HOMEPAGE= http://www.python.org/ | | 10 | HOMEPAGE= http://www.python.org/ |
11 | COMMENT= Interpreted, interactive, object-oriented programming language | | 11 | COMMENT= Interpreted, interactive, object-oriented programming language |
12 | LICENSE= python-software-foundation | | 12 | LICENSE= python-software-foundation |
13 | | | 13 | |
14 | DEPENDS= mozilla-rootcerts>=1.0.20150804nb1:../../security/mozilla-rootcerts | | 14 | DEPENDS= mozilla-rootcerts>=1.0.20150804nb1:../../security/mozilla-rootcerts |
15 | | | 15 | |
16 | CONFLICTS+= python-[0-9]* | | 16 | CONFLICTS+= python-[0-9]* |
17 | | | 17 | |
18 | GNU_CONFIGURE= yes | | 18 | GNU_CONFIGURE= yes |
19 | CONFIGURE_ARGS+= --with-threads | | 19 | CONFIGURE_ARGS+= --with-threads |
20 | CONFIGURE_ARGS+= --enable-shared | | 20 | CONFIGURE_ARGS+= --enable-shared |
21 | CONFIGURE_ARGS+= OPT=${CFLAGS:Q} | | 21 | CONFIGURE_ARGS+= OPT=${CFLAGS:Q} |
22 | CONFIGURE_ARGS+= --with-system-ffi | | 22 | CONFIGURE_ARGS+= --with-system-ffi |
23 | CONFIGURE_ARGS+= --with-dbmliborder=ndbm:bdb | | 23 | CONFIGURE_ARGS+= --with-dbmliborder=ndbm:bdb |
24 | CONFIGURE_ENV+= MKDIR_P=${MKDIR:Q} | | 24 | CONFIGURE_ENV+= MKDIR_P=${MKDIR:Q} |
25 | | | 25 | |
26 | PKGCONFIG_OVERRIDE+= Misc/python.pc.in | | 26 | PKGCONFIG_OVERRIDE+= Misc/python.pc.in |
27 | | | 27 | |
28 | LDFLAGS+= -L${WRKSRC} | | 28 | LDFLAGS+= -L${WRKSRC} |
29 | | | 29 | |
30 | # $RANDOM usage there is fine | | 30 | # $RANDOM usage there is fine |
31 | CHECK_PORTABILITY_SKIP= Tools/faqwiz/move-faqwiz.sh | | 31 | CHECK_PORTABILITY_SKIP= Tools/faqwiz/move-faqwiz.sh |
32 | | | 32 | |
33 | USE_LANGUAGES= c c++ | | 33 | USE_LANGUAGES= c c++ |
34 | | | 34 | |
35 | PTHREAD_OPTS+= require | | 35 | PTHREAD_OPTS+= require |
36 | PTHREAD_AUTO_VARS= yes | | 36 | PTHREAD_AUTO_VARS= yes |
37 | .include "../../mk/pthread.buildlink3.mk" | | 37 | .include "../../mk/pthread.buildlink3.mk" |
38 | .if ${PTHREAD_TYPE} == "pth" | | 38 | .if ${PTHREAD_TYPE} == "pth" |
39 | CONFIGURE_ARGS+= --with-pth | | 39 | CONFIGURE_ARGS+= --with-pth |
40 | .endif | | 40 | .endif |
41 | | | 41 | |
42 | .include "../../mk/compiler.mk" | | 42 | .include "../../mk/compiler.mk" |
43 | | | 43 | |
44 | # Clang needs -fwrapv | | 44 | # Clang needs -fwrapv |
45 | .if !empty(PKGSRC_COMPILER:Mclang) | | 45 | .if !empty(PKGSRC_COMPILER:Mclang) |
46 | CFLAGS+= -fwrapv | | 46 | CFLAGS+= -fwrapv |
47 | .endif | | 47 | .endif |
48 | | | 48 | |
49 | .include "../../mk/bsd.prefs.mk" | | 49 | .include "../../mk/bsd.prefs.mk" |
50 | | | 50 | |
51 | # fdatasync() | | 51 | # fdatasync() |
52 | LIBS.SunOS+= -lrt | | 52 | LIBS.SunOS+= -lrt |
53 | | | 53 | |
54 | PY_VER_SUFFIX= 2.7 | | 54 | PY_VER_SUFFIX= 2.7 |
55 | | | 55 | |
56 | PLIST_SRC= ${.CURDIR}/../../lang/python27/PLIST.common | | 56 | PLIST_SRC= ${.CURDIR}/../../lang/python27/PLIST.common |
57 | .if exists(${.CURDIR}/../../lang/python27/PLIST.${OPSYS}) | | 57 | .if exists(${.CURDIR}/../../lang/python27/PLIST.${OPSYS}) |
58 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.${OPSYS} | | 58 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.${OPSYS} |
59 | .endif | | 59 | .endif |
60 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.common_end | | 60 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.common_end |
61 | | | 61 | |
62 | .if ${OPSYS} == "NetBSD" | | 62 | .if ${OPSYS} == "NetBSD" |
63 | # XXX work around a botched autoconf check which ignores libintl | | 63 | # XXX work around a botched autoconf check which ignores libintl |
64 | CONFIGURE_ENV+= ac_cv_func_bind_textdomain_codeset=yes | | 64 | CONFIGURE_ENV+= ac_cv_func_bind_textdomain_codeset=yes |
65 | .endif | | 65 | .endif |
66 | | | 66 | |
67 | .if ${OPSYS} == "Cygwin" || ${OPSYS} == "Darwin" || ${OPSYS} == "Interix" | | 67 | .if ${OPSYS} == "Cygwin" || ${OPSYS} == "Darwin" || ${OPSYS} == "Interix" |
68 | PY_PLATNAME= ${LOWER_OPSYS} | | 68 | PY_PLATNAME= ${LOWER_OPSYS} |
69 | USE_TOOLS+= gmake | | 69 | USE_TOOLS+= gmake |
70 | .elif ${OPSYS} == "IRIX" | | 70 | .elif ${OPSYS} == "IRIX" |
71 | PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} | | 71 | PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} |
72 | .elif ${OPSYS} == "SunOS" | | 72 | .elif ${OPSYS} == "SunOS" |
73 | PY_PLATNAME= sunos${OS_VERSION:C/\..*//} | | 73 | PY_PLATNAME= sunos${OS_VERSION:C/\..*//} |
74 | .elif ${OPSYS} == "HPUX" | | 74 | .elif ${OPSYS} == "HPUX" |
75 | PY_PLATNAME= hp-ux11 | | 75 | PY_PLATNAME= hp-ux11 |
76 | .elif ${OPSYS} == "Linux" | | 76 | .elif ${OPSYS} == "Linux" |
77 | PY_PLATNAME= linux2 | | 77 | PY_PLATNAME= linux2 |
78 | .elif ${OS_VARIANT} == "SCOOSR5" | | 78 | .elif ${OS_VARIANT} == "SCOOSR5" |
79 | PY_PLATNAME= sco_sv3 | | 79 | PY_PLATNAME= sco_sv3 |
80 | .else | | 80 | .else |
81 | PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} | | 81 | PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} |
82 | .endif | | 82 | .endif |
83 | PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} | | 83 | PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} |
84 | | | 84 | |
85 | .if !empty(LP64PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@) || \ | | 85 | .if !empty(LP64PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@) || \ |
86 | (defined(ABI) && ${ABI} == "64") | | 86 | (defined(ABI) && ${ABI} == "64") |
87 | IS_64BIT_PLATFORM?= yes | | 87 | IS_64BIT_PLATFORM?= yes |
88 | .else | | 88 | .else |
89 | IS_64BIT_PLATFORM?= no | | 89 | IS_64BIT_PLATFORM?= no |
90 | .endif | | 90 | .endif |
91 | | | 91 | |
92 | # the dl module isn't built for 64 bit archs | | 92 | # the dl module isn't built for 64 bit archs |
93 | PLIST_VARS+= dl | | 93 | PLIST_VARS+= dl |
94 | .if empty(IS_64BIT_PLATFORM:M[yY][eE][sS]) | | 94 | .if empty(IS_64BIT_PLATFORM:M[yY][eE][sS]) |
95 | PLIST.dl= yes | | 95 | PLIST.dl= yes |
96 | .endif | | 96 | .endif |
97 | | | 97 | |
98 | # setup.py causes some modules to be built if the platform is *not* 64bit. | | 98 | # setup.py causes some modules to be built if the platform is *not* 64bit. |
99 | PLIST_VARS+= extra-so | | 99 | PLIST_VARS+= extra-so |
100 | .if !empty(IS_64BIT_PLATFORM:M[nN][oO]) | | 100 | .if !empty(IS_64BIT_PLATFORM:M[nN][oO]) |
101 | PLIST.extra-so= yes | | 101 | PLIST.extra-so= yes |
102 | .endif | | 102 | .endif |
103 | | | 103 | |
104 | # For Xcode 5 we need to search the SDK path for headers, otherwise certain | | 104 | # For Xcode 5 we need to search the SDK path for headers, otherwise certain |
105 | # modules will not be built. | | 105 | # modules will not be built. |
106 | .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH}/usr/include) | | 106 | .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH}/usr/include) |
107 | CFLAGS+= -I${OSX_SDK_PATH}/usr/include | | 107 | CFLAGS+= -I${OSX_SDK_PATH}/usr/include |
108 | .endif | | 108 | .endif |
109 | | | 109 | |
110 | PLIST_VARS+= dll nis no-nis | | 110 | PLIST_VARS+= dll nis no-nis |
111 | .if ${OPSYS} == "IRIX" | | 111 | .if ${OPSYS} == "IRIX" |
112 | . if ${ABI} == "64" | | 112 | . if ${ABI} == "64" |
113 | PLIST.no-nis= yes | | 113 | PLIST.no-nis= yes |
114 | . else | | 114 | . else |
115 | PLIST.nis= yes | | 115 | PLIST.nis= yes |
116 | . endif | | 116 | . endif |
117 | .else | | 117 | .else |
118 | PLIST.dll= yes | | 118 | PLIST.dll= yes |
119 | . if ${OPSYS} == "MirBSD" | | 119 | . if ${OPSYS} == "MirBSD" |
120 | # neither nis nor no-nis | | 120 | # neither nis nor no-nis |
121 | . elif ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat) | | 121 | . elif ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat) |
122 | PLIST.nis= yes | | 122 | PLIST.nis= yes |
123 | . else | | 123 | . else |
124 | PLIST.no-nis= yes | | 124 | PLIST.no-nis= yes |
125 | . endif | | 125 | . endif |
126 | .endif | | 126 | .endif |
127 | | | 127 | |
128 | # configure complains about buggy getaddrinfo() | | 128 | # configure complains about buggy getaddrinfo() |
129 | CONFIGURE_ARGS.OSF1+= --disable-ipv6 | | 129 | CONFIGURE_ARGS.OSF1+= --disable-ipv6 |
130 | | | 130 | |
131 | PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q} | | 131 | PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q} |
132 | | | 132 | |
133 | TEST_TARGET= test | | 133 | TEST_TARGET= test |
134 | INSTALL_TARGET= altinstall | | 134 | INSTALL_TARGET= altinstall |
135 | | | 135 | |
136 | REPLACE_INTERPRETER+= py27 | | 136 | REPLACE_INTERPRETER+= py27 |
137 | REPLACE.py27.old= .*python[^ ]* | | 137 | REPLACE.py27.old= .*python[^ ]* |
138 | REPLACE.py27.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} | | 138 | REPLACE.py27.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} |
139 | REPLACE_FILES.py27= Lib/*.py Lib/*/*.py Lib/*/*/*.py | | 139 | REPLACE_FILES.py27= Lib/*.py Lib/*/*.py Lib/*/*/*.py |
140 | REPLACE_FILES.py27+= Lib/*/*/*/*.py | | 140 | REPLACE_FILES.py27+= Lib/*/*/*/*.py |
141 | | | 141 | |
142 | SUBST_CLASSES+= libffi | | 142 | SUBST_CLASSES+= libffi |
143 | SUBST_MESSAGE.libffi= Fixing libffi include path on Darwin. | | 143 | SUBST_MESSAGE.libffi= Fixing libffi include path on Darwin. |
144 | SUBST_STAGE.libffi= pre-configure | | 144 | SUBST_STAGE.libffi= pre-configure |
145 | SUBST_FILES.libffi= setup.py | | 145 | SUBST_FILES.libffi= setup.py |
146 | SUBST_SED.libffi= -e 's,/usr/include/ffi,${BUILDLINK_PREFIX.libffi}/include,' | | 146 | SUBST_SED.libffi= -e 's,/usr/include/ffi,${BUILDLINK_PREFIX.libffi}/include,' |
147 | | | 147 | |
148 | SUBST_CLASSES+= findlib | | 148 | SUBST_CLASSES+= findlib |
149 | SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin. | | 149 | SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin. |
150 | SUBST_STAGE.findlib= pre-configure | | 150 | SUBST_STAGE.findlib= pre-configure |
151 | SUBST_FILES.findlib= Lib/distutils/unixccompiler.py | | 151 | SUBST_FILES.findlib= Lib/distutils/unixccompiler.py |
152 | SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' | | 152 | SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' |
153 | | | 153 | |
154 | # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib | | 154 | # XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib |
155 | # Testing: | | 155 | # Testing: |
156 | # >>> from ctypes.util import find_library | | 156 | # >>> from ctypes.util import find_library |
157 | # >>> find_library("m") | | 157 | # >>> find_library("m") |
158 | # 'libm.so.0' | | 158 | # 'libm.so.0' |
159 | # >>> find_library("crypto") | | 159 | # >>> find_library("crypto") |
160 | # 'libcrypto.so.11' | | 160 | # 'libcrypto.so.11' |
161 | # >>> find_library("GL") | | 161 | # >>> find_library("GL") |
162 | # 'libGL.so.2' | | 162 | # 'libGL.so.2' |
163 | # >>> find_library("curl") | | 163 | # >>> find_library("curl") |
164 | # 'libcurl.so.4' | | 164 | # 'libcurl.so.4' |
165 | | | 165 | |
166 | SUBST_CLASSES+= pfindlib | | 166 | SUBST_CLASSES+= pfindlib |
167 | SUBST_MESSAGE.pfindlib= Fixing find_library() on POSIX-like (excluding Darwin) systems. | | 167 | SUBST_MESSAGE.pfindlib= Fixing find_library() on POSIX-like (excluding Darwin) systems. |
168 | SUBST_STAGE.pfindlib= pre-configure | | 168 | SUBST_STAGE.pfindlib= pre-configure |
169 | SUBST_FILES.pfindlib= Lib/ctypes/util.py | | 169 | SUBST_FILES.pfindlib= Lib/ctypes/util.py |
170 | SUBST_SED.pfindlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!' | | 170 | SUBST_SED.pfindlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!' |
171 | | | 171 | |
172 | .include "options.mk" | | 172 | .include "options.mk" |
173 | | | 173 | |
174 | SUBST_CLASSES+= sslbase | | 174 | SUBST_CLASSES+= sslbase |
175 | SUBST_MESSAGE.sslbase= Fixing find-file for openssl with SSLBASE. | | 175 | SUBST_MESSAGE.sslbase= Fixing find-file for openssl with SSLBASE. |
176 | SUBST_STAGE.sslbase= pre-configure | | 176 | SUBST_STAGE.sslbase= pre-configure |
177 | SUBST_FILES.sslbase= setup.py | | 177 | SUBST_FILES.sslbase= setup.py |
178 | SUBST_VARS.sslbase= SSLBASE | | 178 | SUBST_VARS.sslbase= SSLBASE |
179 | | | 179 | |
180 | SUBST_CLASSES+= cacert | | 180 | SUBST_CLASSES+= cacert |
181 | SUBST_MESSAGE.cacert= Configuring location of default CA certificate file. | | 181 | SUBST_MESSAGE.cacert= Configuring location of default CA certificate file. |
182 | SUBST_STAGE.cacert= pre-configure | | 182 | SUBST_STAGE.cacert= pre-configure |
183 | SUBST_FILES.cacert= Modules/_ssl.c | | 183 | SUBST_FILES.cacert= Modules/_ssl.c |
184 | SUBST_SED.cacert= -e 's,@PREFIX@,${PREFIX},' | | 184 | SUBST_SED.cacert= -e 's,@PREFIX@,${PREFIX},' |
185 | | | 185 | |
186 | post-extract: | | 186 | post-extract: |
187 | ${LN} -s ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Tools/scripts/smtpd${PY_VER_SUFFIX}.py | | 187 | ${LN} -s ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Tools/scripts/smtpd${PY_VER_SUFFIX}.py |
188 | ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX} | | 188 | ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX} |
189 | ${MV} ${WRKSRC}/Tools/scripts/2to3 ${WRKSRC}/Tools/scripts/2to3-${PY_VER_SUFFIX} | | 189 | ${MV} ${WRKSRC}/Tools/scripts/2to3 ${WRKSRC}/Tools/scripts/2to3-${PY_VER_SUFFIX} |
190 | | | 190 | |
191 | .if ${OPSYS} == "HPUX" | | 191 | .if ${OPSYS} == "HPUX" |
192 | post-install: | | 192 | post-install: |
193 | ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.7.sl \ | | 193 | ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.7.sl \ |
194 | ${DESTDIR}${PREFIX}/lib/libpython2.7.sl.1.0 | | 194 | ${DESTDIR}${PREFIX}/lib/libpython2.7.sl.1.0 |
195 | .endif | | 195 | .endif |
196 | | | 196 | |
197 | .if ${OS_VARIANT} == "SCOOSR5" | | 197 | .if ${OS_VARIANT} == "SCOOSR5" |
198 | # SCO OpenServer 5.0.7/3.2 has no socklen_t in system headers, but has in | | 198 | # SCO OpenServer 5.0.7/3.2 has no socklen_t in system headers, but has in |
199 | # GNU pth's header. It should be used in this case. | | 199 | # GNU pth's header. It should be used in this case. |
200 | CONFIGURE_ENV+= ac_cv_type_socklen_t=yes | | 200 | CONFIGURE_ENV+= ac_cv_type_socklen_t=yes |
201 | .endif | | 201 | .endif |
202 | | | 202 | |
203 | BUILDLINK_DEPMETHOD.readline= build | | 203 | BUILDLINK_DEPMETHOD.readline= build |
204 | | | 204 | |
205 | .include "../../archivers/bzip2/buildlink3.mk" | | 205 | .include "../../archivers/bzip2/buildlink3.mk" |
206 | .include "../../devel/gettext-lib/buildlink3.mk" | | 206 | .include "../../devel/gettext-lib/buildlink3.mk" |
207 | .include "../../devel/libffi/buildlink3.mk" | | 207 | .include "../../devel/libffi/buildlink3.mk" |
208 | .include "../../devel/readline/buildlink3.mk" | | 208 | .include "../../devel/readline/buildlink3.mk" |
209 | .include "../../devel/zlib/buildlink3.mk" | | 209 | .include "../../devel/zlib/buildlink3.mk" |
210 | .include "../../security/openssl/buildlink3.mk" | | 210 | .include "../../security/openssl/buildlink3.mk" |
| | | 211 | .include "../../mk/bdb.buildlink3.mk" |
211 | .include "../../mk/dlopen.buildlink3.mk" | | 212 | .include "../../mk/dlopen.buildlink3.mk" |
212 | .include "../../mk/bsd.pkg.mk" | | 213 | .include "../../mk/bsd.pkg.mk" |