commit: 1366e495fd2a63f429843fc27a62da0d57db1d9b Author: Tomasz Śliwa <tomekmsliwa <AT> gmail <DOT> com> AuthorDate: Sun Apr 27 15:25:08 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Tue May 6 08:43:06 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1366e495
app-text/nfoview: Bump to 2.1, enable py3.13 Signed-off-by: Tomasz Śliwa <tomekmsliwa <AT> gmail.com> Closes: https://bugs.gentoo.org/952251 Part-of: https://github.com/gentoo/gentoo/pull/41792 Closes: https://github.com/gentoo/gentoo/pull/41792 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> app-text/nfoview/Manifest | 1 + app-text/nfoview/files/nfoview-2.1-fix-paths.patch | 20 ++++++ app-text/nfoview/nfoview-2.1.ebuild | 79 ++++++++++++++++++++++ 3 files changed, 100 insertions(+) diff --git a/app-text/nfoview/Manifest b/app-text/nfoview/Manifest index 358784e45e64..c47632a4102d 100644 --- a/app-text/nfoview/Manifest +++ b/app-text/nfoview/Manifest @@ -1 +1,2 @@ DIST nfoview-1.28.1.tar.gz 62571 BLAKE2B 5ecfd83e9429f3d616d9b633a5f3042308df06253065946ea13c66f71dd937a2325f252e04812894d000fea3364337378c4d91b2c54ee530c9d225ce7752dc90 SHA512 55179791b1a8058777a8a8527758687ab5924e00086d1c85a95759d85eb65ec46f072ba5bd5521629f39737437002eb6cf4070bc25b0e9246c511c32c6b08e99 +DIST nfoview-2.1.tar.gz 52447 BLAKE2B d8b56690a96f45dfc8ec2cb2e87cfbc42ac44646551432441fb75199835be60d20e26bbdd782485db5096483c347f9d7db8a72a9c8a7a35c95e6b291e6863ba0 SHA512 ba9fcb66f97895e2e21f4b70190f8dfdd10d201fddfb422252742bfa741003f657d098fe9e0e5f75e915668310d6034794ad6d787e46a1ac228268a8cdb01019 diff --git a/app-text/nfoview/files/nfoview-2.1-fix-paths.patch b/app-text/nfoview/files/nfoview-2.1-fix-paths.patch new file mode 100644 index 000000000000..360ab4170f14 --- /dev/null +++ b/app-text/nfoview/files/nfoview-2.1-fix-paths.patch @@ -0,0 +1,20 @@ +--- a/nfoview/paths.py 2025-05-03 12:37:51.767811975 +0200 ++++ b/nfoview/paths.py 2025-05-03 12:38:42.881021423 +0200 +@@ -42,7 +42,7 @@ + return Path(sys.argv[0]).parent / "share" / "nfoview" + + def get_data_directory_source(): +- return Path(__file__).parent.parent / "data" ++ return Path(__file__).parent + + def get_locale_directory(): + if hasattr(sys, "frozen"): +@@ -53,7 +53,7 @@ + return Path(sys.argv[0]).parent / "share" / "locale" + + def get_locale_directory_source(): +- return Path(__file__).parent.parent / "locale" ++ return Path(f"{sys.prefix}/share/locale") + + CONFIG_HOME_DIR = get_config_home_directory().resolve() + DATA_DIR = get_data_directory().resolve() diff --git a/app-text/nfoview/nfoview-2.1.ebuild b/app-text/nfoview/nfoview-2.1.ebuild new file mode 100644 index 000000000000..724913483209 --- /dev/null +++ b/app-text/nfoview/nfoview-2.1.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) + +inherit desktop python-single-r1 virtualx xdg + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/otsaloma/nfoview.git" + inherit git-r3 +else + SRC_URI="https://github.com/otsaloma/nfoview/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="Simple viewer for NFO files, which are ASCII art in the CP437 codepage" +HOMEPAGE="https://otsaloma.io/nfoview/" + +LICENSE="GPL-3+" +SLOT="0" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +BDEPEND=" + ${PYTHON_DEPS} + sys-devel/gettext + test? ( + $(python_gen_cond_dep ' + dev-python/pytest[${PYTHON_USEDEP}] + ') + ) +" +DEPEND="$(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]')" +RDEPEND="${DEPEND} + ${PYTHON_DEPS} + media-fonts/cascadia-code + gui-libs/gtk:4[introspection]" + +PATCHES=( "$FILESDIR/${P}-fix-paths.patch" ) + +src_prepare() { + default + cp data/*.ui nfoview || die +} + +src_compile() { + : +} + +src_test() { + virtx epytest +} + +src_install() { + local file + for file in po/*.po; do + msgfmt "${file}" -o "${file%.po}.mo" && domo "${file%.po}.mo" || die + done + + mkdir -p usr/share/{applications,metainfo} || die + msgfmt --xml -d po --template data/io.otsaloma.nfoview.appdata.xml.in \ + -o usr/share/metainfo/io.otsaloma.nfoview.appdata.xml || die + msgfmt --desktop -d po --template data/io.otsaloma.nfoview.desktop.in \ + -o usr/share/applications/io.otsaloma.nfoview.desktop || die + + doicon -s scalable data/io.otsaloma.nfoview.svg + doicon -s symbolic data/io.otsaloma.nfoview-symbolic.svg + + doman data/nfoview.1 + + python_moduleinto nfoview + python_domodule nfoview/. + + python_doscript bin/nfoview + + insinto /usr + doins -r usr/share +}
