recipe 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Build recipe for gettext-tiny.
  2. #
  3. # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. program=gettext-tiny
  17. version=20190406_73fc3e7
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/tools"
  21. tarname=${program}-${version}.tar.lz
  22. # Remote source(s)
  23. fetch=http://rsync.dragora.org/current/sources/$tarname
  24. description="
  25. An internationalisation and localisation system.
  26. gettext-tiny provides lightweight replacements for tools typically used
  27. from the GNU gettext suite, which is incredibly bloated and takes a lot
  28. of time to build (in the order of an hour on slow devices). The most
  29. notable component is msgfmt which is used to create binary translation
  30. files in the .mo format out of textual input files in .po format.
  31. This is the most important tool for building software from source,
  32. because it is used from the build processes of many software packages.
  33. The gettext-tiny package is compatible with the Musl C Library.
  34. "
  35. homepage=http://github.com/sabotage-linux/gettext-tiny/
  36. license=MIT
  37. # Source documentation
  38. docs="LICENSE README.md"
  39. docsdir="${docdir}/${program}-${version}"
  40. # Limit paralell jobs to '1'
  41. jobs=1
  42. build()
  43. {
  44. set -e
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. # Do not force to some tools to be static
  50. sed -i 's/-static//g' Makefile
  51. make -j${jobs} LIBINTL=MUSL \
  52. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  53. prefix=/usr libdir=/usr/lib${libSuffix} \
  54. DESTDIR="$destdir" install
  55. strip --strip-unneeded "${destdir}/usr/bin"/* 2> /dev/null || true;
  56. strip --strip-debug "${destdir}/usr/lib${libSuffix}/libintl.a"
  57. # Introduce our custom version of 'autopoint' which
  58. # works well under busybox's ash, mksh shells.
  59. cp -p "${worktree}/archive/gettext-tiny/autopoint" \
  60. "${destdir}/usr/bin/"
  61. chmod 755 "${destdir}/usr/bin/autopoint"
  62. # Compress and link man pages (if needed)
  63. if test -d "${destdir}/$mandir"
  64. then
  65. (
  66. cd "${destdir}/$mandir"
  67. find . -type f -exec lzip -9 '{}' +
  68. find . -type l | while read -r file
  69. do
  70. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  71. rm -- "$file"
  72. done
  73. )
  74. fi
  75. # Copy documentation
  76. mkdir -p "${destdir}${docsdir}"
  77. cp -p $docs "${destdir}${docsdir}"/
  78. }