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