summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James (sam_c) <sam@cmpct.info>2020-06-17 20:44:06 +0000
committerAaron Bauman <bman@gentoo.org>2020-06-19 20:22:35 -0400
commit131ece7fff304dae10e8efb0fb600c5751092900 (patch)
treeed8acd27ac6ab2c4bfdf500558eb5235bd67b314 /media-video/subliminal
parentmedia-video/subliminal: Sync live (diff)
downloadgentoo-131ece7fff304dae10e8efb0fb600c5751092900.tar.gz
gentoo-131ece7fff304dae10e8efb0fb600c5751092900.tar.bz2
gentoo-131ece7fff304dae10e8efb0fb600c5751092900.zip
media-video/subliminal: rewrite live ebuild to be agnostic
Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Sam James (sam_c) <sam@cmpct.info> Closes: https://github.com/gentoo/gentoo/pull/16084 Signed-off-by: Aaron Bauman <bman@gentoo.org>
Diffstat (limited to 'media-video/subliminal')
-rw-r--r--media-video/subliminal/subliminal-2.1.0.ebuild26
-rw-r--r--media-video/subliminal/subliminal-9999.ebuild27
2 files changed, 40 insertions, 13 deletions
diff --git a/media-video/subliminal/subliminal-2.1.0.ebuild b/media-video/subliminal/subliminal-2.1.0.ebuild
index 9b14d3b3016..48473f15489 100644
--- a/media-video/subliminal/subliminal-2.1.0.ebuild
+++ b/media-video/subliminal/subliminal-2.1.0.ebuild
@@ -9,12 +9,19 @@ DISTUTILS_USE_SETUPTOOLS=rdepend
inherit distutils-r1
+SRC_URI=""
+
+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"
+fi
+
DESCRIPTION="Python library to search and download subtitles"
HOMEPAGE="https://github.com/Diaoul/subliminal https://pypi.org/project/subliminal/"
-SRC_URI="
- https://github.com/Diaoul/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- test? ( mirror://sourceforge/matroska/test_files/matroska_test_w1_1.zip )
-"
+SRC_URI+=" test? ( mirror://sourceforge/matroska/test_files/matroska_test_w1_1.zip )"
LICENSE="MIT"
SLOT="0"
@@ -53,6 +60,15 @@ PATCHES=(
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
@@ -60,7 +76,7 @@ python_prepare_all() {
# Disable unconditional dependency on dev-python/pytest-runner.
sed -i -e "s|'pytest-runner'||g" setup.py || die
- if use test; then
+ if use test ; then
mkdir -p tests/data/mkv || die
ln -s "${WORKDIR}"/test*.mkv tests/data/mkv/ || die
fi
diff --git a/media-video/subliminal/subliminal-9999.ebuild b/media-video/subliminal/subliminal-9999.ebuild
index 3043809fda4..54ade49d622 100644
--- a/media-video/subliminal/subliminal-9999.ebuild
+++ b/media-video/subliminal/subliminal-9999.ebuild
@@ -7,17 +7,24 @@ PYTHON_COMPAT=( python3_{6,7} )
PYTHON_REQ_USE='xml(+)'
DISTUTILS_USE_SETUPTOOLS=rdepend
-inherit distutils-r1 git-r3
+inherit distutils-r1
+
+SRC_URI=""
+
+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"
+fi
DESCRIPTION="Python library to search and download subtitles"
HOMEPAGE="https://github.com/Diaoul/subliminal https://pypi.org/project/subliminal/"
-EGIT_REPO_URI="https://github.com/Diaoul/${PN}.git"
-EGIT_BRANCH="develop"
-SRC_URI="test? ( mirror://sourceforge/matroska/test_files/matroska_test_w1_1.zip )"
+SRC_URI+=" test? ( mirror://sourceforge/matroska/test_files/matroska_test_w1_1.zip )"
LICENSE="MIT"
SLOT="0"
-KEYWORDS=""
IUSE="test"
RESTRICT="!test? ( test )"
@@ -53,8 +60,12 @@ PATCHES=(
distutils_enable_tests pytest
src_unpack() {
- default_src_unpack
- git-r3_src_unpack
+ # Needed to unpack the test data
+ default
+
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ fi
}
python_prepare_all() {
@@ -64,7 +75,7 @@ python_prepare_all() {
# Disable unconditional dependency on dev-python/pytest-runner.
sed -i -e "s|'pytest-runner'||g" setup.py || die
- if use test; then
+ if use test ; then
mkdir -p tests/data/mkv || die
ln -s "${WORKDIR}"/test*.mkv tests/data/mkv/ || die
fi