123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- # Build recipe for gettext-tiny.
- #
- # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- program=gettext-tiny
- version=20190406_73fc3e7
- release=1
- # Set 'outdir' for a nice and well-organized output directory
- outdir="${outdir}/${arch}/tools"
- tarname=${program}-${version}.tar.lz
- # Remote source(s)
- fetch=http://rsync.dragora.org/current/sources/$tarname
- description="
- An internationalisation and localisation system.
- gettext-tiny provides lightweight replacements for tools typically used
- from the GNU gettext suite, which is incredibly bloated and takes a lot
- of time to build (in the order of an hour on slow devices). The most
- notable component is msgfmt which is used to create binary translation
- files in the .mo format out of textual input files in .po format.
- This is the most important tool for building software from source,
- because it is used from the build processes of many software packages.
- The gettext-tiny package is compatible with the Musl C Library.
- "
- homepage=http://github.com/sabotage-linux/gettext-tiny/
- license=MIT
- # Source documentation
- docs="LICENSE README.md"
- docsdir="${docdir}/${program}-${version}"
- # Limit paralell jobs to '1'
- jobs=1
- build()
- {
- set -e
- unpack "${tardir}/$tarname"
- cd "$srcdir"
- # Set sane permissions
- chmod -R u+w,go-w,a+rX-s .
- # Do not force to some tools to be static
- sed -i 's/-static//g' Makefile
- make -j${jobs} LIBINTL=MUSL \
- CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
- prefix=/usr libdir=/usr/lib${libSuffix} \
- DESTDIR="$destdir" install
- strip --strip-unneeded "${destdir}/usr/bin"/* 2> /dev/null || true;
- strip --strip-debug "${destdir}/usr/lib${libSuffix}/libintl.a"
- # Introduce our custom version of 'autopoint' which
- # works well under busybox's ash, mksh shells.
- cp -p "${worktree}/archive/gettext-tiny/autopoint" \
- "${destdir}/usr/bin/"
- chmod 755 "${destdir}/usr/bin/autopoint"
- # Compress and link man pages (if needed)
- if test -d "${destdir}/$mandir"
- then
- (
- cd "${destdir}/$mandir"
- find . -type f -exec lzip -9 '{}' +
- find . -type l | while read -r file
- do
- ln -sf "$(readlink -- "$file").lz" "${file}.lz"
- rm -- "$file"
- done
- )
- fi
- # Copy documentation
- mkdir -p "${destdir}${docsdir}"
- cp -p $docs "${destdir}${docsdir}"/
- }
|