Guest User

PKGBUILD

a guest
Apr 28th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.39 KB | None | 0 0
  1. # Maintainer: Jose Riha <jose1711 gmail com>
  2. # Maintainer: Sebastian J. Bronner <waschtl@sbronner.com>
  3. # Contributor: Patrick Jackson <PatrickSJackson gmail com>
  4. # Contributor: Christoph Vigano <mail@cvigano.de>
  5.  
  6. pkgname=st
  7. pkgver=0.8.1
  8. pkgrel=10
  9. pkgdesc='A simple virtual terminal emulator for X.'
  10. arch=('i686' 'x86_64' 'armv7h')
  11. license=('MIT')
  12. depends=(libxft)
  13. url=https://st.suckless.org
  14. source=(https://dl.suckless.org/$pkgname/$pkgname-$pkgver.tar.gz
  15.         http://st.suckless.org/patches/anysize/st-anysize-0.8.1.diff
  16.         https://st.suckless.org/patches/keyboard_select/st-keyboard_select-0.8.1.diff
  17.         https://st.suckless.org/patches/scrollback/st-scrollback-0.8.1.diff
  18.         terminfo.patch
  19.         README.terminfo.rst)
  20. sha256sums=(aeb74e10aa11ed364e1bcc635a81a523119093e63befd2f231f8b0705b15bf35
  21.             bf6c8b73a606a8e513c7919d91f93ed7aeb5f44e80269bb244cc01659145a5ea
  22.             0ebcbba881832adf9c98ce9fe7667c851d3cc3345077cb8ebe32702698665be2)
  23. _sourcedir=$pkgname-$pkgver
  24. _makeopts="--directory=$_sourcedir"
  25.  
  26. prepare() {
  27.   patch --directory="$_sourcedir" --strip=0 < terminfo.patch
  28.   patch --directory="$_sourcedir" --strip=1 < st-anysize-0.8.1.diff
  29.  
  30.   echo "begin patch keyboard select"
  31.   patch --directory="$_sourcedir" --strip=1 < st-keyboard_select-0.8.1.diff
  32.   echo "done"
  33.  
  34.   echo "begin patch scrollback"
  35.   patch --directory="$_sourcedir" --strip=1 < st-scrollback-0.8.1.diff
  36.   echo "done"  
  37.  
  38.   # This package provides a mechanism to provide a custom config.h. Multiple
  39.   # configuration states are determined by the presence of two files in
  40.   # $BUILDDIR:
  41.   #
  42.   # config.h  config.def.h  state
  43.   # ========  ============  =====
  44.   # absent    absent        Initial state. The user receives a message on how
  45.   #                         to configure this package.
  46.   # absent    present       The user was previously made aware of the
  47.   #                         configuration options and has not made any
  48.   #                         configuration changes. The package is built using
  49.   #                         default values.
  50.   # present                 The user has supplied his or her configuration. The
  51.   #                         file will be copied to $srcdir and used during
  52.   #                         build.
  53.   #
  54.   # After this test, config.def.h is copied from $srcdir to $BUILDDIR to
  55.   # provide an up to date template for the user.
  56.   if [ -e "$BUILDDIR/config.h" ]
  57.   then
  58.     cp "$BUILDDIR/config.h" "$_sourcedir"
  59.   elif [ ! -e "$BUILDDIR/config.def.h" ]
  60.   then
  61.     msg='This package can be configured in config.h. Copy the config.def.h '
  62.     msg+='that was just placed into the package directory to config.h and '
  63.     msg+='modify it to change the configuration. Or just leave it alone to '
  64.     msg+='continue to use default values.'
  65.     warning "$msg"
  66.   fi
  67.   cp "$_sourcedir/config.def.h" "$BUILDDIR"
  68. }
  69.  
  70. build() {
  71.   make $_makeopts X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
  72. }
  73.  
  74. package() {
  75.   local installopts='--mode 0644 -D --target-directory'
  76.   local shrdir="$pkgdir/usr/share"
  77.   local licdir="$shrdir/licenses/$pkgname"
  78.   local docdir="$shrdir/doc/$pkgname"
  79.   make $_makeopts PREFIX=/usr DESTDIR="$pkgdir" install
  80.   install $installopts "$licdir" "$_sourcedir/LICENSE"
  81.   install $installopts "$docdir" "$_sourcedir/README"
  82.   install $installopts "$docdir" README.terminfo.rst
  83.   install $installopts "$shrdir/$pkgname" "$_sourcedir/st.info"
  84. }
Add Comment
Please, Sign In to add comment