# Maintainer: Kimiblock Moe

pkgname=rsgain
pkgver=3.7
pkgrel=14
pkgdesc="A simple, but powerful ReplayGain 2.0 tagging utility"
arch=('x86_64')
url="https://github.com/complexlogic/rsgain?tab=readme-ov-file"
license=('LicenseRef-custom')
depends=(libebur128 taglib ffmpeg fmt libinih gcc-libs)
source=(
	"${pkgname}"::"git+https://github.com/complexlogic/rsgain.git#tag=v${pkgver}"
)
sha256sums=('5e03fa75372c1006812652cda1d4dfa65a571ec1844c36497fd84adb40233e7f')
makedepends=("git" "cmake")

build() {
	local cmake_options=(
		-B build
		-S $pkgname
		-W no-dev
		-D CMAKE_BUILD_TYPE=Release
		-DUSE_STD_FORMAT=ON
		-D CMAKE_INSTALL_PREFIX=/usr
	)
	cmake "${cmake_options[@]}"
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -Dm644 "${srcdir}/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}"
}
