Index: ports/Mk/bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.484 diff -u -r1.484 bsd.port.mk --- ports/Mk/bsd.port.mk 4 Feb 2004 04:27:04 -0000 1.484 +++ ports/Mk/bsd.port.mk 14 Mar 2004 23:28:22 -0000 @@ -310,6 +310,19 @@ ## # USE_ICONV - Says that the port uses libiconv. # USE_GETTEXT - Says that the port uses GNU gettext (libintl). +# If set to "locales", locales selection is enabled. +# Ensure that ${CONFIGURE_SUPPORT} support LINGUAS. +# if USE_GETTEXT == "locales": +# <<< WARNING locale files are added to plist via PLIST_FILES >>> +# LOCALES - List of all supported locales (ex LOCALES= "fr es pt_BR") +# WANT_LOCALES - User knob to select locales to install +# WITHOUT_NLS - Disable Native Language Support +# Options below shouldn't be changed in most of cases +# CONFIGURE_ARG_WITHOUT_NLS - ${CONFIGURE_SCRIPT} argument to disable NLS (default: --disable-nls) +# CONFIGURE_ENV_LINGUAS - ${CONFIGURE_SCRIPT} environment variable to set locales (default: LINGUAS) +# LOCALE_FILE - name of the locale file (default: ${PORTNAME}.mo) +# LC_MESSAGES_DIR - directory where are stored locale (default: share/locale/%%LOCALE%%/LC_MESSAGES) +# don't forget: %%LOCALE%% is used for locale string substitution ## # USE_PERL5 - Says that the port uses perl5 for building and running. # USE_PERL5_BUILD - Says that the port uses perl5 for building. @@ -1667,8 +1680,34 @@ LIB_DEPENDS+= iconv.3:${PORTSDIR}/converters/libiconv .endif +.if defined(LOCALES) +USE_GETTEXT= locales +.endif + .if defined(USE_GETTEXT) -LIB_DEPENDS+= intl.6:${PORTSDIR}/devel/gettext +. if ${USE_GETTEXT:L} == "locales" && !defined(WITHOUT_NLS) +. if !defined(LOCALES) +BROKEN= "When USE_GETTEXT is set to \"locales\", LOCALES must be set" +. endif +LOCALE_FILE?= ${PORTNAME}.mo +LC_MESSAGES_DIR?= share/locale/%%LOCALE%%/LC_MESSAGES +. if defined(WANT_LOCALES) +. for LOCALE in ${WANT_LOCALES} +_LOCALES+= ${LOCALES:M${LOCALE}} +. endfor +CONFIGURE_ENV_LINGUAS?= LINGUAS +CONFIGURE_ENV+= ${CONFIGURE_ENV_LINGUAS}="${_LOCALES}" +. endif +. for LOCALE in ${_LOCALES} +PLIST_FILES+= ${LC_MESSAGES_DIR:S/%%LOCALE%%/${LOCALE}/}/${LOCALE_FILE} +. endfor +. endif +.if !(defined(WITHOUT_NLS) && ${USE_GETTEXT:L} == "locales") +LIB_DEPENDS+= intl.6:${PORTSDIR}/devel/gettext +.else +CONFIGURE_ARG_WITHOUT_NLS?= --disable-nls +CONFIGURE_ARGS+= ${CONFIGURE_ARG_WITHOUT_NLS} +.endif .endif .if defined(USE_LINUX)