# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-voice-note
pkgver=5.9.7
pkgrel=1
pkgdesc='A lightweight memo tool to make text notes and voice recordings'
arch=('x86_64')
url="https://github.com/linuxdeepin/deepin-voice-note"
license=('GPL3')
replaces=('deepin-voice-recorder')
depends=('deepin-qt5integration' 'vlc')
makedepends=('cmake' 'gmock' 'gtest' 'ninja' 'qt5-tools')
groups=('deepin-extra')
source=("https://github.com/linuxdeepin/deepin-voice-note/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('5da5c93c4a9dc37506ab983de85a8f4e7d3f246e4d114f770b8848a41354d286399d1feee3ee24f84c8bf45d2b5452d10e43a3c9342c4337d13f14c1dab8ed09')

prepare() {
  cd deepin-voice-note-$pkgver
  sed -i '1i#include <QPainterPath>' src/views/middleviewdelegate.cpp src/views/leftviewdelegate.cpp
}

build() {
  cd deepin-voice-note-$pkgver
  cmake -GNinja .
  ninja
}

check() {
  cd deepin-voice-note-$pkgver
  ninja test || :
}

package() {
  cd deepin-voice-note-$pkgver
  DESTDIR="$pkgdir" ninja install
}
