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