diff options
Diffstat (limited to 'app-arch/cfv')
-rw-r--r-- | app-arch/cfv/Manifest | 2 | ||||
-rw-r--r-- | app-arch/cfv/cfv-3.0.0.ebuild | 55 | ||||
-rw-r--r-- | app-arch/cfv/cfv-3.1.0.ebuild | 48 | ||||
-rw-r--r-- | app-arch/cfv/files/cfv-3.0.0-fix-removed-assertequal.patch | 39 | ||||
-rw-r--r-- | app-arch/cfv/files/cfv-3.0.0-fix-removed-imp.patch | 39 | ||||
-rw-r--r-- | app-arch/cfv/metadata.xml | 20 |
6 files changed, 203 insertions, 0 deletions
diff --git a/app-arch/cfv/Manifest b/app-arch/cfv/Manifest new file mode 100644 index 000000000000..cdecf640cbc1 --- /dev/null +++ b/app-arch/cfv/Manifest @@ -0,0 +1,2 @@ +DIST cfv-3.0.0.gh.tar.gz 91600 BLAKE2B 5a0d53a2b75973967ef976ce55d5262f71af97a8d7c64e8ea94ed9d66fd12778e10321e82bdbc4b8037df3f1a9c9c817694a7cd5e60615fc903127df9057b04f SHA512 9a44bf20f0a4f48a93631353d0b0ab79ea15d19f1da5492296dd4bd4e6208d3f0d71e957165e31d07b5faa7fc75122f0ae5ddbd8d54b9c6b633c43695b362640 +DIST cfv-3.1.0.gh.tar.gz 93155 BLAKE2B 45dd2cfa121052a96de4b8d8b9d1b25e4639c3956c8e0878981381dce89560abd3d1c56a7c1d7c3c86f97e767ea43f1d4df08a4be725d392a2a25bb2576f4ee6 SHA512 71c02cc0e5cb1dcf32aa180075744ccde27cf08765a6cf50b24bbdf68d61ba46d9e2e98cc9d414bddf1538ead1426f8eff56cfa788ad283981922c96519b10c4 diff --git a/app-arch/cfv/cfv-3.0.0.ebuild b/app-arch/cfv/cfv-3.0.0.ebuild new file mode 100644 index 000000000000..239956198afc --- /dev/null +++ b/app-arch/cfv/cfv-3.0.0.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +# Tests fail with pypy3 as of PyPy 7.3.9 / Python 3.9.12 +PYTHON_COMPAT=( python3_{10..12} ) + +inherit distutils-r1 optfeature + +DESCRIPTION="Command-line File Verify - versatile file checksum creator and verifier" +HOMEPAGE="https://github.com/cfv-project/cfv/" +# Tests aren't included in PyPI tarballs +SRC_URI="https://github.com/cfv-project/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + test? ( + app-arch/cksfv + ) +" + +PATCHES=( + # Backported from https://github.com/cfv-project/cfv/commit/5259bcbe3434c6974f7a65cc435dd0b4cfc3f864 + "${FILESDIR}/${P}-fix-removed-assertequal.patch" + # See https://github.com/cfv-project/cfv/pull/53 + "${FILESDIR}/${P}-fix-removed-imp.patch" +) + +python_prepare_all() { + # Remove upstream's attempt to install the man page + sed -i '/\sdata_files=/d' setup.py || die + distutils-r1_python_prepare_all +} + +python_test() { + # In order to run integration tests in addition to unit tests, we can't + # just rely on pytest here, we need to use upstream's runner. + "${EPYTHON}" "test/test.py" || die "Tests failed with ${EPYTHON}" +} + +python_install_all() { + distutils-r1_python_install_all + doman cfv.1 +} + +pkg_postinst() { + optfeature "the dimension column of JPEG Sheriff crc files" dev-python/pillow +} diff --git a/app-arch/cfv/cfv-3.1.0.ebuild b/app-arch/cfv/cfv-3.1.0.ebuild new file mode 100644 index 000000000000..90b1af6f41c1 --- /dev/null +++ b/app-arch/cfv/cfv-3.1.0.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +# Tests fail with pypy3 as of PyPy 7.3.16 / Python 3.10.14 +PYTHON_COMPAT=( python3_{10..13} ) + +inherit distutils-r1 optfeature + +DESCRIPTION="Command-line File Verify - versatile file checksum creator and verifier" +HOMEPAGE="https://github.com/cfv-project/cfv/" +# Tests aren't included in PyPI tarballs +SRC_URI="https://github.com/cfv-project/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + test? ( + app-arch/cksfv + ) +" + +python_prepare_all() { + # Remove upstream's attempt to install the man page + sed -i '/\sdata_files=/d' setup.py || die + distutils-r1_python_prepare_all +} + +python_test() { + # In order to run integration tests in addition to unit tests, we can't + # just rely on pytest here, we need to use upstream's runner. + "${EPYTHON}" "test/test.py" || die "Tests failed with ${EPYTHON}" +} + +python_install_all() { + distutils-r1_python_install_all + doman cfv.1 +} + +pkg_postinst() { + optfeature "the dimension column of JPEG Sheriff crc files" dev-python/pillow +} diff --git a/app-arch/cfv/files/cfv-3.0.0-fix-removed-assertequal.patch b/app-arch/cfv/files/cfv-3.0.0-fix-removed-assertequal.patch new file mode 100644 index 000000000000..aa7820d03a92 --- /dev/null +++ b/app-arch/cfv/files/cfv-3.0.0-fix-removed-assertequal.patch @@ -0,0 +1,39 @@ +commit 5259bcbe3434c6974f7a65cc435dd0b4cfc3f864 +Author: Louis Sautier <sautier.louis@gmail.com> +Date: Tue Nov 1 15:48:21 2022 +0100 + + tests: use assertEqual instead of assertEquals + + The latter is deprecated and causes warnings when running tests. + +--- a/test/test_caching.py ++++ b/test/test_caching.py +@@ -136,18 +136,18 @@ class RelPathKeyTest(RelTestCase): + self.mkfile('aAaA/Aaa2', '2') + self.mkfile('aAaA/AAa2', '3') + +- self.assertEquals(a1, cache.nocase_findfile(self.mkpath('aaAA/aaa1'))) ++ self.assertEqual(a1, cache.nocase_findfile(self.mkpath('aaAA/aaa1'))) + with self.assertRaises(IOError) as cm: + cache.nocase_findfile(self.mkpath('aaAb/aaa1')) +- self.assertEquals(errno.ENOENT, cm.exception.errno) ++ self.assertEqual(errno.ENOENT, cm.exception.errno) + + with self.assertRaises(IOError) as cm: + cache.nocase_findfile(self.mkpath('aaAA/aab1')) +- self.assertEquals(errno.ENOENT, cm.exception.errno) ++ self.assertEqual(errno.ENOENT, cm.exception.errno) + + with self.assertRaises(IOError) as cm: + cache.nocase_findfile(self.mkpath('aaAA/aaa2')) +- self.assertEquals(errno.EEXIST, cm.exception.errno) ++ self.assertEqual(errno.EEXIST, cm.exception.errno) + + def test_nocase_findfile_parent(self): + cache = FileInfoCache() +@@ -159,4 +159,4 @@ class RelPathKeyTest(RelTestCase): + # one. + with self.assertRaises(IOError) as cm: + cache.nocase_findfile(self.mkpath('aaAA/aaa2')) +- self.assertEquals(errno.EEXIST, cm.exception.errno) ++ self.assertEqual(errno.EEXIST, cm.exception.errno) diff --git a/app-arch/cfv/files/cfv-3.0.0-fix-removed-imp.patch b/app-arch/cfv/files/cfv-3.0.0-fix-removed-imp.patch new file mode 100644 index 000000000000..d4fa6e9aeb29 --- /dev/null +++ b/app-arch/cfv/files/cfv-3.0.0-fix-removed-imp.patch @@ -0,0 +1,39 @@ +commit ecf720058f63930d53075584a59cf42e035347eb +Author: Louis Sautier <sautier.louis@gmail.com> +Date: Sun May 12 15:44:26 2024 +0200 + + Fix tests for Python 3.12: remove "imp", fixes #21, #44 + + The "imp" module was removed in Python 3.12. + The replacement functions were added in Python 3.5, see + https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_file_location + https://docs.python.org/3/library/importlib.html#importlib.util.module_from_spec + +--- a/test/cfvtest.py ++++ b/test/cfvtest.py +@@ -23,8 +23,8 @@ from builtins import map + from builtins import object + + import fnmatch +-import imp + import importlib ++import importlib.util + import os + import shlex + import sys +@@ -201,8 +201,14 @@ def setcfv(fn=None, internal=None): + cfv_compiled = compile(_cfv_code, cfvfn, 'exec') + + with open(cfvfn, 'rt') as f: ++ # For spec_from_file_location to accept a file without the .py suffix ("cfv") ++ importlib.machinery.SOURCE_SUFFIXES.append('') ++ spec = importlib.util.spec_from_file_location('cfvwrapper', cfvfn) ++ module = importlib.util.module_from_spec(spec) + # This is so that the sys.path modification of the wrapper (if it has one) will be executed.. +- imp.load_source('cfvwrapper', cfvfn, f) ++ spec.loader.exec_module(module) ++ # Restore SOURCE_SUFFIXES to its default value ++ importlib.machinery.SOURCE_SUFFIXES.pop() + + get_version_flags() + diff --git a/app-arch/cfv/metadata.xml b/app-arch/cfv/metadata.xml new file mode 100644 index 000000000000..373591c9c7a7 --- /dev/null +++ b/app-arch/cfv/metadata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>sbraz@gentoo.org</email> + <name>Louis Sautier</name> + </maintainer> + <longdescription> + cfv is a utility to test and create a wide range of checksum + verification files. It currently supports testing and creating sfv, + sfvmd5, csv, csv2, csv4, md5, bsdmd5, sha1, sha224, sha256, sha384, + sha512, torrent and crc files. Test-only support is available for par, + par2. + </longdescription> + <upstream> + <remote-id type="pypi">cfv</remote-id> + <remote-id type="github">cfv-project/cfv</remote-id> + <bugs-to>https://github.com/cfv-project/cfv/issues</bugs-to> + </upstream> +</pkgmetadata> |