Annotation of pkgsrc/lang/python27/Makefile, revision 1.34
1.34 ! tron 1: # $NetBSD: Makefile,v 1.33 2013/12/12 11:34:23 jperkin Exp $
1.1 obache 2:
3: .include "dist.mk"
4:
5: PKGNAME= python27-${PY_DISTVERSION}
1.34 ! tron 6: PKGREVISION= 1
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
1.25 sbd 22: CONFIGURE_ENV+= MKDIR_P=${MKDIR:Q}
1.1 obache 23:
1.31 obache 24: PKGCONFIG_OVERRIDE+= Misc/python.pc.in
25:
1.1 obache 26: LDFLAGS+= -L${WRKSRC}
27:
28: # $RANDOM usage there is fine
29: CHECK_PORTABILITY_SKIP= Tools/faqwiz/move-faqwiz.sh
30:
31: USE_LANGUAGES= c c++
32:
33: PTHREAD_OPTS+= require
34: .include "../../mk/pthread.buildlink3.mk"
35: .if ${PTHREAD_TYPE} == "pth"
36: CONFIGURE_ARGS+= --with-pth
37: .endif
38:
1.6 adam 39: .include "../../mk/compiler.mk"
40:
41: # Clang needs -fwrapv
42: .if !empty(PKGSRC_COMPILER:Mclang)
43: CFLAGS+= -fwrapv
44: .endif
45:
1.1 obache 46: .include "../../mk/bsd.prefs.mk"
47:
48: # fdatasync()
49: LIBS.SunOS+= -lrt
50:
51: PY_VER_SUFFIX= 2.7
52:
53: PLIST_SRC= ${.CURDIR}/../../lang/python27/PLIST.common
54: .if exists(${.CURDIR}/../../lang/python27/PLIST.${OPSYS})
55: PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.${OPSYS}
56: .endif
1.9 obache 57: PLIST_SRC+= ${.CURDIR}/../../lang/python27/PLIST.common_end
1.1 obache 58:
59: .if ${OPSYS} == "NetBSD"
1.23 adam 60: . if !defined(USE_DESTDIR) || empty(USE_DESTDIR:M[Yy][Ee][Ss])
1.1 obache 61: PRIVILEGED_STAGES+= clean
1.23 adam 62: . endif
1.1 obache 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.1 obache 78: .else
79: PY_PLATNAME= ${LOWER_OPSYS}${OS_VERSION:C/\..*//}
80: .endif
81: PLIST_SUBST+= PY_PLATNAME=${PY_PLATNAME:Q}
82:
83: .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "amd64") || \
84: (${MACHINE_ARCH} == "sparc64") || (${MACHINE_ARCH} == "x86_64") || \
1.30 joerg 85: (${MACHINE_ARCH} == "powerpc64") || (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: # builds additional modules if OpenSSL < 0.9.8
98: PLIST_VARS+= openssl097
1.17 obache 99: CHECK_BUILTIN.openssl:= yes
100: .include "../../security/openssl/builtin.mk"
1.1 obache 101: CHECK_BUILTIN.openssl:= no
102: .if !empty(USE_BUILTIN.openssl:M[yY][eE][sS]) && \
103: !empty(BUILTIN_PKG.openssl:Mopenssl-0.9.[67]*)
104: PLIST.openssl097= yes
105: .endif
106:
107: # setup.py causes some modules to be built if the platform is *not* 64bit.
108: PLIST_VARS+= extra-so
109: .if !empty(IS_64BIT_PLATFORM:M[nN][oO])
110: PLIST.extra-so= yes
111: .endif
112:
113: # Make sure python modules can link correctly
114: .if ${OPSYS} == "Darwin"
115: INSTALL_UNSTRIPPED= yes
116: .endif
117:
1.33 jperkin 118: # For Xcode 5 we need to search the SDK path for headers, otherwise certain
119: # modules will not be built.
120: .if ${OPSYS} == "Darwin" && exists(${OSX_SDK_PATH}/usr/include)
121: CFLAGS+= -I${OSX_SDK_PATH}/usr/include
122: .endif
123:
1.1 obache 124: PLIST_VARS+= dll nis no-nis
125: .if ${OPSYS} == "IRIX"
126: . if ${ABI} == "64"
127: PLIST.no-nis= yes
128: . else
129: PLIST.nis= yes
130: . endif
131: .else
132: PLIST.dll= yes
1.7 bsiegert 133: . if ${OPSYS} == "MirBSD"
134: # neither nis nor no-nis
135: . elif ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat)
1.1 obache 136: PLIST.nis= yes
137: . else
138: PLIST.no-nis= yes
139: . endif
140: .endif
141:
142: .include "../../mk/bdb.buildlink3.mk"
143: MAKE_ENV+= PY_BDB_TYPE=${BDB_TYPE}
144: .if empty(BDB_LIBS)
145: BUILDLINK_TRANSFORM+= rm:-ldb
146: .endif
147: CFLAGS+= -DHAVE_DB_185_H
148:
149: .if ${OPSYS} == "OSF1"
150: # configure complains about buggy getaddrinfo()
151: CONFIGURE_ARGS+= --disable-ipv6
152: .endif
153:
154: .if defined(BUILDLINK_TRANSFORM)
155: MAKE_ENV+= PY_BDB_TRANSFORM=${BUILDLINK_TRANSFORM:Q}
156: .endif
157:
158: PLIST_SUBST+= PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
159:
160: TEST_TARGET= test
161: INSTALL_TARGET= altinstall
162:
163: REPLACE_INTERPRETER+= py27
164: REPLACE.py27.old= .*python[^ ]*
165: REPLACE.py27.new= ${PREFIX}/bin/python${PY_VER_SUFFIX}
1.4 tron 166: REPLACE_FILES.py27= Lib/*.py Lib/*/*.py Lib/*/*/*.py
1.29 ryoon 167: REPLACE_FILES.py27+= Lib/*/*/*/*.py
1.1 obache 168:
169: SUBST_CLASSES+= findlib
170: SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin.
171: SUBST_STAGE.findlib= pre-configure
172: SUBST_FILES.findlib= Lib/distutils/unixccompiler.py
173: SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},'
174:
175: post-extract:
176: ${MV} ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Lib/smtpd${PY_VER_SUFFIX}.py
177: ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX}
178: ${MV} ${WRKSRC}/Tools/scripts/2to3 ${WRKSRC}/Tools/scripts/2to3-${PY_VER_SUFFIX}
179:
180: .if ${OPSYS} == "HPUX"
181: post-install:
182: ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.7.sl \
183: ${DESTDIR}${PREFIX}/lib/libpython2.7.sl.1.0
184: .endif
185:
186: BUILDLINK_DEPMETHOD.readline= build
187:
188: .include "../../archivers/bzip2/buildlink3.mk"
189: .include "../../devel/gettext-lib/buildlink3.mk"
190: .include "../../devel/libffi/buildlink3.mk"
191: .include "../../devel/readline/buildlink3.mk"
192: .include "../../devel/zlib/buildlink3.mk"
193: .include "../../security/openssl/buildlink3.mk"
194: .include "../../mk/dlopen.buildlink3.mk"
195: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>