123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- # Build recipe for xterm.
- #
- # Copyright (c) 2017-2018 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=xterm
- version=341
- release=1
- # Set 'outdir' for a nice and well-organized output directory
- outdir="${outdir}/${arch}/x-apps"
- tarname=${program}-${version}.tgz
- # Remote source(s)
- fetch=http://invisible-mirror.net/archives/xterm/$tarname
- description="
- Terminal emulator for X.
- The xterm program is a terminal emulator for the X Window System.
- It provides DEC VT102 and Tektronix 4014 compatible terminals for
- programs that can't use the window system directly.
- "
- homepage=http://invisible-island.net/xterm
- license=Custom
- # Source documentation
- docs="NEWS README README.i18n THANKS"
- docsdir="${docdir}/${program}-${version}"
- build()
- {
- set -e
- unpack "${tardir}/$tarname"
- cd "$srcdir"
- # Set sane permissions
- chmod -R u+w,go-w,a+rX-s .
- # Patch taken from Alpine Linux (Thanks!)
- # http://git.alpinelinux.org/cgit/aports/tree/community/xterm/posix-ptys.patch
- patch -p1 < "${worktree}/patches/xterm/posix-ptys.patch"
- # These commands modify the terminal description so that the
- # Backspace key is expected to send the character with ASCII
- # code 127. This is done for consistency with the Linux console.
- # Thanks to Beyond Linux From Scratch!
- sed -i '/v0/{n;s/new:/new:kb=^?:/}' termcap && \
- printf '\tkbs=\\177,\n' >> terminfo
- ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
- TERMINFO=/usr/share/terminfo \
- $configure_args \
- --libdir=/usr/lib${libSuffix} \
- --mandir=$mandir \
- --enable-exec-xterm \
- --enable-256-color \
- --enable-88-color \
- --enable-luit \
- --enable-wide-chars \
- --enable-dabbrev \
- --enable-setgid \
- --disable-setuid \
- --disable-full-tgetent \
- --disable-imake \
- --with-pcre \
- --with-app-defaults=/etc/X11/app-defaults \
- --with-tty-group=tty \
- --with-x \
- --build="$(cc -dumpmachine)"
- make -j${jobs} V=1
- make -j${jobs} DESTDIR="$destdir" install
- # Conflicts with files provided by ncurses
- #make -j${jobs} DESTDIR="$destdir" install-ti
- # Append extra information.
- #
- # In order for xterm to follow the locale settings in the
- # environment, use TrueType fonts, and follow the GNU/Linux
- # convention about the code sent by the Backspace key, we add
- # the following definitions
- cat << EOF >> "${destdir}/etc/X11/app-defaults/XTerm"
- *VT100*locale: true
- *VT100*faceName: Monospace
- *VT100*faceSize: 12
- *backarrowKeyIsErase: true
- *ptyInitialErase: true
- EOF
- # To handle config files via graft(1)
- touch "${destdir}/etc/X11/app-defaults/.graft-config"
- # Include desktop entries
- mkdir -p "${destdir}/usr/share/applications"
- cp -p xterm.desktop uxterm.desktop \
- "${destdir}/usr/share/applications/"
- # 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}"
- }
|