recipe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Build recipe for readline.
  2. #
  3. # Copyright (c) 2016-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=readline
  17. version=8.0
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=ftp://ftp.gnu.org/gnu/readline/$tarname
  24. description="
  25. A library with line-editing capabilities.
  26. GNU readline is a software library created and maintained by the
  27. GNU Project. It is licensed under the GPL, and used in projects
  28. such as GNU bash. It provides line-editing capabilities.
  29. "
  30. homepage=http://www.gnu.org/software/readline
  31. license=GPLv3+
  32. # Source documentation
  33. docs="CHANGELOG CHANGES COPYING NEWS README USAGE"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. # Apply patches from upstream
  43. for file in "${worktree}"/patches/readline/readline80-???*
  44. do
  45. if test -f "$file"
  46. then
  47. patch -Np0 -i "$file"
  48. fi
  49. done
  50. # To avoid underlink against ncursesw
  51. patch -Np1 -i "${worktree}/patches/readline/readline-ncurses-link.patch"
  52. # Reinstalling Readline will cause the old libraries to be moved to
  53. # <libraryname>.old, this avoid printing a harmful message about
  54. # the static libraries (thanks to LFS)
  55. sed -i '/MV.*old/d' Makefile.in
  56. sed -i '/{OLDSUFF}/c:' support/shlib-install
  57. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  58. $configure_args \
  59. --libdir=/usr/lib${libSuffix} \
  60. --infodir=$infodir \
  61. --mandir=$mandir \
  62. --docdir=$docsdir \
  63. --enable-multibyte \
  64. --enable-static=yes \
  65. --enable-shared=yes \
  66. --build="$(cc -dumpmachine)"
  67. make -j${jobs} V=1
  68. make -j${jobs} V=1 DESTDIR="$destdir" install
  69. # Copy our custom inputrc file
  70. mkdir -p "${destdir}/etc"
  71. cp -p "${worktree}/archive/readline/etc/inputrc" "${destdir}/etc/"
  72. chmod 644 "${destdir}/etc/inputrc"
  73. touch "${destdir}/etc/.graft-config"
  74. # Compress info documents deleting index file for the package
  75. if test -d "${destdir}/$infodir"
  76. then
  77. rm -f "${destdir}/${infodir}/dir"
  78. lzip -9 "${destdir}/${infodir}"/*
  79. fi
  80. # Compress and link man pages (if needed)
  81. if test -d "${destdir}/$mandir"
  82. then
  83. (
  84. cd "${destdir}/$mandir"
  85. find . -type f -exec lzip -9 '{}' +
  86. find . -type l | while read -r file
  87. do
  88. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  89. rm -- "$file"
  90. done
  91. )
  92. fi
  93. # Copy documentation
  94. mkdir -p "${destdir}${docsdir}"
  95. for file in $docs
  96. do
  97. cp -p $file "${destdir}${docsdir}"
  98. done
  99. }