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