From 1ded7e71224824bc15e9f322ca094e40330ddd4b Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 24 Apr 2025 20:36:25 +0100 Subject: [PATCH] dev-util/pkgcruft: add 0.0.13 Signed-off-by: Sam James --- dev-util/pkgcruft/Manifest | 1 + dev-util/pkgcruft/pkgcruft-0.0.13.ebuild | 126 +++++++++++++++++++++++ dev-util/pkgcruft/pkgcruft-9999.ebuild | 10 +- 3 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 dev-util/pkgcruft/pkgcruft-0.0.13.ebuild diff --git a/dev-util/pkgcruft/Manifest b/dev-util/pkgcruft/Manifest index b6eb1848bc020..3e998eb46a04b 100644 --- a/dev-util/pkgcruft/Manifest +++ b/dev-util/pkgcruft/Manifest @@ -1,3 +1,4 @@ DIST pkgcruft-0.0.10.tar.xz 32193612 BLAKE2B d0f28f63e0b4f1d1309156309331feb0daa0cd52c6f0491f918d49f76c425b36a47fd02060554cd4398ac3490d6e21009b7421cb0ca14a821093fca7f57087bc SHA512 14812be27345a737d91281c869bc8149581bf3802b3bddca19908bfb687013cd1ee751213e86c7c277850f07eff2b58358930c74cbe2e3f4b370929de518097e DIST pkgcruft-0.0.11.tar.xz 40812256 BLAKE2B 6afbc3750d99d715a01d644413b4e5c407d902cbb1761b5017dae0cf5b868a48f6fe5a8ee845bb8e4484cc9ea154d954afc85cd81d53480eee1233598a07a044 SHA512 b4ba070b811e1a94795bd8e90452b4e2db6fba53a563b828c8f8c6b938727ed6aff35e969c88a22b961ded1bd51847f52f1d285863a27b76715fe1ec72979934 DIST pkgcruft-0.0.12.tar.xz 41392836 BLAKE2B 0d04f3451b87f3e888bd471b8b06248b68e6929ace6922f01e4ba5e010e9b0a91ff4c94d4629a473dec6ae5229507dab216f98c02b4a47f454c75098543b0b13 SHA512 17542836ec659703f02a92c5afbd297006db8d3a58cb8b51d876f47592a0a155d85acf2a9661055f42d301d10806d3d30ed658cf4a20aa8748fd9f85222d353a +DIST pkgcruft-0.0.13.tar.xz 30200436 BLAKE2B 85ed531a79d4261c65dcda41d6a238398fb36b8e93c1698444b866f6c930544bf19c85046ad9ab651bd0f5460ad174b47d468274de169a458083198b084205e2 SHA512 d53713d0f14d965e3b069fe2902af9aac1fac56b565e93b502c081adf0ada99336a43f5af697ec522ce4e6d49eff5b1fb20c375ffa90dcf417ae396c2dc81c2b diff --git a/dev-util/pkgcruft/pkgcruft-0.0.13.ebuild b/dev-util/pkgcruft/pkgcruft-0.0.13.ebuild new file mode 100644 index 0000000000000..66c1aeee62447 --- /dev/null +++ b/dev-util/pkgcruft/pkgcruft-0.0.13.ebuild @@ -0,0 +1,126 @@ +# Copyright 2023-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" " +LLVM_COMPAT=( {17..19} ) +RUST_MIN_VER="1.84.0" + +inherit cargo edo llvm-r2 multiprocessing shell-completion toolchain-funcs + +DESCRIPTION="QA library and tools based on pkgcraft" +HOMEPAGE="https://pkgcraft.github.io/" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/pkgcraft/pkgcraft" + inherit git-r3 + + S="${WORKDIR}"/${P}/crates/${PN} +else + SRC_URI="https://github.com/pkgcraft/pkgcraft/releases/download/${P}/${P}.tar.xz" + + KEYWORDS="~amd64" +fi + +LICENSE="MIT" +# Dependent crate licenses +LICENSE+=" + Apache-2.0 BSD-2 BSD CC0-1.0 GPL-3+ ISC MIT MPL-2.0 Unicode-DFS-2016 +" +SLOT="0" +IUSE="test" +RESTRICT="!test? ( test )" + +# clang needed for bindgen +BDEPEND+=" + $(llvm_gen_dep ' + llvm-core/clang:${LLVM_SLOT} + ') + test? ( dev-util/cargo-nextest ) +" + +QA_FLAGS_IGNORED="usr/bin/pkgcruft" + +pkg_setup() { + llvm-r2_pkg_setup + rust_pkg_setup +} + +src_unpack() { + if [[ ${PV} == 9999 ]] ; then + git-r3_src_unpack + cargo_live_src_unpack + else + cargo_src_unpack + fi +} + +src_compile() { + # For scallop building bash + tc-export AR CC + + cargo_src_compile + + if [[ ${PV} == 9999 ]] ; then + einfo "Generating shell completions" + mkdir shell || die + local BIN="${WORKDIR}/${P}/$(cargo_target_dir)/pkgcruft" + "${BIN}" completion bash > shell/pkgcruft.bash || die + "${BIN}" completion zsh > shell/_pkgcruft || die + "${BIN}" completion fish > shell/pkgcruft.fish || die + fi +} + +src_test() { + unset CLICOLOR CLICOLOR_FORCE + + # TODO: Maybe move into eclass (and maybe have a cargo_enable_tests + # helper) + local -x NEXTEST_TEST_THREADS="$(makeopts_jobs)" + + # The test failures appear ebuild-related + edo cargo nextest run $(usev !debug '--release') \ + --color always \ + --all-features \ + --tests \ + --no-fail-fast \ + -- \ + --skip 'commands::tests::check' \ + --skip 'dependency::tests::check' \ + --skip 'dependency_slot_missing::tests::check' \ + --skip 'eapi_stale::tests::check' \ + --skip 'eapi_status::tests::check' \ + --skip 'ebuild_name::tests::check' \ + --skip 'eclass::tests::check' \ + --skip 'filesdir::tests::check' \ + --skip 'header::tests::check' \ + --skip 'homepage::tests::check' \ + --skip 'ignore::tests::check' \ + --skip 'iuse::tests::check' \ + --skip 'keywords::tests::check' \ + --skip 'keywords_dropped::tests::check' \ + --skip 'license::tests::check' \ + --skip 'live::tests::check' \ + --skip 'manifest::tests::check' \ + --skip 'metadata::tests::check' \ + --skip 'properties::tests::check' \ + --skip 'python_update::tests::check' \ + --skip 'repo_layout::tests::check' \ + --skip 'restrict::tests::check' \ + --skip 'restrict_test_missing::tests::check' \ + --skip 'ruby_update::tests::check' \ + --skip 'src_uri::tests::check' \ + --skip 'unstable_only::tests::check' \ + --skip 'use_local::tests::check' \ + --skip 'variable_order::tests::check' \ + --skip 'whitespace::tests::check' +} + +src_install() { + cargo_src_install + + newbashcomp shell/pkgcruft.bash pkgcruft + dozshcomp shell/_pkgcruft + dofishcomp shell/pkgcruft.fish +} diff --git a/dev-util/pkgcruft/pkgcruft-9999.ebuild b/dev-util/pkgcruft/pkgcruft-9999.ebuild index dff52cd906d4d..66c1aeee62447 100644 --- a/dev-util/pkgcruft/pkgcruft-9999.ebuild +++ b/dev-util/pkgcruft/pkgcruft-9999.ebuild @@ -63,8 +63,12 @@ src_compile() { cargo_src_compile if [[ ${PV} == 9999 ]] ; then - # https://github.com/pkgcraft/pkgcraft/issues/258 - edo cargo run --features shell --bin pkgcruft-shell-comp -p pkgcruft + einfo "Generating shell completions" + mkdir shell || die + local BIN="${WORKDIR}/${P}/$(cargo_target_dir)/pkgcruft" + "${BIN}" completion bash > shell/pkgcruft.bash || die + "${BIN}" completion zsh > shell/_pkgcruft || die + "${BIN}" completion fish > shell/pkgcruft.fish || die fi } @@ -116,7 +120,7 @@ src_test() { src_install() { cargo_src_install - newbashcomp shell/pkgcruft.bash ${PN} + newbashcomp shell/pkgcruft.bash pkgcruft dozshcomp shell/_pkgcruft dofishcomp shell/pkgcruft.fish }