# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: nfnty <arch@nfnty.se>

pkgname=shotcut
pkgdesc='Cross-platform Qt based Video Editor'
pkgver=21.08.29
pkgrel=1
arch=('x86_64')
url='https://www.shotcut.org'
license=('GPL3')
depends=('qt5-base' 'qt5-declarative' 'qt5-graphicaleffects' 'qt5-multimedia'
         'qt5-quickcontrols' 'qt5-quickcontrols2' 'qt5-websockets' 'qt5-x11extras'
         'mlt' 'movit' 'ffmpeg' 'libx264' 'libvpx' 'lame' 'frei0r-plugins' 'ladspa')
optdepends=('swh-plugins: Several audio filters')
makedepends=('qt5-tools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/mltframework/shotcut/archive/v$pkgver.tar.gz")
sha512sums=('7b173121d8c2eb8fb1cc59d49af6e08efae87cf02077db865fc13277da9e5d497a41922aed0e1fb7be805e0d5856b77c9d278f11c7234de210b19f2f79cb77dc')

build() {
  mkdir $pkgname-$pkgver/build
  cd $pkgname-$pkgver/build

  qmake .. \
    PREFIX='/usr' \
    QMAKE_CFLAGS_RELEASE="$CFLAGS" \
    QMAKE_CXXFLAGS_RELEASE="$CXXFLAGS" \
    SHOTCUT_VERSION=ARCH-$pkgver \
    DEFINES+=SHOTCUT_NOUPGRADE

  make

  lrelease ../translations/*.ts
}

package() {
    cd $pkgname-$pkgver/build

    make INSTALL_ROOT="$pkgdir" install
}

