From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 582251581C1 for ; Sat, 13 Jul 2024 19:34:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 97AF62BC024; Sat, 13 Jul 2024 19:34:32 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 73B022BC024 for ; Sat, 13 Jul 2024 19:34:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 507A734302F for ; Sat, 13 Jul 2024 19:34:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AC41C1869 for ; Sat, 13 Jul 2024 19:34:29 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1720899229.f609a7e96fd9e8ed1b5ce28bf5ea6d47d8934c4d.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/zstandard/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/zstandard/zstandard-0.22.0-r1.ebuild X-VCS-Directories: dev-python/zstandard/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: f609a7e96fd9e8ed1b5ce28bf5ea6d47d8934c4d X-VCS-Branch: master Date: Sat, 13 Jul 2024 19:34:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7d9f662e-ffb4-4b2e-8e86-d8104d8088ce X-Archives-Hash: 63cfb367e60be3acd382dd5ed185416f commit: f609a7e96fd9e8ed1b5ce28bf5ea6d47d8934c4d Author: Michał Górny gentoo org> AuthorDate: Sat Jul 13 19:33:49 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Jul 13 19:33:49 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f609a7e9 dev-python/zstandard: Fix unbundling Thanks to Sam James for figuring the problem out. Bug: https://bugs.gentoo.org/935342 Signed-off-by: Michał Górny gentoo.org> dev-python/zstandard/zstandard-0.22.0-r1.ebuild | 80 +++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/dev-python/zstandard/zstandard-0.22.0-r1.ebuild b/dev-python/zstandard/zstandard-0.22.0-r1.ebuild new file mode 100644 index 000000000000..ef506d368106 --- /dev/null +++ b/dev-python/zstandard/zstandard-0.22.0-r1.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..13} pypy3 ) + +inherit distutils-r1 + +MY_P=python-zstandard-${PV} +DESCRIPTION="Zstandard Bindings for Python" +HOMEPAGE=" + https://github.com/indygreg/python-zstandard/ + https://pypi.org/project/zstandard/ +" +SRC_URI=" + https://github.com/indygreg/python-zstandard/archive/${PV}.tar.gz + -> ${MY_P}.gh.tar.gz +" +S=${WORKDIR}/${MY_P} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" + +DEPEND=" + app-arch/zstd:= +" +RDEPEND=" + ${DEPEND} + $(python_gen_cond_dep ' + >=dev-python/cffi-1.14.0-r2:=[${PYTHON_USEDEP}] + ' 'python*') +" +BDEPEND=" + test? ( + dev-python/hypothesis[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +src_prepare() { + local PATCHES=( + "${FILESDIR}/${P}-build.patch" + ) + + # the C backend is repeatedly broken, so force CFFI instead + sed -e '/PYTHON_ZSTANDARD_IMPORT_POLICY/s:default:cffi:' \ + -i zstandard/__init__.py || die + # unbundle zstd + rm zstd/* || die + > zstd/zstd.c || die + # it does random preprocessing on that, so we can't use #include + local f + for f in zdict.h zstd.h; do + cp "${ESYSROOT}/usr/include/${f}" "zstd/${f}" || die + done + sed -i -e '/include_dirs/a libraries=["zstd"],' make_cffi.py || die + + distutils-r1_src_prepare + + DISTUTILS_ARGS=( + --no-c-backend + ) +} + +python_test() { + local EPYTEST_DESELECT=( + # unreliable, fails on x86 + tests/test_data_structures.py::TestCompressionParameters::test_estimated_compression_context_size + # check for bundled zstd version, fails on other system zstd + tests/test_module_attributes.py::TestModuleAttributes::test_version + ) + + rm -rf zstandard || die + epytest +}