summaryrefslogtreecommitdiff
path: root/media-video/subliminal
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/subliminal')
-rw-r--r--media-video/subliminal/Manifest4
-rw-r--r--media-video/subliminal/files/subliminal-2.1.0-rarfile-4.0-compat.patch25
-rw-r--r--media-video/subliminal/subliminal-2.1.0-r2.ebuild95
-rw-r--r--media-video/subliminal/subliminal-9999.ebuild20
4 files changed, 133 insertions, 11 deletions
diff --git a/media-video/subliminal/Manifest b/media-video/subliminal/Manifest
index 8fc268681751..4c388dcf4727 100644
--- a/media-video/subliminal/Manifest
+++ b/media-video/subliminal/Manifest
@@ -1,6 +1,8 @@
AUX subliminal-2.1.0-fix-pytest-warning.patch 315 BLAKE2B e04d8f7d9dca768cb805f8b0a5ec3872c7a758c12adc1d3aba931ebc545fcfdfcdbac19cfccef6d2efc6fb5951d6336f3ab97432e18aa7dad4a87f815af1015b SHA512 c3d03c1ed84c8964b04ac4999e8383a31d4d931753f674f10ef1948b581986f2f8bf4a665921c8900ccd441c564e839ef43f3cdcd7f92a5ae3252ee260ff15f7
+AUX subliminal-2.1.0-rarfile-4.0-compat.patch 971 BLAKE2B a26cd6ef8e2602abdcd8f4fa2d188e7a76a5b3a18c556adfb4b4218a852f976c0e85c83ff9e953151a09ac995b48170713ac399a1f89fe6e43f2b3aa215cff57 SHA512 eae1852b7d75f77783bb11f6e77082e3317dbc4be62e1fa04ad5138125a70e100eee42726b0f23d0baed83e973b0d98ac382096c3dc64bafb8b95db2d8a33a3e
DIST matroska_test_w1_1.zip 184550509 BLAKE2B f111725aa08267661942072c2d4ac019d3d322c4e933aad10afb3aa6f69bb3469114c4400d161e53d8a7618b818b22465177460003804a7ac3e69fa4f4db000d SHA512 f170a8e83dab15228f992b3692330163da2402b8e436c7fa195ac1ecc06cf1eaf1a48d8c99a85c031122c158c2d4006023aae75d5b7805385ba25a6d601cb78f
DIST subliminal-2.1.0.tar.gz 5480458 BLAKE2B 249bdd027d99dfb0b81d939af2dc08f62b52dca2c8618f1006ca76eee41c2443b450076eddc1aa533997beca8cdf9016b884d7eceeebbf4e48ced91dae1a2361 SHA512 9b26ae594895470830547eed604aa5b28b75f590e5be12c2d5a478c5daf798d405f209639bd54dce0565b0e27d1b0daa5bef87dfa8590af61f2ab1e287c41060
EBUILD subliminal-2.1.0-r1.ebuild 2696 BLAKE2B 5a93590849d168526574d5c8173d701de78c22dfb16b66619e762424a273743e788d1bad99d9bfeaf33d03a0b07f2a893ef5654a3f9465b1efcec7fc9232cf8d SHA512 8796852370c4a903e678f1f669ceb07de4be275dfea8ffebbdb57b365d4320078ad0aee282f93ab3bc0d35180719e9cab07009e9f41a58dca1ff9237b1987614
-EBUILD subliminal-9999.ebuild 2669 BLAKE2B 7201a86906e72393e2349d8120ad78e7170f8c05ea293c4d48896911416513633fee7c26630f87bb0a1ec9c806d72337d88896be88b546a24894c2673fc8b928 SHA512 81cb6087cb0244b3cb0d3522c3f512362bd64600af4fb4b987d5cf3792ffcadca2760aa0c21c5c0a1ee8d351a25d7d2e6956e10d4eb17cb14fab84a0306d64ef
+EBUILD subliminal-2.1.0-r2.ebuild 2573 BLAKE2B 4f37498e938d04f196201eb5014574496594b6dbf2bad840de0923a54d743b257af006e9c4a54948746333f30d41a2c58d0257731887607352bdb912633d4256 SHA512 3d08e5b099c9beffe9b3d905b5fc67867da4d1ad0e3faefbe42dd166ecb403419ce3192d0c8bcb27cbefb89a534442562f7836fcb241a07705868f5c02252a54
+EBUILD subliminal-9999.ebuild 2573 BLAKE2B 4f37498e938d04f196201eb5014574496594b6dbf2bad840de0923a54d743b257af006e9c4a54948746333f30d41a2c58d0257731887607352bdb912633d4256 SHA512 3d08e5b099c9beffe9b3d905b5fc67867da4d1ad0e3faefbe42dd166ecb403419ce3192d0c8bcb27cbefb89a534442562f7836fcb241a07705868f5c02252a54
MISC metadata.xml 447 BLAKE2B 42fac15336ea05ed85313259c5571f8e4101a39157973a2c43bc1a77bdb1e6610e9373646d485f8e5a5df1420b8fb3c780393e3191d4069a4e2ec5296733adc1 SHA512 fa0256091da7f65f41cfdd1b4ebd7e485c15c8a72cd916d553003e0d8beca479b0d0d877ad90c6c986b5c24070a89994d359f4672d2dfac513d06e9a8683d826
diff --git a/media-video/subliminal/files/subliminal-2.1.0-rarfile-4.0-compat.patch b/media-video/subliminal/files/subliminal-2.1.0-rarfile-4.0-compat.patch
new file mode 100644
index 000000000000..55b8b9484808
--- /dev/null
+++ b/media-video/subliminal/files/subliminal-2.1.0-rarfile-4.0-compat.patch
@@ -0,0 +1,25 @@
+https://github.com/Diaoul/subliminal/pull/1045
+
+From e9ed47e61a63ad0e0cdb036375ffa5a144953f1e Mon Sep 17 00:00:00 2001
+From: Eduardo Soares <eduardosoares.pt@gmail.com>
+Date: Fri, 24 Dec 2021 17:08:04 +0000
+Subject: [PATCH] Fix removal of custom check from rarfile dependency
+
+---
+ subliminal/providers/legendastv.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/subliminal/providers/legendastv.py b/subliminal/providers/legendastv.py
+index 9d696ca24..bf57a22dc 100644
+--- a/subliminal/providers/legendastv.py
++++ b/subliminal/providers/legendastv.py
+@@ -161,7 +161,7 @@ def __init__(self, username=None, password=None):
+
+ # Provider needs UNRAR installed. If not available raise ConfigurationError
+ try:
+- rarfile.custom_check([rarfile.UNRAR_TOOL], True)
++ rarfile.tool_setup(True, False, False, True)
+ except rarfile.RarExecError:
+ raise ConfigurationError('UNRAR tool not available')
+
+
diff --git a/media-video/subliminal/subliminal-2.1.0-r2.ebuild b/media-video/subliminal/subliminal-2.1.0-r2.ebuild
new file mode 100644
index 000000000000..a3c58afc2d5e
--- /dev/null
+++ b/media-video/subliminal/subliminal-2.1.0-r2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_REQ_USE='xml(+)'
+
+inherit distutils-r1
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/Diaoul/${PN}.git"
+ EGIT_BRANCH="develop"
+else
+ SRC_URI="https://github.com/Diaoul/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+DESCRIPTION="Python library to search and download subtitles"
+HOMEPAGE="https://github.com/Diaoul/subliminal https://pypi.org/project/subliminal/"
+SRC_URI+=" test? ( mirror://sourceforge/matroska/test_files/matroska_test_w1_1.zip )"
+
+LICENSE="MIT"
+SLOT="0"
+
+BDEPEND="
+ test? (
+ app-arch/unzip
+ dev-python/sympy[${PYTHON_USEDEP}]
+ >=dev-python/vcrpy-1.6.1[${PYTHON_USEDEP}]
+ )
+"
+RDEPEND="
+ >=dev-python/appdirs-1.3[${PYTHON_USEDEP}]
+ >=dev-python/babelfish-0.5.2[${PYTHON_USEDEP}]
+ >=dev-python/beautifulsoup4-4.4.0[${PYTHON_USEDEP}]
+ >=dev-python/chardet-2.3.0[${PYTHON_USEDEP}]
+ >=dev-python/click-4.0[${PYTHON_USEDEP}]
+ dev-python/decorator[${PYTHON_USEDEP}]
+ >=dev-python/dogpile-cache-0.6.0[${PYTHON_USEDEP}]
+ >=dev-python/enzyme-0.4.1[${PYTHON_USEDEP}]
+ >=dev-python/guessit-2.0.1[${PYTHON_USEDEP}]
+ >=dev-python/pysrt-1.0.1[${PYTHON_USEDEP}]
+ >=dev-python/pytz-2012c[${PYTHON_USEDEP}]
+ >=dev-python/rarfile-2.7[compressed,${PYTHON_USEDEP}]
+ >=dev-python/requests-2.0[${PYTHON_USEDEP}]
+ >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
+ >=dev-python/stevedore-1.0.0[${PYTHON_USEDEP}]
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-pytest-warning.patch
+ "${FILESDIR}"/${PN}-2.1.0-rarfile-4.0-compat.patch
+)
+
+distutils_enable_tests pytest
+
+src_unpack() {
+ # Needed to unpack the test data
+ default
+
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ fi
+}
+
+python_prepare_all() {
+ # Disable code checkers as they require unavailable dependencies.
+ sed -i -e 's/--\(pep8\|flakes\)//g' pytest.ini || die
+
+ # Disable unconditional dependency on dev-python/pytest-runner.
+ sed -i -e "s|'pytest-runner'||g" setup.py || die
+
+ if use test ; then
+ mkdir -p tests/data/mkv || die
+ ln -s "${WORKDIR}"/test*.mkv tests/data/mkv/ || die
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ EPYTEST_DESELECT=(
+ tests/test_core.py::test_scan_archive_with_one_video
+ tests/test_core.py::test_scan_archive_with_multiple_videos
+ tests/test_core.py::test_scan_archive_with_no_video
+ tests/test_core.py::test_scan_password_protected_archive
+ # NotImplementedError
+ tests/test_core.py::test_save_subtitles
+ )
+
+ epytest
+}
diff --git a/media-video/subliminal/subliminal-9999.ebuild b/media-video/subliminal/subliminal-9999.ebuild
index 792931859484..a3c58afc2d5e 100644
--- a/media-video/subliminal/subliminal-9999.ebuild
+++ b/media-video/subliminal/subliminal-9999.ebuild
@@ -1,11 +1,11 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{9..10} )
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
PYTHON_REQ_USE='xml(+)'
-DISTUTILS_USE_SETUPTOOLS=rdepend
inherit distutils-r1
@@ -15,6 +15,7 @@ if [[ ${PV} == 9999 ]] ; then
EGIT_BRANCH="develop"
else
SRC_URI="https://github.com/Diaoul/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86"
fi
DESCRIPTION="Python library to search and download subtitles"
@@ -50,7 +51,8 @@ RDEPEND="
"
PATCHES=(
- "${FILESDIR}/${PN}-2.1.0-fix-pytest-warning.patch"
+ "${FILESDIR}"/${P}-fix-pytest-warning.patch
+ "${FILESDIR}"/${PN}-2.1.0-rarfile-4.0-compat.patch
)
distutils_enable_tests pytest
@@ -80,16 +82,14 @@ python_prepare_all() {
}
python_test() {
- local skipped_tests=(
+ EPYTEST_DESELECT=(
tests/test_core.py::test_scan_archive_with_one_video
tests/test_core.py::test_scan_archive_with_multiple_videos
tests/test_core.py::test_scan_archive_with_no_video
tests/test_core.py::test_scan_password_protected_archive
+ # NotImplementedError
+ tests/test_core.py::test_save_subtitles
)
- # Two tests that list providers rely on entry points
- # so they need the package to be installed
- distutils_install_for_testing
- pytest -vv --ignore ${PN}/test/test_core.py ${skipped_tests[@]/#/--deselect } \
- || die "Tests fail with ${EPYTHON}"
+ epytest
}