Bug 168684 - [PATCH]: fix gettext autodetected dependency for lang/python (XX)
Summary: [PATCH]: fix gettext autodetected dependency for lang/python (XX)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-04 22:50 UTC by Marcus von Appen
Modified: 2012-06-19 18:50 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (331 bytes, patch)
2012-06-04 22:50 UTC, Marcus von Appen
no flags Details | Diff
file.diff (431 bytes, patch)
2012-06-04 22:50 UTC, Marcus von Appen
no flags Details | Diff
file.diff (431 bytes, patch)
2012-06-04 22:50 UTC, Marcus von Appen
no flags Details | Diff
file.diff (444 bytes, patch)
2012-06-04 22:50 UTC, Marcus von Appen
no flags Details | Diff
file.diff (444 bytes, patch)
2012-06-04 22:50 UTC, Marcus von Appen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus von Appen freebsd_committer freebsd_triage 2012-06-04 22:50:10 UTC
	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

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.


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}
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}
-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}
-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}
-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


-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--x4Tx8QGWpQpkYCRBG11fsgwZCROYBoYr4lM2r1LGqHeyRdXg
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

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 @@
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)
Comment 1 Edwin Groothuis freebsd_committer 2012-06-05 12:11:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-python

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Rachel Flynn 2012-06-07 09:24:55 UTC
Hi,

also see:
http://bugs.python.org/issue14353
-- 
Mel
Comment 3 dfilter service freebsd_committer 2012-06-19 18:48:51 UTC
mva         2012-06-19 17:48:42 UTC

  FreeBSD ports repository

  Modified files:
    lang/python24        Makefile 
    lang/python25        Makefile 
    lang/python26        Makefile 
    lang/python27        Makefile 
    lang/python31        Makefile 
    lang/python32        Makefile 
  Log:
  - Fix gettext detection for the locale module
  - Explicitly enable/disable gettext support via a new NLS OPTION switch.
  
  PR:             ports/168684 ports/136917
  On behalf of:   python@
  
  Revision  Changes    Path
  1.178     +9 -0      ports/lang/python24/Makefile
  1.170     +9 -0      ports/lang/python25/Makefile
  1.186     +11 -1     ports/lang/python26/Makefile
  1.191     +11 -1     ports/lang/python27/Makefile
  1.183     +11 -1     ports/lang/python31/Makefile
  1.187     +11 -1     ports/lang/python32/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Marcus von Appen freebsd_committer freebsd_triage 2012-06-19 18:49:34 UTC
State Changed
From-To: open->closed

Committed. Thanks!