blob: bc14867bbb217f24441d6055abdd3f64f89e7494 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Utilities and libraries for producing multi-lingual messages"
2DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. \
3These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file \
4naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and \
5a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
6HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
7SECTION = "libs"
8LICENSE = "GPLv3+ & LGPL-2.1+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=c678957b0c8e964aa6c70fd77641a71e"
10
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050011DEPENDS = "gettext-native virtual/libiconv"
12DEPENDS_class-native = "gettext-minimal-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050013PROVIDES = "virtual/libintl virtual/gettext"
14PROVIDES_class-native = "virtual/gettext-native"
15RCONFLICTS_${PN} = "proxy-libintl"
16SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
17 file://parallel.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050018 file://use-pkgconfig.patch \
19 file://run-ptest \
20 file://serial-tests-config.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050021 file://0001-tests-autopoint-3-unset-MAKEFLAGS.patch \
22 file://0001-init-env.in-do-not-add-C-CXX-parameters.patch \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050023 file://mingw.patch \
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050024 file://0001-msgmerge-29-Add-executable-file-mode-bits.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050025 "
Andrew Geisslerc9f78652020-09-18 14:11:35 -050026SRC_URI[sha256sum] = "c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12"
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
28inherit autotools texinfo pkgconfig ptest
29
30EXTRA_OECONF += "--without-lispdir \
31 --disable-csharp \
32 --disable-libasprintf \
33 --disable-java \
34 --disable-native-java \
35 --disable-openmp \
36 --disable-acl \
37 --without-emacs \
38 --without-cvs \
39 --without-git \
40 --cache-file=${B}/config.cache \
41 "
42EXTRA_OECONF_append_class-target = " \
43 --with-bisonlocaledir=${datadir}/locale \
44 gt_cv_locale_fr_utf8=fr_FR \
45 gt_cv_locale_fr=fr_FR.ISO-8859-1 \
46 gt_cv_locale_de_utf8=de_DE \
47 gt_cv_locale_de=de_DE.ISO-8859-1 \
48"
49
50PACKAGECONFIG ??= "croco glib libxml"
51PACKAGECONFIG_class-native = ""
52PACKAGECONFIG_class-nativesdk = ""
53
54PACKAGECONFIG[croco] = "--without-included-libcroco,--with-included-libcroco,libcroco"
55PACKAGECONFIG[glib] = "--without-included-glib,--with-included-glib,glib-2.0"
56PACKAGECONFIG[libxml] = "--without-included-libxml,--with-included-libxml,libxml2"
57# Need paths here to avoid host contamination but this can cause RPATH warnings
58# or problems if $libdir isn't $prefix/lib.
59PACKAGECONFIG[libunistring] = "--with-libunistring-prefix=${STAGING_LIBDIR}/..,--with-included-libunistring,libunistring"
60PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
61
62acpaths = '-I ${S}/gettext-runtime/m4 \
63 -I ${S}/gettext-tools/m4'
64
65do_install_append_libc-musl () {
66 rm -f ${D}${libdir}/charset.alias
67 rm -f ${D}${includedir}/libintl.h
68 rm -f ${D}${libdir}/libintl.la
69}
70
71# these lack the .x behind the .so, but shouldn't be in the -dev package
72# Otherwise you get the following results:
73# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
74# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
75# because gettext depends on gettext-dev, which pulls in more -dev packages:
76# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
77# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
78# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
79# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
80
81PACKAGES =+ "libgettextlib libgettextsrc"
82FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
83FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
84
85PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc"
86
87FILES_${PN} += "${libdir}/${BPN}/*"
88
89# The its/Makefile.am has defined:
90# itsdir = $(pkgdatadir)$(PACKAGE_SUFFIX)/its
91# not itsdir = $(pkgdatadir), so use wildcard to match the version.
92FILES_${PN} += "${datadir}/${BPN}-*/*"
93
94FILES_gettext-runtime = "${bindir}/gettext \
95 ${bindir}/ngettext \
96 ${bindir}/envsubst \
97 ${bindir}/gettext.sh \
98 ${libdir}/libasprintf.so* \
99 ${libdir}/GNU.Gettext.dll \
100 "
101FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \
102 ${includedir}/autosprintf.h \
103 "
104FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
105 ${mandir}/man1/ngettext.* \
106 ${mandir}/man1/envsubst.* \
107 ${mandir}/man1/.* \
108 ${mandir}/man3/* \
109 ${docdir}/gettext/gettext.* \
110 ${docdir}/gettext/ngettext.* \
111 ${docdir}/gettext/envsubst.* \
112 ${docdir}/gettext/*.3.html \
113 ${datadir}/gettext/ABOUT-NLS \
114 ${docdir}/gettext/csharpdoc/* \
115 ${docdir}/libasprintf/autosprintf.html \
116 ${infodir}/autosprintf.info \
117 "
118
119do_install_append() {
120 rm -f ${D}${libdir}/preloadable_libintl.so
121}
122
123do_install_append_class-native () {
124 rm ${D}${datadir}/aclocal/*
125 rm ${D}${datadir}/gettext/config.rpath
126 rm ${D}${datadir}/gettext/po/Makefile.in.in
127 rm ${D}${datadir}/gettext/po/remove-potcdate.sin
128
129 create_wrapper ${D}${bindir}/msgfmt \
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500130 GETTEXTDATADIR="${STAGING_DATADIR_NATIVE}/gettext-${PV}/"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500131
132}
133
134do_compile_ptest() {
135 cd ${B}/gettext-tools/tests/
136 sed -i '/^buildtest-TESTS: /c buildtest-TESTS: $(TESTS) $(check_PROGRAMS)' Makefile
137 oe_runmake buildtest-TESTS
138 cd -
139}
140
141do_install_ptest() {
142 if [ ${PTEST_ENABLED} = "1" ]; then
143 mkdir -p ${D}${PTEST_PATH}/tests
144 mkdir -p ${D}${PTEST_PATH}/src
145 mkdir -p ${D}${PTEST_PATH}/po
146 mkdir -p ${D}${PTEST_PATH}/misc
147 mkdir -p ${D}${PTEST_PATH}/its
148 mkdir -p ${D}${PTEST_PATH}/styles
149 mkdir -p ${D}${PTEST_PATH}/gnulib-lib
150 mkdir -p ${D}${PTEST_PATH}/examples
151 cp -rf ${S}/gettext-tools/its/* ${D}${PTEST_PATH}/its
152 cp -rf ${S}/gettext-tools/styles/* ${D}${PTEST_PATH}/styles
153 cp -rf ${S}/gettext-tools/gnulib-lib/gettext.h ${D}${PTEST_PATH}/gnulib-lib
154 cp -rf ${S}/gettext-tools/examples/hello-c ${D}${PTEST_PATH}/examples
155 cp -rf ${S}/gettext-tools/tests/* ${D}${PTEST_PATH}/tests
156 cp -rf ${B}/gettext-tools/tests/.libs/* ${D}${PTEST_PATH}/tests
157 cp -rf ${B}/gettext-runtime/intl/.libs/libgnuintl.so.8* ${D}${libdir}/
158 cp -rf ${B}/gettext-tools/tests/Makefile ${D}${PTEST_PATH}/tests
159 cp -rf ${B}/gettext-tools/tests/init-env ${D}${PTEST_PATH}/tests
160 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
161 sed -i -e 's:lang-c lang-c++:lang-c++:g' ${D}${PTEST_PATH}/tests/Makefile
162 install ${S}/gettext-tools/src/msgunfmt.tcl ${D}${PTEST_PATH}/src
163 install ${S}/gettext-tools/src/project-id ${D}${PTEST_PATH}/src
164 install ${B}/gettext-runtime/src/gettext.sh ${D}${PTEST_PATH}/src
165 install ${B}/gettext-runtime/src/ngettext ${D}${PTEST_PATH}/src
166 install ${B}/gettext-runtime/src/envsubst ${D}${PTEST_PATH}/src
167 install ${B}/gettext-runtime/src/gettext ${D}${PTEST_PATH}/src
168 install ${B}/gettext-tools/src/.libs/cldr-plurals ${D}${PTEST_PATH}/src
169 install ${S}/gettext-tools/po/gettext-tools.pot ${D}${PTEST_PATH}/po
170 install ${B}/gettext-tools/misc/* ${D}${PTEST_PATH}/misc
171 find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
172 chmod 0755 ${D}${PTEST_PATH}/tests/lang-vala ${D}${PTEST_PATH}/tests/plural-1 ${D}${PTEST_PATH}/tests/xgettext-tcl-4 \
173 ${D}${PTEST_PATH}/tests/xgettext-vala-1 ${D}${PTEST_PATH}/tests/xgettext-po-2
174 fi
175}
176
177RDEPENDS_${PN}-ptest += "make"
178RDEPENDS_${PN}-ptest_append_libc-glibc = "\
179 glibc-gconv-big5 \
180 glibc-charmap-big5 \
181 glibc-gconv-cp1251 \
182 glibc-charmap-cp1251 \
183 glibc-charmap-iso-8859-9 \
184 glibc-gconv-iso8859-9 \
185 glibc-charmap-koi8-r \
186 glibc-gconv-koi8-r \
187 glibc-gconv-iso8859-2 \
188 glibc-charmap-iso-8859-2 \
189 glibc-gconv-iso8859-1 \
190 glibc-charmap-iso-8859-1 \
191 glibc-gconv-euc-kr \
192 glibc-charmap-euc-kr \
193 glibc-gconv-euc-jp \
194 glibc-charmap-euc-jp \
195 locale-base-de-de \
196 locale-base-fr-fr \
197"
198
199RRECOMMENDS_${PN}-ptest_append_libc-glibc = "\
200 locale-base-de-de.iso-8859-1 \
201 locale-base-fr-fr.iso-8859-1 \
202"
203
204INSANE_SKIP_${PN}-ptest += "ldflags"
205INSANE_SKIP_${PN}-ptest += "rpaths"
206
207BBCLASSEXTEND = "native nativesdk"