recipe 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # Build recipe for xterm.
  2. #
  3. # Copyright (c) 2017-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=xterm
  17. version=341
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/x-apps"
  21. tarname=${program}-${version}.tgz
  22. # Remote source(s)
  23. fetch=http://invisible-mirror.net/archives/xterm/$tarname
  24. description="
  25. Terminal emulator for X.
  26. The xterm program is a terminal emulator for the X Window System.
  27. It provides DEC VT102 and Tektronix 4014 compatible terminals for
  28. programs that can't use the window system directly.
  29. "
  30. homepage=http://invisible-island.net/xterm
  31. license=Custom
  32. # Source documentation
  33. docs="NEWS README README.i18n THANKS"
  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. # Patch taken from Alpine Linux (Thanks!)
  43. # http://git.alpinelinux.org/cgit/aports/tree/community/xterm/posix-ptys.patch
  44. patch -p1 < "${worktree}/patches/xterm/posix-ptys.patch"
  45. # These commands modify the terminal description so that the
  46. # Backspace key is expected to send the character with ASCII
  47. # code 127. This is done for consistency with the Linux console.
  48. # Thanks to Beyond Linux From Scratch!
  49. sed -i '/v0/{n;s/new:/new:kb=^?:/}' termcap && \
  50. printf '\tkbs=\\177,\n' >> terminfo
  51. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  52. TERMINFO=/usr/share/terminfo \
  53. $configure_args \
  54. --libdir=/usr/lib${libSuffix} \
  55. --mandir=$mandir \
  56. --enable-exec-xterm \
  57. --enable-256-color \
  58. --enable-88-color \
  59. --enable-luit \
  60. --enable-wide-chars \
  61. --enable-dabbrev \
  62. --enable-setgid \
  63. --disable-setuid \
  64. --disable-full-tgetent \
  65. --disable-imake \
  66. --with-pcre \
  67. --with-app-defaults=/etc/X11/app-defaults \
  68. --with-tty-group=tty \
  69. --with-x \
  70. --build="$(cc -dumpmachine)"
  71. make -j${jobs} V=1
  72. make -j${jobs} DESTDIR="$destdir" install
  73. # Conflicts with files provided by ncurses
  74. #make -j${jobs} DESTDIR="$destdir" install-ti
  75. # Append extra information.
  76. #
  77. # In order for xterm to follow the locale settings in the
  78. # environment, use TrueType fonts, and follow the GNU/Linux
  79. # convention about the code sent by the Backspace key, we add
  80. # the following definitions
  81. cat << EOF >> "${destdir}/etc/X11/app-defaults/XTerm"
  82. *VT100*locale: true
  83. *VT100*faceName: Monospace
  84. *VT100*faceSize: 12
  85. *backarrowKeyIsErase: true
  86. *ptyInitialErase: true
  87. EOF
  88. # To handle config files via graft(1)
  89. touch "${destdir}/etc/X11/app-defaults/.graft-config"
  90. # Include desktop entries
  91. mkdir -p "${destdir}/usr/share/applications"
  92. cp -p xterm.desktop uxterm.desktop \
  93. "${destdir}/usr/share/applications/"
  94. # Compress and link man pages (if needed)
  95. if test -d "${destdir}/$mandir"
  96. then
  97. (
  98. cd "${destdir}/$mandir"
  99. find . -type f -exec lzip -9 '{}' +
  100. find . -type l | while read -r file
  101. do
  102. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  103. rm -- "$file"
  104. done
  105. )
  106. fi
  107. # Copy documentation
  108. mkdir -p "${destdir}${docsdir}"
  109. cp -p $docs "${destdir}${docsdir}"
  110. }