| @@ -1,177 +1,175 @@ | | | @@ -1,177 +1,175 @@ |
1 | # $NetBSD: Makefile,v 1.3 2011/04/22 13:42:06 obache Exp $ | | 1 | # $NetBSD: Makefile,v 1.4 2011/04/23 10:35:28 tron 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= 2 | | 6 | PKGREVISION= 3 |
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 | PKG_DESTDIR_SUPPORT= user-destdir | | 14 | PKG_DESTDIR_SUPPORT= user-destdir |
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 | | | 24 | |
25 | LDFLAGS+= -L${WRKSRC} | | 25 | LDFLAGS+= -L${WRKSRC} |
26 | | | 26 | |
27 | # $RANDOM usage there is fine | | 27 | # $RANDOM usage there is fine |
28 | CHECK_PORTABILITY_SKIP= Tools/faqwiz/move-faqwiz.sh | | 28 | CHECK_PORTABILITY_SKIP= Tools/faqwiz/move-faqwiz.sh |
29 | | | 29 | |
30 | USE_LANGUAGES= c c++ | | 30 | USE_LANGUAGES= c c++ |
31 | | | 31 | |
32 | PTHREAD_OPTS+= require | | 32 | PTHREAD_OPTS+= require |
33 | .include "../../mk/pthread.buildlink3.mk" | | 33 | .include "../../mk/pthread.buildlink3.mk" |
34 | .if ${PTHREAD_TYPE} == "pth" | | 34 | .if ${PTHREAD_TYPE} == "pth" |
35 | CONFIGURE_ARGS+= --with-pth | | 35 | CONFIGURE_ARGS+= --with-pth |
36 | .endif | | 36 | .endif |
37 | | | 37 | |
38 | .include "../../mk/bsd.prefs.mk" | | 38 | .include "../../mk/bsd.prefs.mk" |
39 | | | 39 | |
40 | # fdatasync() | | 40 | # fdatasync() |
41 | LIBS.SunOS+= -lrt | | 41 | LIBS.SunOS+= -lrt |
42 | | | 42 | |
43 | PY_VER_SUFFIX= 2.7 | | 43 | PY_VER_SUFFIX= 2.7 |
44 | | | 44 | |
45 | PLIST_SRC= ${.CURDIR}/../../lang/python27/PLIST.common | | 45 | PLIST_SRC= ${.CURDIR}/../../lang/python27/PLIST.common |
46 | .if exists(${.CURDIR}/../../lang/python27/PLIST.${OPSYS}) | | 46 | .if exists(${.CURDIR}/../../lang/python27/PLIST.${OPSYS}) |
47 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.${OPSYS} | | 47 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.${OPSYS} |
48 | .endif | | 48 | .endif |
49 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.common_end | | 49 | PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.common_end |
50 | | | 50 | |
51 | .if ${OPSYS} == "NetBSD" | | 51 | .if ${OPSYS} == "NetBSD" |
52 | PRIVILEGED_STAGES+= clean | | 52 | PRIVILEGED_STAGES+= clean |
53 | # XXX work around a botched autoconf check which ignores libintl | | 53 | # XXX work around a botched autoconf check which ignores libintl |
54 | CONFIGURE_ENV+= ac_cv_func_bind_textdomain_codeset=yes | | 54 | CONFIGURE_ENV+= ac_cv_func_bind_textdomain_codeset=yes |
55 | .endif | | 55 | .endif |
56 | | | 56 | |
57 | .if ${OPSYS} == "Darwin" || ${OPSYS} == "Interix" | | 57 | .if ${OPSYS} == "Darwin" || ${OPSYS} == "Interix" |
58 | PY_PLATNAME= ${LOWER_OPSYS} | | 58 | PY_PLATNAME= ${LOWER_OPSYS} |
59 | USE_TOOLS+= gmake | | 59 | USE_TOOLS+= gmake |
60 | .elif ${OPSYS} == "IRIX" | | 60 | .elif ${OPSYS} == "IRIX" |
61 | PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} | | 61 | PY_PLATNAME= ${LOWER_OPSYS:C/\..*//} |
62 | .elif ${OPSYS} == "SunOS" | | 62 | .elif ${OPSYS} == "SunOS" |
63 | PY_PLATNAME= sunos${OS_VERSION:C/\..*//} | | 63 | PY_PLATNAME= sunos${OS_VERSION:C/\..*//} |
64 | .elif ${OPSYS} == "HPUX" | | 64 | .elif ${OPSYS} == "HPUX" |
65 | PY_PLATNAME= hp-ux11 | | 65 | PY_PLATNAME= hp-ux11 |
66 | .else | | 66 | .else |
67 | PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} | | 67 | PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//} |
68 | .endif | | 68 | .endif |
69 | PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} | | 69 | PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q} |
70 | | | 70 | |
71 | .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "amd64") || \ | | 71 | .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "amd64") || \ |
72 | (${MACHINE_ARCH} == "sparc64") || (${MACHINE_ARCH} == "x86_64") || \ | | 72 | (${MACHINE_ARCH} == "sparc64") || (${MACHINE_ARCH} == "x86_64") || \ |
73 | (defined(ABI) && ${ABI} == "64") | | 73 | (defined(ABI) && ${ABI} == "64") |
74 | IS_64BIT_PLATFORM?= yes | | 74 | IS_64BIT_PLATFORM?= yes |
75 | .else | | 75 | .else |
76 | IS_64BIT_PLATFORM?= no | | 76 | IS_64BIT_PLATFORM?= no |
77 | .endif | | 77 | .endif |
78 | | | 78 | |
79 | # the dl module isn't built for 64 bit archs | | 79 | # the dl module isn't built for 64 bit archs |
80 | PLIST_VARS+= dl | | 80 | PLIST_VARS+= dl |
81 | .if empty(IS_64BIT_PLATFORM:M[yY][eE][sS]) | | 81 | .if empty(IS_64BIT_PLATFORM:M[yY][eE][sS]) |
82 | PLIST.dl= yes | | 82 | PLIST.dl= yes |
83 | .endif | | 83 | .endif |
84 | | | 84 | |
85 | # builds additional modules if OpenSSL < 0.9.8 | | 85 | # builds additional modules if OpenSSL < 0.9.8 |
86 | PLIST_VARS+= openssl097 | | 86 | PLIST_VARS+= openssl097 |
87 | CHECK_BUILTIN.openssl:= no | | 87 | CHECK_BUILTIN.openssl:= no |
88 | .include "../../security/openssl/builtin.mk" | | 88 | .include "../../security/openssl/builtin.mk" |
89 | CHECK_BUILTIN.openssl:= yes | | 89 | CHECK_BUILTIN.openssl:= yes |
90 | .if !empty(USE_BUILTIN.openssl:M[yY][eE][sS]) && \ | | 90 | .if !empty(USE_BUILTIN.openssl:M[yY][eE][sS]) && \ |
91 | !empty(BUILTIN_PKG.openssl:Mopenssl-0.9.[67]*) | | 91 | !empty(BUILTIN_PKG.openssl:Mopenssl-0.9.[67]*) |
92 | PLIST.openssl097= yes | | 92 | PLIST.openssl097= yes |
93 | .endif | | 93 | .endif |
94 | | | 94 | |
95 | # setup.py causes some modules to be built if the platform is *not* 64bit. | | 95 | # setup.py causes some modules to be built if the platform is *not* 64bit. |
96 | PLIST_VARS+= extra-so | | 96 | PLIST_VARS+= extra-so |
97 | .if !empty(IS_64BIT_PLATFORM:M[nN][oO]) | | 97 | .if !empty(IS_64BIT_PLATFORM:M[nN][oO]) |
98 | PLIST.extra-so= yes | | 98 | PLIST.extra-so= yes |
99 | .endif | | 99 | .endif |
100 | | | 100 | |
101 | # Make sure python modules can link correctly | | 101 | # Make sure python modules can link correctly |
102 | .if ${OPSYS} == "Darwin" | | 102 | .if ${OPSYS} == "Darwin" |
103 | INSTALL_UNSTRIPPED= yes | | 103 | INSTALL_UNSTRIPPED= yes |
104 | .endif | | 104 | .endif |
105 | | | 105 | |
106 | PLIST_VARS+= dll nis no-nis | | 106 | PLIST_VARS+= dll nis no-nis |
107 | .if ${OPSYS} == "IRIX" | | 107 | .if ${OPSYS} == "IRIX" |
108 | . if ${ABI} == "64" | | 108 | . if ${ABI} == "64" |
109 | PLIST.no-nis= yes | | 109 | PLIST.no-nis= yes |
110 | . else | | 110 | . else |
111 | PLIST.nis= yes | | 111 | PLIST.nis= yes |
112 | . endif | | 112 | . endif |
113 | .else | | 113 | .else |
114 | PLIST.dll= yes | | 114 | PLIST.dll= yes |
115 | . if ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat) | | 115 | . if ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat) |
116 | PLIST.nis= yes | | 116 | PLIST.nis= yes |
117 | . else | | 117 | . else |
118 | PLIST.no-nis= yes | | 118 | PLIST.no-nis= yes |
119 | . endif | | 119 | . endif |
120 | .endif | | 120 | .endif |
121 | | | 121 | |
122 | .include "../../mk/bdb.buildlink3.mk" | | 122 | .include "../../mk/bdb.buildlink3.mk" |
123 | MAKE_ENV+= PY_BDB_TYPE=${BDB_TYPE} | | 123 | MAKE_ENV+= PY_BDB_TYPE=${BDB_TYPE} |
124 | .if empty(BDB_LIBS) | | 124 | .if empty(BDB_LIBS) |
125 | BUILDLINK_TRANSFORM+= rm:-ldb | | 125 | BUILDLINK_TRANSFORM+= rm:-ldb |
126 | .endif | | 126 | .endif |
127 | CFLAGS+= -DHAVE_DB_185_H | | 127 | CFLAGS+= -DHAVE_DB_185_H |
128 | | | 128 | |
129 | .if ${OPSYS} == "OSF1" | | 129 | .if ${OPSYS} == "OSF1" |
130 | # configure complains about buggy getaddrinfo() | | 130 | # configure complains about buggy getaddrinfo() |
131 | CONFIGURE_ARGS+= --disable-ipv6 | | 131 | CONFIGURE_ARGS+= --disable-ipv6 |
132 | .endif | | 132 | .endif |
133 | | | 133 | |
134 | .if defined(BUILDLINK_TRANSFORM) | | 134 | .if defined(BUILDLINK_TRANSFORM) |
135 | MAKE_ENV+= PY_BDB_TRANSFORM=${BUILDLINK_TRANSFORM:Q} | | 135 | MAKE_ENV+= PY_BDB_TRANSFORM=${BUILDLINK_TRANSFORM:Q} |
136 | .endif | | 136 | .endif |
137 | | | 137 | |
138 | PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q} | | 138 | PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q} |
139 | | | 139 | |
140 | TEST_TARGET= test | | 140 | TEST_TARGET= test |
141 | INSTALL_TARGET= altinstall | | 141 | INSTALL_TARGET= altinstall |
142 | | | 142 | |
143 | REPLACE_INTERPRETER+= py27 | | 143 | REPLACE_INTERPRETER+= py27 |
144 | REPLACE.py27.old= .*python[^ ]* | | 144 | REPLACE.py27.old= .*python[^ ]* |
145 | REPLACE.py27.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} | | 145 | REPLACE.py27.new= ${PREFIX}/bin/python${PY_VER_SUFFIX} |
146 | REPLACE_FILES.py27= Lib/cgi.py # explicitly demanded to be patched | | 146 | REPLACE_FILES.py27= Lib/*.py Lib/*/*.py Lib/*/*/*.py |
147 | REPLACE_FILES.py27+= Lib/bsddb/dbshelve.py Lib/test/test_bz2.py | | | |
148 | REPLACE_FILES.py27+= Lib/test/test_largefile.py Lib/test/test_optparse.py | | | |
149 | | | 147 | |
150 | SUBST_CLASSES+= findlib | | 148 | SUBST_CLASSES+= findlib |
151 | SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin. | | 149 | SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin. |
152 | SUBST_STAGE.findlib= pre-configure | | 150 | SUBST_STAGE.findlib= pre-configure |
153 | SUBST_FILES.findlib= Lib/distutils/unixccompiler.py | | 151 | SUBST_FILES.findlib= Lib/distutils/unixccompiler.py |
154 | SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' | | 152 | SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' |
155 | | | 153 | |
156 | post-extract: | | 154 | post-extract: |
157 | ${MV} ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Lib/smtpd${PY_VER_SUFFIX}.py | | 155 | ${MV} ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Lib/smtpd${PY_VER_SUFFIX}.py |
158 | ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX} | | 156 | ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX} |
159 | ${MV} ${WRKSRC}/Tools/scripts/2to3 ${WRKSRC}/Tools/scripts/2to3-${PY_VER_SUFFIX} | | 157 | ${MV} ${WRKSRC}/Tools/scripts/2to3 ${WRKSRC}/Tools/scripts/2to3-${PY_VER_SUFFIX} |
160 | | | 158 | |
161 | .if ${OPSYS} == "HPUX" | | 159 | .if ${OPSYS} == "HPUX" |
162 | post-install: | | 160 | post-install: |
163 | ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.7.sl \ | | 161 | ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.7.sl \ |
164 | ${DESTDIR}${PREFIX}/lib/libpython2.7.sl.1.0 | | 162 | ${DESTDIR}${PREFIX}/lib/libpython2.7.sl.1.0 |
165 | .endif | | 163 | .endif |
166 | | | 164 | |
167 | USE_GNU_READLINE= yes | | 165 | USE_GNU_READLINE= yes |
168 | BUILDLINK_DEPMETHOD.readline= build | | 166 | BUILDLINK_DEPMETHOD.readline= build |
169 | | | 167 | |
170 | .include "../../archivers/bzip2/buildlink3.mk" | | 168 | .include "../../archivers/bzip2/buildlink3.mk" |
171 | .include "../../devel/gettext-lib/buildlink3.mk" | | 169 | .include "../../devel/gettext-lib/buildlink3.mk" |
172 | .include "../../devel/libffi/buildlink3.mk" | | 170 | .include "../../devel/libffi/buildlink3.mk" |
173 | .include "../../devel/readline/buildlink3.mk" | | 171 | .include "../../devel/readline/buildlink3.mk" |
174 | .include "../../devel/zlib/buildlink3.mk" | | 172 | .include "../../devel/zlib/buildlink3.mk" |
175 | .include "../../security/openssl/buildlink3.mk" | | 173 | .include "../../security/openssl/buildlink3.mk" |
176 | .include "../../mk/dlopen.buildlink3.mk" | | 174 | .include "../../mk/dlopen.buildlink3.mk" |
177 | .include "../../mk/bsd.pkg.mk" | | 175 | .include "../../mk/bsd.pkg.mk" |