# HG changeset patch # User Hans-G?nter Theisgen # Date 1573835132 -3600 # Node ID d8981945694f942ac9a946e052d732073bbd8cc3 # Parent 8c041a0b4dc0ca216aa853f1f326ea3f5b83a007 copied gettext recipe from wok-next diff -r 8c041a0b4dc0 -r d8981945694f gettext/description.gettext-base.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gettext/description.gettext-base.txt Fri Nov 15 17:25:32 2019 +0100 @@ -0,0 +1,3 @@ +This package offers to programmers, translators, and even users, a well +integrated set of tools and documentation to develop native language support for +applications. diff -r 8c041a0b4dc0 -r d8981945694f gettext/description.gettext-tools.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gettext/description.gettext-tools.txt Fri Nov 15 17:25:32 2019 +0100 @@ -0,0 +1,7 @@ +This package is a part of GNU gettext, it contains: + + * `xgettext`: Extract translatable strings from given input files + * `msgmerge`: Merges two Uniforum style .po files together + * `msgfmt`: Generate binary message catalog from textual translation + description + * `msgcat`: Concatenates and merges the specified PO files diff -r 8c041a0b4dc0 -r d8981945694f gettext/description.gettext.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gettext/description.gettext.txt Fri Nov 15 17:25:32 2019 +0100 @@ -0,0 +1,17 @@ +This is the GNU gettext package. It is interesting for authors or maintainers of +other packages or programs which they want to see internationalized. As one step +the handling of messages in different languages should be implemented. For this +task GNU gettext provides the needed tools and library functions. + +It is also interesting for translators, because GNU gettext provides the +'msgmerge' program, which prepares a message catalog before a translation +update. + +Users of GNU packages should also install GNU gettext because some other GNU +packages will use the gettext program included in this package to +internationalize the messages given by shell scripts. + + * [The homepage of this package](http://www.gnu.org/software/gettext/) + * [The primary FTP site for its distribution] + (ftp://ftp.gnu.org/pub/gnu/gettext/) + * Send comments and bug reports to diff -r 8c041a0b4dc0 -r d8981945694f gettext/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gettext/receipt Fri Nov 15 17:25:32 2019 +0100 @@ -0,0 +1,88 @@ +# SliTaz package receipt v2. + +PACKAGE="gettext" +VERSION="0.19.8.1" +CATEGORY="development" +SHORT_DESC="Utilities for the GNU Translation Project" +MAINTAINER="devel@slitaz.org" +LICENSE="GPL3" +WEB_SITE="https://www.gnu.org/software/gettext/" +LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/gettext.html" + +TARBALL="$PACKAGE-$VERSION.tar.xz" +WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL" + +BUILD_DEPENDS="libcroco-dev libxml2-dev glib-dev acl-dev emacs \ +libxrandr-dev libxfixes-dev" +SPLIT="$PACKAGE-base $PACKAGE emacs-pkg-po-mode $PACKAGE-dev" + +compile_rules() { + ./configure $CONFIGURE_ARGS && + make && + make install || return 1 + + chmod 0755 $install/usr/lib/preloadable_libintl.so + + # stripped gettext.sh + rm $install/usr/bin/gettext.sh + install -m755 $stuff/gettext.sh $install/usr/bin + + # emacs-pkg-po-mode -------- + + site_lisp="$install/usr/share/emacs/site-lisp" + # Installing start file + mkdir -p $site_lisp/site-start.d + cp -a $src/gettext-tools/misc/start-po.el $site_lisp/site-start.d/50-start-po.el + + # Installing po-mode + mkdir -p $site_lisp/po-mode + cp -a $src/gettext-tools/misc/po*.el $site_lisp/po-mode + + # byte-compile files, remove src + for file in $site_lisp/po-mode/*.el; do + echo -n "Byte-compiling $(basename $file)" + emacs -batch -f batch-byte-compile $file 2>/dev/null; err=$? + status + [ "$err" -eq 0 ] && rm -f $file + done +} + +# Just to be sure when cross compiling, gettext is part of base system. +testsuite() { + readelf -h $install/usr/bin/gettext +} + +genpkg_rules() { + case $PACKAGE in + gettext-base) + copy gettext gettext.sh envsubst ngettext + CAT="base-system|base tools" + DEPENDS="glibc-base" + ;; + gettext) + copy msgcat msgfmt msgmerge xgettext \ + libgettextlib*.so* libgettextsrc*.so* + DEPENDS="acl glib libcroco libgomp libxml2 ncurses" + TAGS="LFS" + ;; + emacs-pkg-po-mode) + copy emacs/ + DEPENDS="emacs" + CAT="development|Emacs major mode for editing or modifying PO files" + ;; + *-dev) + copy @std @dev @rm + rm -rf $fs/usr/share/doc/ # @dev files here + # Runtime depends, then dev-depends + DEPENDS="gettext-base gettext libxml2" + ;; + esac +} + +post_install_emacs_pkg_po_mode() { + chroot "$1/" tazpkg reconfigure emacs +} + +post_remove_emacs_pkg_po_mode() { + chroot "$1/" tazpkg reconfigure emacs +} diff -r 8c041a0b4dc0 -r d8981945694f gettext/stuff/gettext.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gettext/stuff/gettext.sh Fri Nov 15 17:25:32 2019 +0100 @@ -0,0 +1,7 @@ +#!/bin/sh +eval_gettext() { + gettext "$1" | (export PATH $(envsubst --variables "$1"); envsubst "$1") +} +eval_ngettext() { + ngettext "$1" "$2" "$3" | (export PATH $(envsubst --variables "$1 $2"); envsubst "$1 $2") +}