diff options
author | Louis Sautier <sbraz@gentoo.org> | 2019-08-05 14:02:29 +0200 |
---|---|---|
committer | Louis Sautier <sbraz@gentoo.org> | 2019-08-05 15:01:10 +0200 |
commit | 2e3c786da2b70fb0481ac917afade2ec8e7e5bf8 (patch) | |
tree | d1cf88eb5392d6311081fd3480b45158186bb5d4 /media-video | |
parent | sys-apps/busybox: mark stable (diff) | |
download | gentoo-2e3c786da2b70fb0481ac917afade2ec8e7e5bf8.tar.gz gentoo-2e3c786da2b70fb0481ac917afade2ec8e7e5bf8.tar.bz2 gentoo-2e3c786da2b70fb0481ac917afade2ec8e7e5bf8.zip |
media-video/gaupol: bump to 1.7, uses gspell for spell-checking
* Uses gspell instead of pyenchant (unmaintained) and gtkspell.
* Improve postinst messages, especially those related to spell-checking.
* Bump to EAPI 7.
* Stop relying on deprecated gnome2_icon_cache_update function.
* Remove useless call to xdg_mimeinfo_database_update as no files
are installed in /usr/share/mime.
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Louis Sautier <sbraz@gentoo.org>
Diffstat (limited to 'media-video')
-rw-r--r-- | media-video/gaupol/Manifest | 1 | ||||
-rw-r--r-- | media-video/gaupol/files/gaupol-1.7-fix-tests.patch | 132 | ||||
-rw-r--r-- | media-video/gaupol/gaupol-1.7.ebuild | 64 |
3 files changed, 197 insertions, 0 deletions
diff --git a/media-video/gaupol/Manifest b/media-video/gaupol/Manifest index 2119f384acd6..d428730916ed 100644 --- a/media-video/gaupol/Manifest +++ b/media-video/gaupol/Manifest @@ -1,3 +1,4 @@ DIST gaupol-1.4.tar.gz 524369 BLAKE2B 6f27ce3328339fc2f6248bb58d80965a5a26fed220ddf9c989a5029b4322ea790f768cb9e0472bb2c5eae4e4da3abd4b0f808e785273ff9fb787ff5b7df5d137 SHA512 da9256dd8dafeaff012226a8ff09807c7cb7609c293bde7d90b05b4f75c47751e65181f1bf47dff1c8e979f48186996253141ff18e849786bf2cff5ed5555148 DIST gaupol-1.5.tar.gz 537279 BLAKE2B 1ba8644b49832ee80e61bf304b7978275064acbe2e5e733a991b280f947c4064f0d4f385055e580bd3aa2d9ee2291d64fd1ee4bd8a1ba4f8eaaaaf9a137085ff SHA512 48f3eda460c2fb3e4bdaf52c42645599f0d5ce8eae05f7a2a9c608192a27a8b86b83830584216dc73105968f544aeab30e171b2c176d9a3f5047e93510413b85 DIST gaupol-1.6.tar.gz 540186 BLAKE2B 4e7a2e0c01be2ac88c0ae5948d3002005c72418ef21835195daf6b0c5b71d970006b0f76fa78a1ec7337d1f9366436c44eb336e0a56d8cbb7eac905e09d4c81a SHA512 e0f258b579a34644e54456978df9c5a6f72aa019b6de79918fe6892bb59d2316c3fc093f2f49c60d6eef74832fa2a9a9e102bb1d25f64f3143fd29d3cb4966e5 +DIST gaupol-1.7.tar.gz 524231 BLAKE2B 5f1c07a6d633fba53361ad4d9e1cdbc3236614a444bb387378c9e1ec6b358796eb7477168caace4b6101e0e6e0b83f10a2d3052acb5e0b0ab69e75f2b24db7fa SHA512 b0fa7f5216f47075aefddd58ab3aa1186265b5d70f8b4e7f7e252a1cc05bd1c4838c2af8efb4da39c0196f63dc3a64ff2269a458e2d95072606b59b4b8cada1b diff --git a/media-video/gaupol/files/gaupol-1.7-fix-tests.patch b/media-video/gaupol/files/gaupol-1.7-fix-tests.patch new file mode 100644 index 000000000000..d8a90669de9f --- /dev/null +++ b/media-video/gaupol/files/gaupol-1.7-fix-tests.patch @@ -0,0 +1,132 @@ +commit 7778eda0e6e4280fb43aa78721561e43d3e866eb +Author: Osmo Salomaa <otsaloma@iki.fi> +Date: Sun Aug 4 21:19:20 2019 +0300 + + Accept any en* language for spell-check tests + +diff --git a/aeidon/agents/test/test_text.py b/aeidon/agents/test/test_text.py +index bf6c4ac1..a2261595 100644 +--- a/aeidon/agents/test/test_text.py ++++ b/aeidon/agents/test/test_text.py +@@ -78,14 +78,16 @@ class TestTextAgent(aeidon.TestCase): + for subtitle in self.project.subtitles: + subtitle.main_text = subtitle.main_text.replace("a", " a") + subtitle.main_text = subtitle.main_text.replace("e", "e ") ++ language = self.get_spell_check_language("en") + self.project.spell_check_join_words(indices=None, + doc=aeidon.documents.MAIN, +- language="en") ++ language=language) + + def test_spell_check_split_words(self): + for subtitle in self.project.subtitles: + subtitle.main_text = subtitle.main_text.replace("s ", "s") + subtitle.main_text = subtitle.main_text.replace("y ", "y") ++ language = self.get_spell_check_language("en") + self.project.spell_check_split_words(indices=None, + doc=aeidon.documents.MAIN, +- language="en") ++ language=language) +diff --git a/aeidon/test/test_spell.py b/aeidon/test/test_spell.py +index 66369e0e..ff94f150 100644 +--- a/aeidon/test/test_spell.py ++++ b/aeidon/test/test_spell.py +@@ -21,7 +21,8 @@ import aeidon + class TestSpellChecker(aeidon.TestCase): + + def setup_method(self, method): +- self.checker = aeidon.SpellChecker("en") ++ language = self.get_spell_check_language("en") ++ self.checker = aeidon.SpellChecker(language) + + def test_add_replacement(self): + self.checker.add_replacement("abc", "xyz") +@@ -50,7 +51,8 @@ class TestSpellChecker(aeidon.TestCase): + class TestSpellCheckNavigator(aeidon.TestCase): + + def setup_method(self, method): +- self.navigator = aeidon.SpellCheckNavigator("en") ++ language = language = self.get_spell_check_language("en") ++ self.navigator = aeidon.SpellCheckNavigator(language) + self.navigator.text = "She knows the fighting\ntechniques of Panzer Kunst." + + def test_ignore(self): +diff --git a/aeidon/unittest.py b/aeidon/unittest.py +index 8c384806..d80c5a22 100644 +--- a/aeidon/unittest.py ++++ b/aeidon/unittest.py +@@ -50,6 +50,15 @@ class TestCase: + with open(path, "r", encoding="ascii") as f: + return f.read().strip() + ++ def get_spell_check_language(self, language): ++ """Return spell-check language to use in unit tests.""" ++ # Allow any close-enough variant as different systems will have ++ # different spell-check engines and dictionaries installed. ++ for candidate in aeidon.SpellChecker.list_languages(): ++ if candidate.startswith(language): ++ return candidate ++ raise Exception("Spell-check dictionary {}* not found".format(language)) ++ + def new_microdvd_file(self): + """Return path to a new temporary MicroDVD file.""" + return self.new_temp_file(aeidon.formats.MICRODVD) +diff --git a/gaupol/agents/test/test_tools.py b/gaupol/agents/test/test_tools.py +index a9fbdf8f..e1547476 100644 +--- a/gaupol/agents/test/test_tools.py ++++ b/gaupol/agents/test/test_tools.py +@@ -36,7 +36,8 @@ class TestToolsAgent(gaupol.TestCase): + + @patch("gaupol.util.flash_dialog", OK) + def test__on_check_spelling_activate(self): +- gaupol.conf.spell_check.language = "en" ++ language = self.get_spell_check_language("en") ++ gaupol.conf.spell_check.language = language + self.application.get_action("check-spelling").activate() + + @patch("gaupol.util.flash_dialog", OK) +diff --git a/gaupol/dialogs/test/test_spell_check.py b/gaupol/dialogs/test/test_spell_check.py +index cbe7d61a..d74860fb 100644 +--- a/gaupol/dialogs/test/test_spell_check.py ++++ b/gaupol/dialogs/test/test_spell_check.py +@@ -32,7 +32,8 @@ class TestSpellCheckDialog(gaupol.TestCase): + aeidon.SpellChecker.add_to_personal = aeidon.SpellChecker.add_to_session + aeidon.SpellChecker.read_replacements = lambda *args: None + aeidon.SpellChecker.write_replacements = lambda *args: None +- gaupol.conf.spell_check.language = "en" ++ language = self.get_spell_check_language("en") ++ gaupol.conf.spell_check.language = language + self.application = self.new_application() + for page in self.application.pages: + for subtitle in page.project.subtitles: +diff --git a/gaupol/test/test_spell.py b/gaupol/test/test_spell.py +index 72b74e33..5018abab 100644 +--- a/gaupol/test/test_spell.py ++++ b/gaupol/test/test_spell.py +@@ -37,4 +37,5 @@ class TestSpellChecker(aeidon.TestCase): + Gtk.main() + + def setup_method(self, method): +- self.checker = gaupol.SpellChecker("en") ++ language = self.get_spell_check_language("en") ++ self.checker = gaupol.SpellChecker(language) + +commit 340b3bf6bb7cfdf5be9e973f25f5a616ef504702 +Author: Osmo Salomaa <otsaloma@iki.fi> +Date: Mon Aug 5 02:31:32 2019 +0300 + + Set spell-check language for assistant test + +diff --git a/gaupol/test/test_assistants.py b/gaupol/test/test_assistants.py +index 6969b273..4d6dfdcb 100644 +--- a/gaupol/test/test_assistants.py ++++ b/gaupol/test/test_assistants.py +@@ -109,6 +109,8 @@ class TestJoinSplitWordsPage(_TestBuilderPage): + + @patch("gaupol.util.flash_dialog", OK) + def test_correct_texts(self): ++ language = self.get_spell_check_language("en") ++ gaupol.conf.spell_check.language = language + self.page.correct_texts(self.project, + None, + aeidon.documents.MAIN) diff --git a/media-video/gaupol/gaupol-1.7.ebuild b/media-video/gaupol/gaupol-1.7.ebuild new file mode 100644 index 000000000000..22fc8a04293e --- /dev/null +++ b/media-video/gaupol/gaupol-1.7.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{5,6,7} ) + +inherit distutils-r1 virtualx xdg-utils + +DESCRIPTION="A subtitle editor for text-based subtitles" +HOMEPAGE="https://otsaloma.io/gaupol/" +SRC_URI="https://github.com/otsaloma/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +IUSE="spell test" + +RDEPEND=" + app-text/iso-codes + dev-python/chardet[${PYTHON_USEDEP}] + dev-python/pygobject:3[${PYTHON_USEDEP}] + x11-libs/gtk+:3[introspection] + spell? ( app-text/gspell[introspection] ) +" +DEPEND=" + sys-devel/gettext + test? ( + ${RDEPEND} + app-dicts/myspell-en + app-text/enchant[hunspell] + app-text/gspell[introspection] + dev-python/pytest[${PYTHON_USEDEP}] + ) +" + +DOCS=( AUTHORS.md NEWS.md TODO.md README.md README.aeidon.md ) + +PATCHES=( "${FILESDIR}/${P}-fix-tests.patch" ) + +python_test() { + virtx pytest -vv +} + +pkg_postinst() { + xdg_desktop_database_update + xdg_icon_cache_update + if [[ -z ${REPLACING_VERSIONS} ]]; then + elog "Previewing support requires MPV, MPlayer or VLC." + if use spell; then + elog "" + elog "Spell-checking requires a dictionary, any of app-dicts/myspell-*" + elog "or app-text/aspell with the appropriate L10N variable." + elog "" + elog "Additionally, make sure that app-text/enchant has the correct flags enabled:" + elog "USE=hunspell for myspell dictionaries and USE=aspell for aspell dictionaries." + fi + fi +} + +pkg_postrm() { + xdg_desktop_database_update + xdg_icon_cache_update +} |