/[ports]/head/lang/python27/Makefile
ViewVC logotype

Contents of /head/lang/python27/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 444534 - (show annotations) (download)
Wed Jun 28 02:37:53 2017 UTC (7 years ago) by dbaio
File MIME type: text/plain
File size: 4584 byte(s)
lang/python{27,33,34,35,36}: Make Python curses module work with Unicode

Use readline from ports (USES= readline:port) and patch
setup.py to ignore readline from base. The patch is necessary for
FreeBSD < 1100000, as after this the readline library became an
INTERNALLIB, see base r268461 [1]

Link devel/readline against termcapw instead of termcap is part of
this change, see ports r444463 [2]

Note that this is the **ports** approach for getting Python curses
module working with Unicode. The other way is splitting libncurses
into separate libncurses and libtinfo in base, for which an open
issue exists [3].

Apart from Python language ports, at least www/rtv and
sysutils/py-ranger ports have been tested to work correctly
(display Unicode) after this change.

[1] https://svnweb.freebsd.org/changeset/base/268461
[2] https://svnweb.freebsd.org/changeset/ports/444463
[3] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197317

PR:		171246, 197317
Reported by:	Vitaly Magerya <vmagerya gmail com>
Reviewed by:	garga, koobs, miwi, sunpoet
Approved by:	garga (mentor), sunpoet (python, with hat)
Differential Revision:	https://reviews.freebsd.org/D11127

