From owner-freebsd-python@FreeBSD.ORG Mon Jun 4 21:40:55 2012 Return-Path: Delivered-To: python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 244421065672; Mon, 4 Jun 2012 21:40:55 +0000 (UTC) (envelope-from mail@sysfault.org) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.18.15]) by mx1.freebsd.org (Postfix) with ESMTP id BB8348FC1D; Mon, 4 Jun 2012 21:40:54 +0000 (UTC) Received: from [89.182.123.20] (helo=medusa.sysfault.org) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1SbezR-0003Pg-RN; Mon, 04 Jun 2012 23:39:06 +0200 Received: from [127.0.0.1] (helo=medusa.sysfault.org) by medusa.sysfault.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Sbf1H-000HCj-4M; Mon, 04 Jun 2012 23:40:59 +0200 Received: (from marcus@localhost) by medusa.sysfault.org (8.14.5/8.14.5/Submit) id q54LerXY066136; Mon, 4 Jun 2012 23:40:53 +0200 (CEST) (envelope-from marcus) Date: Mon, 4 Jun 2012 23:40:53 +0200 (CEST) Message-Id: <201206042140.q54LerXY066136@medusa.sysfault.org> To: FreeBSD-gnats-submit@freebsd.org From: Marcus von Appen X-send-pr-version: 3.113 X-GNATS-Notify: X-Df-Sender: OTM2OTM0 Cc: python@freebsd.org Subject: [PATCH]: fix gettext autodetected dependency for lang/pythonXX X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Marcus von Appen List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 21:40:55 -0000 >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@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 .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 .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 .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 .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