summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-05-26 18:13:29 -0700
committerZac Medico <zmedico@gentoo.org>2024-05-26 18:28:21 -0700
commit9ff0500ed4acebfd185d570d48fe3a0bc79a2490 (patch)
tree0f346c0981193e5cb31ad74b492da2a244e60f8f /app-misc
parentapp-misc/yq-go: new package, add 4.44.1 (diff)
downloadgentoo-9ff0500ed4acebfd185d570d48fe3a0bc79a2490.tar.gz
gentoo-9ff0500ed4acebfd185d570d48fe3a0bc79a2490.tar.bz2
gentoo-9ff0500ed4acebfd185d570d48fe3a0bc79a2490.zip
app-misc/yq: add 3.4.3
Also rename the yq command to yq-python and add a yk-symlink USE flag enabled by default (app-misc/yk-go has a similar yk-symlink USE flag which both packages cannot enable simultaneously). Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/yq/Manifest1
-rw-r--r--app-misc/yq/metadata.xml5
-rw-r--r--app-misc/yq/yq-3.4.3.ebuild74
3 files changed, 80 insertions, 0 deletions
diff --git a/app-misc/yq/Manifest b/app-misc/yq/Manifest
index b03c821e4f0c..ec8f3754e3ca 100644
--- a/app-misc/yq/Manifest
+++ b/app-misc/yq/Manifest
@@ -1,3 +1,4 @@
DIST yq-3.2.2.tar.gz 30872 BLAKE2B 4386a7972b411159ed909ccdc7c32a878d064ac5101cbddb16b0f1efe37c3791aeefda3b7c18c94e7d79fb01a4a4b43f7fbcc7c55bd275c52e08cc069523c8d3 SHA512 4472006d6997f7d620f71ade53d31e6db4051414c147db4f14cb31e0a16a0d0faf9e5c5a682cec098146bfd4e29f9e62278e4f208487e9e194d317ee82823e60
DIST yq-3.2.3.tar.gz 31952 BLAKE2B b0c4548efa08aecc98b77b5988e5dbf652951ecfab3ab01bfbf9610151cee3c3a0b9c3139434cba3bfc08a2176a617a2c9d19c0fcf47bb8a6d3cc3886fa5de6d SHA512 8b60907536b5f3ae7c18dc157ed8ccf4632f2734803711a18b71111fbd6e6efff24ddc9c2221fb926ca99bf538c3bba14517529e6edb37bc487fb69441ad7928
DIST yq-3.4.1.tar.gz 32876 BLAKE2B 628fbb62de0c2f138133444c2f371819f920ac3d7c89787b96cb2de59eaa49f1324227d53f6d33e29dd9a9a804283339b34d87851c6f32a16a1cc94a7451a726 SHA512 d11290d44eefeae23a8e5fe3f536f714ee532a5aa1636c949a9db3e89bdf5ad5480ba5f8d6e809fa06a245de5e671844233ed64eb609e49fa3de8813ab9556cc
+DIST yq-3.4.3.tar.gz 33214 BLAKE2B a1b3d813d9761ac8a8429db3fe8efac64ade69e0d2fa9b137a1ca8c9e367a0f16b636482b6d9381e2de43392007f37388b6ab37def04739723488f271fd56d16 SHA512 db4ec57aafa1d08786ba11897040506c9f13d800cf06f76cea052d2bba88553db53627cdfcfdbbfbdec81324800114d397890759383fb4db31609727a10474eb
diff --git a/app-misc/yq/metadata.xml b/app-misc/yq/metadata.xml
index 668d57252e5d..e1ba38d97faf 100644
--- a/app-misc/yq/metadata.xml
+++ b/app-misc/yq/metadata.xml
@@ -12,4 +12,9 @@
<email>chutzpah@gentoo.org</email>
<name>Patrick McLean</name>
</maintainer>
+ <use>
+ <flag name="yq-symlink">
+ Create a yq symlink to yq-python.
+ </flag>
+ </use>
</pkgmetadata>
diff --git a/app-misc/yq/yq-3.4.3.ebuild b/app-misc/yq/yq-3.4.3.ebuild
new file mode 100644
index 000000000000..47a37a5e577e
--- /dev/null
+++ b/app-misc/yq/yq-3.4.3.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..13} pypy3 )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit pypi distutils-r1
+
+DESCRIPTION="Command-line YAML processor - jq wrapper for YAML documents"
+HOMEPAGE="
+ https://yq.readthedocs.io/
+ https://github.com/kislyuk/yq/
+ https://pypi.org/project/yq/
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test +yq-symlink"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ app-misc/jq
+ dev-python/argcomplete[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-5.3.1[${PYTHON_USEDEP}]
+ dev-python/xmltodict[${PYTHON_USEDEP}]
+ >=dev-python/tomlkit-0.11.6[${PYTHON_USEDEP}]
+ yq-symlink? ( !app-misc/yq-go[yq-symlink] )
+"
+DEPEND="
+ ${RDEPEND}
+ test? (
+ dev-python/wheel[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/yq-3.1.2-test.patch"
+)
+
+python_prepare_all() {
+ cat <<-\EOF > "${T}"/yq-python.patch
+ --- setup.py
+ +++ setup.py
+ @@ -37 +37 @@
+ - "console_scripts": ["yq=yq:cli", "xq=yq:xq_cli", "tomlq=yq:tq_cli"],
+ + "console_scripts": ["yq-python=yq:cli", "xq=yq:xq_cli", "tomlq=yq:tq_cli"],
+ EOF
+
+ eapply -p0 "${T}"/yq-python.patch
+
+ sed -e 's:unittest.main():unittest.main(verbosity=2):' \
+ -i test/test.py || die
+
+ sed -r -e 's:[[:space:]]*"coverage",:: ; s:[[:space:]]*"flake8",::' \
+ -i setup.py || die
+
+ sed -e '/license_file/ d' -i setup.cfg || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ "${EPYTHON}" test/test.py </dev/null || die "tests failed under ${EPYTHON}"
+}
+
+src_install() {
+ distutils-r1_src_install
+ if use yq-symlink; then
+ dosym yq-python /usr/bin/yq
+ fi
+}