# Maintainer (arch): Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Doug Newgard <scimmia at archlinux dot info>
# Contributor: Andrey Mivrenik <gim at fastmail dot fm>
# Contributor: Glen Oakley <goakley123@gmail.com>
# Maintainer: André Silva <emulatorman@hyperbola.info>

pkgname=cool-retro-term
pkgver=1.1.1
pkgrel=1
pkgrel+=.par1
pkgdesc='A good looking terminal emulator which mimics the old cathode display'
pkgdesc+=', without nonfree fonts'
arch=('x86_64')
arch+=('i686' 'armv7h')
url='https://github.com/Swordfish90/cool-retro-term'
license=('GPL3')
depends=('qmltermwidget' 'qt5-quickcontrols' 'qt5-graphicaleffects' 'hicolor-icon-theme')
mksource=("https://github.com/Swordfish90/cool-retro-term/archive/$pkgver.tar.gz")
source=("https://repo.parabola.nu/other/cool-retro-term-libre/cool-retro-term-libre-$pkgver.tar.gz")
mksha256sums=('1252bafa33c8befbb86528ed75db98677cdc1298704db728e326ffd258d5ed13')
sha256sums=('87b1a575dfd210c9d386358c619af2004244f1d7c6717d1cbd07313aad5e0244')

mksource() {
  cd "$srcdir/$pkgname-$pkgver"

  rm -rv app/qml/fonts/{1977-{apple2,commodore-pet},1982-commodore64}
}

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  sed -i '/qmltermwidget/d' cool-retro-term.pro
  sed -i '/1977-apple2/d
          /1977-commodore-pet/d
          /1982-commodore64/d
          /modern-envy-code-r/d
         ' app/qml/resources.qrc
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  qmake
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make INSTALL_ROOT="$pkgdir" install
}
