[PATCH]: fix gettext autodetected dependency for lang/pythonXX
Marcus von Appen
mva at freebsd.org
Mon Jun 4 21:40:55 UTC 2012
>Submitter-Id: current-users
>Originator: Marcus von Appen
>Organization:
>Confidential: no
>Synopsis: [PATCH]: fix gettext autodetected dependency for lang/pythonXX
>Severity: non-critical
>Priority: medium
>Category: ports
>Class: sw-bug
>Release: FreeBSD 9.0-STABLE amd64
>Environment:
System: FreeBSD medusa.sysfault.org 9.0-STABLE FreeBSD 9.0-STABLE #0: Mon May 14 15:08:44 CEST 2012 root at medusa.sysfault.org:/usr/obj/usr/src/sys/MEDUSA amd64
>Description:
The CPython implementations in lang/pythonXX try to use libintl
for their locale module, if the configure scripts can detect it
at build time. This causes two major issues at the moment:
- CPython's locale module will fail to work correctly, if
gettext is deinstalled (since there is no dependency tracking
warning about it)
- make CC=whatever in lang/python26+ will lead to issues with
building and linking the locale module properly
>How-To-Repeat:
- install devel/gettext
- install lang/python26+
- deinstall devel/gettext
- try to run python scripts using the locale module
- install lang/gcc42
- try to build lang/python26+ with make CC=gcc42
(see also ports/136917)
>Fix:
The fixes below are for all lang/pythonXX versions. They
introduce a new option "NLS" for enabling or disabling gettext
usage explicitly. Once committed, this also closes ports/136917.
Index: lang/python24/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python24/Makefile,v
retrieving revision 1.177
diff -u -r1.177 Makefile
--- lang/python24/Makefile 30 May 2012 10:15:59 -0000 1.177
+++ lang/python24/Makefile 4 Jun 2012 21:36:08 -0000
@@ -47,6 +47,7 @@
OPTIONS= THREADS "Enable thread support" on \
UCS4 "Use UCS4 for unicode support" on \
+ NLS "Enable Gettext support for the locale module" on \
PYMALLOC "Use python's internal malloc" on \
IPV6 "Enable IPv6 support" on \
FPECTL "Enable floating point exception handling" off
@@ -60,6 +61,14 @@
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
+.if !defined(WITHOUT_NLS)
+USE_GETTEXT= yes
+LDFLAGS+= "-L${LOCALBASE}/lib"
+CFLAGS+= "-I${LOCALBASE}/include"
+.else
+CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
+.endif
+
.if !defined(WITHOUT_THREADS)
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
Index: lang/python25/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python25/Makefile,v
retrieving revision 1.169
diff -u -r1.169 Makefile
--- lang/python25/Makefile 30 May 2012 10:15:59 -0000 1.169
+++ lang/python25/Makefile 4 Jun 2012 21:36:08 -0000
@@ -54,6 +54,7 @@
OPTIONS= THREADS "Enable thread support" on \
UCS4 "Use UCS4 for unicode support" on \
+ NLS "Enable Gettext support for the locale module" on \
PYMALLOC "Use python's internal malloc" on \
IPV6 "Enable IPv6 support" on \
FPECTL "Enable floating point exception handling" off
@@ -67,6 +68,14 @@
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
+.if !defined(WITHOUT_NLS)
+USE_GETTEXT= yes
+LDFLAGS+= "-L${LOCALBASE}/lib"
+CFLAGS+= "-I${LOCALBASE}/include"
+.else
+CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
+.endif
+
.if !defined(WITHOUT_THREADS)
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
Index: lang/python26/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python26/Makefile,v
retrieving revision 1.185
diff -u -r1.185 Makefile
--- lang/python26/Makefile 31 May 2012 15:17:32 -0000 1.185
+++ lang/python26/Makefile 4 Jun 2012 21:36:08 -0000
@@ -50,12 +50,14 @@
-e 's,2to3,2to3-${PYTHON_VER},' \
-e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},'
-OPTIONS_DEFINE= THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES
+OPTIONS_DEFINE= THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES NLS
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
OPTIONS_SINGLE= UCS
OPTIONS_SINGLE_UCS= UCS2 UCS4
+NLS_DESC= Enable Gettext support for the locale module
+
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MSEM}
@@ -78,6 +80,14 @@
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
+.if ${PORT_OPTIONS:MNLS}
+USE_GETTEXT= yes
+LDFLAGS+= "-L${LOCALBASE}/lib"
+CFLAGS+= "-I${LOCALBASE}/include"
+.else
+CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
+.endif
+
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
.if ${PORT_OPTIONS:MPTH}
Index: lang/python27/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python27/Makefile,v
retrieving revision 1.188
diff -u -r1.188 Makefile
--- lang/python27/Makefile 31 May 2012 15:17:32 -0000 1.188
+++ lang/python27/Makefile 4 Jun 2012 21:36:08 -0000
@@ -50,12 +50,14 @@
-e 's,2to3,2to3-${PYTHON_VER},' \
-e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},'
-OPTIONS_DEFINE= THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES
+OPTIONS_DEFINE= THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES NLS
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
OPTIONS_SINGLE= UCS
OPTIONS_SINGLE_UCS= UCS2 UCS4
+NLS_DESC= Enable Gettext support for the locale module
+
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MSEM}
@@ -78,6 +80,14 @@
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
+.if ${PORT_OPTIONS:MNLS}
+USE_GETTEXT= yes
+LDFLAGS+= "-L${LOCALBASE}/lib"
+CFLAGS+= "-I${LOCALBASE}/include"
+.else
+CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
+.endif
+
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
.if ${PORT_OPTIONS:MPTH}
Index: lang/python31/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python31/Makefile,v
retrieving revision 1.182
diff -u -r1.182 Makefile
--- lang/python31/Makefile 31 May 2012 10:13:55 -0000 1.182
+++ lang/python31/Makefile 4 Jun 2012 21:36:08 -0000
@@ -50,9 +50,11 @@
BINLINKS_SUB= -e 's,(2to3|idle3|pydoc3),\1-${PYTHON_VER},' \
-e 's,(python-shared|python),\1${PYTHON_VER},'
-OPTIONS_DEFINE= THREADS UCS4 PYMALLOC IPV6 FPECTL EXAMPLES
+OPTIONS_DEFINE= THREADS UCS4 PYMALLOC IPV6 FPECTL EXAMPLES NLS
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
+NLS_DESC= Enable Gettext support for the locale module
+
.include <bsd.port.pre.mk>
.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
@@ -62,6 +64,14 @@
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
+.if ${PORT_OPTIONS:MNLS}
+USE_GETTEXT= yes
+LDFLAGS+= "-L${LOCALBASE}/lib"
+CFLAGS+= "-I${LOCALBASE}/include"
+.else
+CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
+.endif
+
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
CONFIGURE_ARGS+= --with-threads
Index: lang/python32/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/python32/Makefile,v
retrieving revision 1.186
diff -u -r1.186 Makefile
--- lang/python32/Makefile 31 May 2012 10:13:55 -0000 1.186
+++ lang/python32/Makefile 4 Jun 2012 21:36:08 -0000
@@ -51,9 +51,11 @@
BINLINKS_SUB= -e 's,(2to3|idle3|pydoc3),\1-${PYTHON_VER},' \
-e 's,(python-shared|python),\1${PYTHON_VER},'
-OPTIONS_DEFINE= THREADS UCS4 PYMALLOC IPV6 FPECTL EXAMPLES
+OPTIONS_DEFINE= THREADS UCS4 PYMALLOC IPV6 FPECTL EXAMPLES NLS
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
+NLS_DESC= Enable Gettext support for the locale module
+
.include <bsd.port.pre.mk>
.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
@@ -63,6 +65,14 @@
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
+.if ${PORT_OPTIONS:MNLS}
+USE_GETTEXT= yes
+LDFLAGS+= "-L${LOCALBASE}/lib"
+CFLAGS+= "-I${LOCALBASE}/include"
+.else
+CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
+.endif
+
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
CONFIGURE_ARGS+= --with-threads
More information about the freebsd-python
mailing list