summaryrefslogtreecommitdiff
path: root/dev-python/polib
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/polib')
-rw-r--r--dev-python/polib/Manifest1
-rw-r--r--dev-python/polib/files/polib-1.0.7-BE-test.patch11
-rw-r--r--dev-python/polib/files/polib-1.2.0-gettext-0.22.patch23
-rw-r--r--dev-python/polib/metadata.xml10
-rw-r--r--dev-python/polib/polib-1.2.0.ebuild40
5 files changed, 85 insertions, 0 deletions
diff --git a/dev-python/polib/Manifest b/dev-python/polib/Manifest
new file mode 100644
index 000000000000..7c1b5d3be158
--- /dev/null
+++ b/dev-python/polib/Manifest
@@ -0,0 +1 @@
+DIST polib-1.2.0.tar.gz 161658 BLAKE2B 8f53d829ac7a2e59676fa7b548645eed26fbd5a2c6e966093145b43bc492ba05ef715e4ddb95f35f8c965890e24c80b7e19d58c6d75d26c4cef141fb15a7d79e SHA512 b325730cd4df6c881ffcab72da1796eb2949243f6060c650209e1c6584e5344ecaede870f22ece00f5c74bcd289fa5d2aa5223b88cb78de0dff5f9e41759096e
diff --git a/dev-python/polib/files/polib-1.0.7-BE-test.patch b/dev-python/polib/files/polib-1.0.7-BE-test.patch
new file mode 100644
index 000000000000..e2192bb7091b
--- /dev/null
+++ b/dev-python/polib/files/polib-1.0.7-BE-test.patch
@@ -0,0 +1,11 @@
+https://bitbucket.org/izi/polib/pull-requests/24/tests-force-msgfmt-into-machines-byte/diff
+https://bugs.gentoo.org/641464
+diff --git a/tests/tests.py b/tests/tests.py
+index 50ad0c6..239ce88 100644
+--- a/tests/tests.py
++++ b/tests/tests.py
+@@ -551,3 +551,3 @@ class TestPoFile(unittest.TestCase):
+ po.save_as_mofile(tmpfile1)
+- subprocess.call([msgfmt, '--no-hash', '-o', tmpfile2, reffile])
++ subprocess.call([msgfmt, '--no-hash', '--endianness=%s' % sys.byteorder, '-o', tmpfile2, reffile])
+ try:
diff --git a/dev-python/polib/files/polib-1.2.0-gettext-0.22.patch b/dev-python/polib/files/polib-1.2.0-gettext-0.22.patch
new file mode 100644
index 000000000000..c544fa89c41e
--- /dev/null
+++ b/dev-python/polib/files/polib-1.2.0-gettext-0.22.patch
@@ -0,0 +1,23 @@
+From 127f746ebef68cd3485a5feee2739ab83a9c3612 Mon Sep 17 00:00:00 2001
+From: Dave Vasilevsky <dave@vasilevsky.ca>
+Date: Fri, 28 Mar 2025 16:38:43 -0400
+Subject: [PATCH] Don't convert to UTF-8 in test
+
+Fixes #150
+---
+ tests/tests.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/tests.py b/tests/tests.py
+index 4b408d5..61533d0 100644
+--- a/tests/tests.py
++++ b/tests/tests.py
+@@ -675,7 +675,7 @@ def test_save_as_mofile(self):
+ os.close(fd)
+ po = polib.pofile(reffile, autodetect_encoding=False, encoding=encoding)
+ po.save_as_mofile(tmpfile1)
+- subprocess.call([msgfmt, '--no-hash', '--endianness=%s' % sys.byteorder, '-o', tmpfile2, reffile])
++ subprocess.call([msgfmt, '--no-hash', '--endianness=%s' % sys.byteorder, '--no-convert', '-o', tmpfile2, reffile])
+ try:
+ f = open(tmpfile1, 'rb')
+ s1 = f.read()
diff --git a/dev-python/polib/metadata.xml b/dev-python/polib/metadata.xml
new file mode 100644
index 000000000000..5e95859f915a
--- /dev/null
+++ b/dev-python/polib/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <stabilize-allarches />
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-python/polib/polib-1.2.0.ebuild b/dev-python/polib/polib-1.2.0.ebuild
new file mode 100644
index 000000000000..a286f9568691
--- /dev/null
+++ b/dev-python/polib/polib-1.2.0.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="A library to manipulate gettext files (.po and .mo files)"
+HOMEPAGE="
+ https://github.com/izimobil/polib/
+ https://pypi.org/project/polib/
+ https://polib.readthedocs.io/en/latest/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ test? (
+ sys-devel/gettext
+ )
+"
+
+distutils_enable_sphinx docs
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.0.7-BE-test.patch
+ # https://github.com/izimobil/polib/pull/168
+ "${FILESDIR}/${P}-gettext-0.22.patch"
+)
+
+python_test() {
+ "${EPYTHON}" tests/tests.py -v || die "Tests failed under ${EPYTHON}"
+}