1 # Build recipe for gettext-tiny.
3 # Copyright (c) 2018-2021 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.xz
30 fetch=https://ftp.barfooze.de/pub/sabotage/tarballs/$tarname
33 An internationalisation and localisation system.
35 gettext-tiny provides lightweight replacements for tools typically used
36 from the GNU gettext suite, which is incredibly bloated and takes a lot
37 of time to build (in the order of an hour on slow devices). The most
38 notable component is msgfmt which is used to create binary translation
39 files in the .mo format out of textual input files in .po format.
40 This is the most important tool for building software from source,
41 because it is used from the build processes of many software packages.
43 The gettext-tiny package is compatible with the Musl C Library.
46 homepage=https://github.com/sabotage-linux/gettext-tiny/
49 # Source documentation
50 docs="LICENSE README.md"
51 docsdir="${docdir}/${program}-${version}"
53 # Limit paralell jobs to '1'
58 unpack "${tardir}/$tarname"
62 # Set sane permissions
63 chmod -R u+w,go-w,a+rX-s .
65 # Do not force to some tools to be static
66 sed -i 's/-static//g' Makefile
68 make -j${jobs} LIBINTL=MUSL \
69 CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
70 prefix=/usr libdir=/usr/lib${libSuffix} \
71 DESTDIR="$destdir" install
73 strip --strip-unneeded "${destdir}/usr/bin"/* 2> /dev/null || true;
74 strip --strip-debug "${destdir}/usr/lib${libSuffix}/libintl.a"
76 # Introduce our custom version of 'autopoint' which
77 # works well under busybox's ash, mksh shells.
79 cp -p "${worktree}/archive/gettext-tiny/autopoint" \
81 chmod 755 "${destdir}/usr/bin/autopoint"
83 # Compress and link man pages (if needed)
84 if test -d "${destdir}/$mandir"
87 cd "${destdir}/$mandir"
88 find . -type f -exec lzip -9 {} +
89 find . -type l | while read -r file
91 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
98 mkdir -p "${destdir}${docsdir}"
99 cp -p $docs "${destdir}${docsdir}"/