# Maintainer: Maarten Baert <maarten-baert@hotmail.com>

pkgname=simplescreenrecorder-git
_pkgname=${pkgname%-git}
pkgver=0.4.4.r77.gad99c7e
pkgrel=1
pkgdesc="A simple but powerful recording tool for X11, OpenGL and V4L2. (Git version)"
arch=("x86_64")
url="https://www.maartenbaert.be/${_pkgname}"
license=("GPL-3.0-or-later")
depends=("qt6-base"
	"ffmpeg" "alsa-lib" "libpulse" "jack" "libgl" "glu" "v4l-utils"
	"libx11" "libxext" "libxfixes" "libxi" "libxinerama"
	"desktop-file-utils" "gtk-update-icon-cache" "pipewire")
optdepends=("lib32-simplescreenrecorder-git: OpenGL recording of 32-bit applications")
makedepends=("git" "cmake" "qt6-tools")
source=("git+https://github.com/MaartenBaert/ssr.git")
sha256sums=('SKIP')
conflicts=("${_pkgname}")
provides=("${_pkgname}")

pkgver() {
	git -C ssr describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cmake -B build \
		-S ssr \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-D CMAKE_BUILD_TYPE=None \
		-D WITH_QT6=TRUE

	cmake --build build
}

package() {
	DESTDIR="${pkgdir}" cmake --install build
}
