# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Federico Cinelli <cinelli@aur.archlinux.org>

pkgname=texmaker
pkgver=5.1.2
pkgrel=1
pkgdesc='Free cross-platform LaTeX editor'
arch=(x86_64)
url='https://www.xm1math.net/texmaker/index.html'
license=(GPL)
depends=(qt5-webengine texlive-core)
optdepends=('ghostscript: LaTeX to HTML conversion command')
source=(https://www.xm1math.net/$pkgname/$pkgname-$pkgver.tar.bz2)
sha256sums=('526896f2c1ae561130eec7aae815b9dcda9e8eeb772b6541d0dc94ce91a71044')

build() {
  cd $pkgname-$pkgver
  qmake-qt5 PREFIX=/usr texmaker.pro
  make
}
package() {
  cd $pkgname-$pkgver

  install -dm755 "$pkgdir"/usr/share
  make INSTALL_PATH="$pkgdir" INSTALL_ROOT="$pkgdir" PREFIX="/usr" install
}
