NAME="cmatrix"
DESC="Terminal based 'The Matrix' like implementation"
VERSION="2.0"
FILES=("https://github.com/abishekvashok/cmatrix/archive/refs/tags/v$VERSION.tar.gz")
HASHES=("ad93ba39acd383696ab6a9ebbed1259ecf2d3cf9f49d6b97038c66f80749e99a")
DEPENDS=()

PACKAGE() {
  tar xf v$VERSION.tar.gz
  cd $NAME-$VERSION

  mkdir build
  cd    build

  cmake .. -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX=/usr
  make DESTDIR="$ROOTDIR" install

  install -D -m644 ../mtx.pcf       "$ROOTDIR"/usr/share/fonts/misc/mtx.pcf
  install -D -m644 ../matrix.fnt    "$ROOTDIR"/usr/share/kbd/consolefonts/matrix.fnt
  install -D -m644 ../matrix.psf.gz "$ROOTDIR"/usr/share/kbd/consolefonts/matrix.psf.gz
  install -Dm644 ../cmatrix.1       "$ROOTDIR/usr/share/man/man1/cmatrix.1"

  cd ../.. && rm -r $NAME-$VERSION
}