1 # $FreeBSD$
2
3 PORTNAME= python27
4 PORTVERSION= ${PYTHON_PORTVERSION}
5 PORTREVISION= 6
6 CATEGORIES= lang python ipv6
7 MASTER_SITES= PYTHON/ftp/python/${PORTVERSION}
8 DISTNAME= Python-${PORTVERSION}
9 DIST_SUBDIR= python
10
11 MAINTAINER= python@FreeBSD.org
12 COMMENT= Interpreted object-oriented programming language
13
14 LICENSE= PSFL
15
16 BROKEN_SSL= openssl-devel
17
18 USES= cpe ncurses pathfix pkgconfig readline:port ssl tar:xz shebangfix
19 PATHFIX_MAKEFILEIN= Makefile.pre.in
20 USE_LDCONFIG= yes
21 GNU_CONFIGURE= yes
22 python_CMD= ${PREFIX}/bin/python${PYTHON_PORTVERSION:R}
23 SHEBANG_FILES= Lib/lib2to3/pgen2/*.py Lib/lib2to3/tests/*.py Lib/lib2to3/tests/data/*.py \
24 Lib/idlelib/*.py Lib/encodings/*.py Lib/test/*.py Lib/UserString.py \
25 Lib/base64.py Lib/cProfile.py Lib/keyword.py Lib/mimify.py Lib/pdb.py \
26 Lib/platform.py Lib/profile.py Lib/pydoc.py Lib/quopri.py Lib/smtpd.py \
27 Lib/smtplib.py Lib/symbol.py Lib/tabnanny.py Lib/timeit.py Lib/trace.py \
28 Lib/uu.py Lib/webbrowser.py
29
30 CPE_VENDOR= python
31 CPE_PRODUCT= ${CPE_VENDOR}
32
33 CONFIGURE_ARGS+= --enable-shared
34 CONFIGURE_ENV+= ac_cv_opt_olimit_ok=no OPT="" # Null out OPT to respect user CFLAGS and remove optimizations
35
36 INSTALL_TARGET= altinstall # Don't want cloberring of unprefixed files
37
38 TEST_TARGET= buildbottest
39 TEST_ARGS= TESTOPTS=-j${MAKE_JOBS_NUMBER}
40
41 MAKE_ARGS+= INSTALL_SHARED="${INSTALL_LIB}" # Strip shared library
42 MAKE_JOBS_UNSAFE= yes # Parser/pgen build bug. See Issue: 200622, 201974
43
44 PLIST_SUB= ABI=${ABIFLAGS} \
45 PORTVERSION=${PORTVERSION} \
46 OSMAJOR=${OSVERSION:C/([0-9]*)[0-9]{5}/\1/} # For plat-freebsd* in pkg-plist. http://bugs.python.org/issue19554
47
48 OPTIONS_DEFINE= DEBUG IPV6 LIBFFI NLS PYMALLOC THREADS
49 OPTIONS_DEFAULT= LIBFFI PYMALLOC THREADS UCS4
50 OPTIONS_SINGLE= UNICODE
51 OPTIONS_SINGLE_UNICODE= UCS2 UCS4
52 OPTIONS_SUB= yes
53
54 LIBFFI_DESC= Use libffi from ports instead of bundled version
55 NLS_DESC= Enable gettext support for the locale module
56 UCS2_DESC= Enable UCS2 Unicode Strings
57 UCS4_DESC= Enable UCS4 Unicode Strings
58 PYMALLOC_DESC= Enable specialized mallocs
59
60 DEBUG_CONFIGURE_WITH= pydebug
61 IPV6_CONFIGURE_ENABLE= ipv6
62 LIBFFI_CONFIGURE_ON= --with-system-ffi
63 LIBFFI_LIB_DEPENDS= libffi.so:devel/libffi
64
65 # Use CPPFLAGS over CFLAGS due to -I ordering, causing elementtree and pyexpat
66 # to break in Python 2.7, or preprocessor complaints in Python >= 3.3
67 # Upstream Issue: http://bugs.python.org/issue6299
68 NLS_USES= gettext
69 NLS_CPPFLAGS= -I${LOCALBASE}/include
70 NLS_LIBS= -L${LOCALBASE}/lib -lintl
71 NLS_CONFIGURE_ENV_OFF= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
72
73 PYMALLOC_CONFIGURE_WITH= pymalloc
74
75 THREADS_CONFIGURE_WITH= threads
76 THREADS_LDFLAGS= -lpthread
77
78 UCS2_CONFIGURE_ON= --enable-unicode=ucs2
79 UCS4_CONFIGURE_ON= --enable-unicode=ucs4
80
81 .include "${.CURDIR}/Makefile.version"
82 .include <bsd.port.options.mk>
83
84 # http://bugs.python.org/issue22521
85 # http://bugs.python.org/issue23042
86 .if !${PORT_OPTIONS:MLIBFFI} && ${ARCH} == i386
87 BROKEN= You must use libffi from ports on i386. Enable the LIBFFI option
88 .endif
89
90 .if ${ARCH} == i386
91 PLIST_SUB+= X86_ONLY=""
92 .else
93 PLIST_SUB+= X86_ONLY="@comment "
94 .endif
95
96 .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == ia64 || ${ARCH} == sparc64 || ${ARCH} == powerpc64 || ${ARCH} == mips64
97 PLIST_SUB+= 32BIT_ONLY="@comment "
98 .else
99 PLIST_SUB+= 32BIT_ONLY=""
100 .endif
101
102 .if ${ARCH} == powerpc64
103 MAKE_ENV+= UNAME_m="powerpc64"
104 .endif
105
106 .if ${ARCH} == sparc64
107 CFLAGS+= -DPYTHON_DEFAULT_RECURSION_LIMIT=900
108 .endif
109
110 # See http://bugs.freebsd.org/115940 and http://bugs.freebsd.org/193650
111 .if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS)
112 PLIST_SUB+= NO_NIS="@comment "
113 .else
114 PLIST_SUB+= NO_NIS=""
115 .endif
116
117 post-patch:
118 # readline shared library is present on base before FreeBSD 11 - r268461
119 # force setup.py ignore base and use readline from ports
120 .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000
121 ${REINPLACE_CMD} -e \
122 "s|lib_dirs,\ \'readline\'|[\'${LOCALBASE}/lib\',\ \'.\'],\ \'readline\'|" \
123 ${WRKSRC}/setup.py
124 .endif
125 ${REINPLACE_CMD} -e 's|/usr/local/bin/python|${python_CMD}|' \
126 ${WRKSRC}/Lib/cgi.py
127 @${REINPLACE_CMD} -e \
128 's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \
129 ${PATCH_WRKSRC}/Lib/pydoc.py
130
131 .if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS)
132 @${REINPLACE_CMD} -e 's/disabled_module_list =[^]]*/&, "nis"/' \
133 ${WRKSRC}/setup.py
134 .endif
135
136 post-install:
137 for i in ${STAGEDIR}${PREFIX}/lib/python2.7/lib-dynload/*.so; do \
138 ${STRIP_CMD} $$i; done # Strip shared extensions
139 ${INSTALL_DATA} ${WRKSRC}/Tools/gdb/libpython.py \
140 ${STAGEDIR}${PREFIX}/lib/libpython2.7.so.1-gdb.py
141
142 .include <bsd.port.mk>

Properties

Name Value
svn:eol-style native
svn:keywords FreeBSD=%H
svn:mime-type text/plain

  ViewVC Help
Powered by ViewVC 1.1.27