recipe 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Build recipe for ncurses.
  2. #
  3. # Copyright (c) 2016-2018 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=ncurses
  17. version=6.1-20181117
  18. pkgversion="$(echo $version | tr - _)"
  19. release=1
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/libs"
  22. tarname=${program}-${version}.tgz
  23. # Remote source(s)
  24. fetch=http://invisible-mirror.net/archives/ncurses/current/$tarname
  25. description="
  26. Emulation library of Curses.
  27. The Ncurses (new curses) library is a free software emulation of
  28. curses in System V Release 4.0. The ncurses code was developed
  29. under GNU/Linux. It has been in use for some time with OpenBSD
  30. as the system curses library, and on FreeBSD and NetBSD as an
  31. external package.
  32. The distribution includes the library and support utilities,
  33. including a terminfo compiler \"tic\", a decompiler \"infocmp\",
  34. clear, tput, tset, and a termcap conversion tool \"captoinfo\".
  35. "
  36. homepage=http://www.gnu.org/software/ncurses
  37. license=Custom
  38. # Source documentation
  39. docs="ANNOUNCE AUTHORS COPYING NEWS README TO-DO VERSION"
  40. docsdir="${docdir}/${program}-${pkgversion}"
  41. build()
  42. {
  43. set -e
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. ./configure \
  49. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --mandir=$mandir \
  53. --enable-widec \
  54. --enable-symlinks \
  55. --enable-pc-files \
  56. --with-pkg-config-libdir=/usr/lib${libSuffix}/pkgconfig \
  57. --with-shared \
  58. --with-normal \
  59. --with-gpm \
  60. --without-debug \
  61. --without-ada \
  62. --build="$(cc -dumpmachine)"
  63. make -j${jobs} V=1
  64. make -j${jobs} DESTDIR="$destdir" install
  65. # Provide non-widec compatibility
  66. for name in ncurses form panel menu
  67. do
  68. echo "INPUT(-l${name}w)" > \
  69. "${destdir}/usr/lib${libSuffix}/lib${name}.so"
  70. echo "INPUT(-l${name}w)" > \
  71. "${destdir}/usr/lib${libSuffix}/lib${name}.a"
  72. (
  73. cd "${destdir}/usr/lib${libSuffix}/pkgconfig" && \
  74. ln -sf ${name}w.pc ${name}.pc
  75. )
  76. done
  77. # Backward compatibility
  78. (
  79. cd "${destdir}/usr/lib${libSuffix}" || exit 2
  80. echo "INPUT(-lncursesw)" > libcursesw.so
  81. ln -sf libncurses.so libcurses.so
  82. ln -sf libncurses++w.a libncurses++.a
  83. )
  84. # Just in case
  85. ln -sf ncursesw6-config "${destdir}/usr/bin/ncurses6-config"
  86. # Compress and link man pages (if needed)
  87. if test -d "${destdir}/$mandir"
  88. then
  89. (
  90. cd "${destdir}/$mandir"
  91. find . -type f -exec lzip -9 '{}' +
  92. find . -type l | while read -r file
  93. do
  94. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  95. rm -- "$file"
  96. done
  97. )
  98. fi
  99. # Copy documentation
  100. mkdir -p "${destdir}${docsdir}"
  101. cp -p $docs "${destdir}${docsdir}/"
  102. }