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