# Copyright 2025 BattlePenguin.com
# Distributed under the terms of the GNU General Public License v3

EAPI=8

DISTUTILS_USE_PEP517=hatchling
PYTHON_COMPAT=( pypy3 python3_{12..13} )
inherit distutils-r1 desktop xdg-utils

DESCRIPTION="Media player with progress tracking"
HOMEPAGE="https://gitlib.com/djsumdog/mpvbuddy"
SRC_URI="https://nexus.sumit.im/repository/bp-python/packages/mpvbuddy/0.6/mpvbuddy-0.6.tar.gz"

LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~hppa ~ppc ~ppc64 ~riscv x86 ~arm64-macos ~x64-macos"

RDEPEND="
  dev-python/pyqt6[gui,widgets,${PYTHON_USEDEP}]
  dev-python/python-mpv[${PYTHON_USEDEP}]
  dev-python/yoyo-migrations[${PYTHON_USEDEP}]
  dev-python/rich[${PYTHON_USEDEP}]
  dev-python/click[${PYTHON_USEDEP}]
  dev-python/python-xlib[${PYTHON_USEDEP}]
"
BDEPEND="
  dev-python/hatch-vcs[${PYTHON_USEDEP}]
  "
distutils_enable_tests pytest

src_install() {
  distutils-r1_src_install
  doicon -s 128 mpvbuddy/mpvbuddy-128x128.png
  domenu "assets/${PN}.desktop"
}

pkg_postinst() {
  xdg_desktop_database_update
  xdg_icon_cache_update
}
S="${WORKDIR}/mpvbuddy-0.6"