ports/136917: [patch] lang/python26: gettext detection
Anonymous
swell.k at gmail.com
Fri Aug 6 20:20:04 UTC 2010
The following reply was made to PR ports/136917; it has been noted by GNATS.
From: Anonymous <swell.k at gmail.com>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: ports/136917: [patch] lang/python26: gettext detection
Date: Sat, 07 Aug 2010 00:13:37 +0400
The bug affects lang/python31, too, where locale is part of libpython.
$ pydoc2.6 locale.gettext
Help on built-in function gettext in locale:
locale.gettext = gettext(...)
gettext(msg) -> string
Return translation of msg.
$ python2.6
>>> import locale
>>> locale.gettext('blah')
'blah'
BTW, I've simplified CONFIGURE_ENV a bit in order to avoid accidental
override like below
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/foo"
...
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/bar"
--- a.diff begins here ---
Index: lang/python26/Makefile
===================================================================
RCS file: /a/.cvsup/ports/lang/python26/Makefile,v
retrieving revision 1.167
diff -u -p -r1.167 Makefile
--- lang/python26/Makefile 19 Jul 2010 21:59:27 -0000 1.167
+++ lang/python26/Makefile 6 Aug 2010 19:58:57 -0000
@@ -56,7 +56,8 @@ OPTIONS= THREADS "Enable thread support"
UCS4 "Use UCS4 for unicode support" on \
PYMALLOC "Use python's internal malloc" on \
IPV6 "Enable IPv6 support" on \
- FPECTL "Enable floating point exception handling" off
+ FPECTL "Enable floating point exception handling" off \
+ GETTEXT "Enable gettext support in locale module" off
.include <bsd.port.pre.mk>
@@ -83,19 +84,24 @@ PLIST_SUB+= IF_DEFAULT="@comment "
# workaround for a bug in base curses.h.
CFLAGS+= -D__wchar_t=wchar_t
+.if defined(CPPFLAGS)
+CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}"
+.endif
+.if defined(LDFLAGS)
+CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
+.endif
+
.if !defined(WITHOUT_THREADS)
.if defined(WITH_PTH)
CONFIGURE_ARGS+= --with-pth
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure-pth
LIB_DEPENDS+= pth:${PORTSDIR}/devel/pth
-_PTH_CPPFLAGS= "-I${LOCALBASE}/include/pth"
-_PTH_LDFLAGS= "-L${LOCALBASE}/lib/pth"
-CONFIGURE_ENV+= CPPFLAGS="${_PTH_CPPFLAGS} ${CPPFLAGS}"
-CONFIGURE_ENV+= LDFLAGS="${_PTH_LDFLAGS} ${LDFLAGS}"
+CPPFLAGS+= -I${LOCALBASE}/include/pth
+LDFLAGS+= -L${LOCALBASE}/lib/pth
.else # !defined(WITH_PTH)
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
-CONFIGURE_ENV+= LDFLAGS="${PTHREAD_LIBS} ${LDFLAGS}"
+LDFLAGS+= ${PTHREAD_LIBS}
.endif # defined(WITH_PTH)
.if defined(WITHOUT_HUGE_STACK_SIZE)
CFLAGS+= -DTHREAD_STACK_SIZE=0x20000
@@ -104,9 +110,6 @@ CFLAGS+= -DTHREAD_STACK_SIZE=0x100000
.endif # defined(WITHOUT_HUGE_STACK_SIZE)
.else # defined(WITHOUT_THREADS)
CONFIGURE_ARGS+= --without-threads
-.if defined(LDFLAGS)
-CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
-.endif # defined(LDFLAGS)
.endif # !defined(WITHOUT_THREADS)
.if !defined(WITHOUT_UCS4) && !defined(WITH_UCS2)
@@ -147,6 +150,14 @@ CONFIGURE_ARGS+= --disable-ipv6
CONFIGURE_ARGS+= --with-fpectl
.endif
+.if defined(WITH_GETTEXT)
+USE_GETTEXT= yes
+LDFLAGS+= -L${LOCALBASE}/lib
+CONFIGURE_ENV+= ac_cv_header_libintl_h=yes
+.else
+CONFIGURE_ENV+= ac_cv_header_libintl_h=no
+.endif
+
pre-patch:
${CP} -r ${PATCH_WRKSRC}/Lib/plat-freebsd8 \
${PATCH_WRKSRC}/Lib/plat-freebsd9
--- a.diff ends here ---
More information about the freebsd-python
mailing list