commit:     3ea2ae77ab9a78b3b51db183de5717880d5195e9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 23 18:24:45 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 23 18:24:45 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ea2ae77

dev-util/pkgcruft: unbundle sys-libs/scallop, sync with ::pkgcraft-overlay

Imported from ::pkgcraft-overlay [0] at commit 
5ac6edab4885f6c5937db6f0a7183c341cc7501b.

Two deviations:
* Retained --release for src_test for now at least
  
(https://github.com/pkgcraft/pkgcraft-overlay/commit/3a98748b8886b1b11dc7a5a357cbc116e6ab8ce4#commitcomment-173409331)

* Kept `unset CLICOLOR*` as I still get test failures without it, but
  add a comment indicating which.

  I haven't yet filed a bug about this upstream as I see it as not particularly
  important and something self-inflcted.

[0] https://github.com/pkgcraft/pkgcraft-overlay

Co-authored-by: Tim Harder <radhermit <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...cruft-9999.ebuild => pkgcruft-0.0.18-r1.ebuild} | 51 ++++++++++++----------
 dev-util/pkgcruft/pkgcruft-9999.ebuild             | 51 ++++++++++++----------
 2 files changed, 54 insertions(+), 48 deletions(-)

diff --git a/dev-util/pkgcruft/pkgcruft-9999.ebuild 
b/dev-util/pkgcruft/pkgcruft-0.0.18-r1.ebuild
similarity index 52%
copy from dev-util/pkgcruft/pkgcruft-9999.ebuild
copy to dev-util/pkgcruft/pkgcruft-0.0.18-r1.ebuild
index be85423ae41e..0bc19b4a49cc 100644
--- a/dev-util/pkgcruft/pkgcruft-9999.ebuild
+++ b/dev-util/pkgcruft/pkgcruft-0.0.18-r1.ebuild
@@ -3,28 +3,32 @@
 
 EAPI=8
 
-CRATES=" "
-LLVM_COMPAT=( {17..21} )
+LLVM_COMPAT=( {19..21} )
 RUST_MIN_VER="1.90.0"
 
-inherit cargo edo llvm-r2 multiprocessing shell-completion toolchain-funcs
+inherit cargo edo multiprocessing llvm-r2 shell-completion
 
 DESCRIPTION="QA library and tools based on pkgcraft"
 HOMEPAGE="https://pkgcraft.github.io/";
 
 if [[ ${PV} == 9999 ]] ; then
+       SCALLOP_VERSION="9999"
        EGIT_REPO_URI="https://github.com/pkgcraft/pkgcraft";
        inherit git-r3
-
        S="${WORKDIR}"/${P}/crates/${PN}
 else
+       # For releases, SCALLOP_VERSION must match the value of PACKAGE_VERSION 
in
+       # the vendored library's configure script.
+       #
+       # To get the value from the repo use the following command:
+       # sed -rn "/^PACKAGE_VERSION=/ s/^.*='(.*)'/\1/p" 
**/scallop/bash/configure
+       SCALLOP_VERSION="5.3.9.20251212"
        
SRC_URI="https://github.com/pkgcraft/pkgcraft/releases/download/${P}/${P}.tar.xz";
-
        KEYWORDS="~amd64"
 fi
 
 LICENSE="MIT"
-# Dependent crate licenses
+# dependent crate licenses
 LICENSE+="
        Apache-2.0 BSD-2 BSD CC0-1.0 CDLA-Permissive-2.0 ISC MIT MPL-2.0
 "
@@ -32,11 +36,15 @@ SLOT="0"
 IUSE="test"
 RESTRICT="!test? ( test )"
 
-# clang needed for bindgen
-BDEPEND+="
-       $(llvm_gen_dep '
-               llvm-core/clang:${LLVM_SLOT}
-       ')
+# Strict dependency versioning is required since the system library must match
+# the vendored copy as scallop exports many parts of bash that aren't meant to
+# be a public interface and compatibility is not guaranteed between releases.
+RDEPEND="~sys-libs/scallop-${SCALLOP_VERSION}"
+DEPEND="${RDEPEND}"
+# clang needed by bindgen to generate bash bindings
+BDEPEND="
+       virtual/pkgconfig
+       $(llvm_gen_dep 'llvm-core/clang:${LLVM_SLOT}')
        test? ( dev-util/cargo-nextest )
 "
 
@@ -45,6 +53,9 @@ QA_FLAGS_IGNORED="usr/bin/pkgcruft"
 pkg_setup() {
        llvm-r2_pkg_setup
        rust_pkg_setup
+
+       # use system scallop library
+       export SCALLOP_NO_VENDOR=1
 }
 
 src_unpack() {
@@ -57,33 +68,25 @@ src_unpack() {
 }
 
 src_compile() {
-       # For scallop building bash
-       # TODO: Package scallop
-       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
+               "${BIN}" completion --dir shell || die
        fi
 }
 
 src_test() {
+       # FAIL [   0.148s] pkgcruft::pkgcruft diff::output
+       # FAIL [   0.018s] pkgcruft::pkgcruft show::reports::all
+       # FAIL [   0.045s] pkgcruft::pkgcruft show::reports::sets
        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') \
+       edo ${CARGO} nextest run $(usev !debug '--release') \
                --color always \
-               --all-features \
                --tests \
                --no-fail-fast
 }

diff --git a/dev-util/pkgcruft/pkgcruft-9999.ebuild 
b/dev-util/pkgcruft/pkgcruft-9999.ebuild
index be85423ae41e..0bc19b4a49cc 100644
--- a/dev-util/pkgcruft/pkgcruft-9999.ebuild
+++ b/dev-util/pkgcruft/pkgcruft-9999.ebuild
@@ -3,28 +3,32 @@
 
 EAPI=8
 
-CRATES=" "
-LLVM_COMPAT=( {17..21} )
+LLVM_COMPAT=( {19..21} )
 RUST_MIN_VER="1.90.0"
 
-inherit cargo edo llvm-r2 multiprocessing shell-completion toolchain-funcs
+inherit cargo edo multiprocessing llvm-r2 shell-completion
 
 DESCRIPTION="QA library and tools based on pkgcraft"
 HOMEPAGE="https://pkgcraft.github.io/";
 
 if [[ ${PV} == 9999 ]] ; then
+       SCALLOP_VERSION="9999"
        EGIT_REPO_URI="https://github.com/pkgcraft/pkgcraft";
        inherit git-r3
-
        S="${WORKDIR}"/${P}/crates/${PN}
 else
+       # For releases, SCALLOP_VERSION must match the value of PACKAGE_VERSION 
in
+       # the vendored library's configure script.
+       #
+       # To get the value from the repo use the following command:
+       # sed -rn "/^PACKAGE_VERSION=/ s/^.*='(.*)'/\1/p" 
**/scallop/bash/configure
+       SCALLOP_VERSION="5.3.9.20251212"
        
SRC_URI="https://github.com/pkgcraft/pkgcraft/releases/download/${P}/${P}.tar.xz";
-
        KEYWORDS="~amd64"
 fi
 
 LICENSE="MIT"
-# Dependent crate licenses
+# dependent crate licenses
 LICENSE+="
        Apache-2.0 BSD-2 BSD CC0-1.0 CDLA-Permissive-2.0 ISC MIT MPL-2.0
 "
@@ -32,11 +36,15 @@ SLOT="0"
 IUSE="test"
 RESTRICT="!test? ( test )"
 
-# clang needed for bindgen
-BDEPEND+="
-       $(llvm_gen_dep '
-               llvm-core/clang:${LLVM_SLOT}
-       ')
+# Strict dependency versioning is required since the system library must match
+# the vendored copy as scallop exports many parts of bash that aren't meant to
+# be a public interface and compatibility is not guaranteed between releases.
+RDEPEND="~sys-libs/scallop-${SCALLOP_VERSION}"
+DEPEND="${RDEPEND}"
+# clang needed by bindgen to generate bash bindings
+BDEPEND="
+       virtual/pkgconfig
+       $(llvm_gen_dep 'llvm-core/clang:${LLVM_SLOT}')
        test? ( dev-util/cargo-nextest )
 "
 
@@ -45,6 +53,9 @@ QA_FLAGS_IGNORED="usr/bin/pkgcruft"
 pkg_setup() {
        llvm-r2_pkg_setup
        rust_pkg_setup
+
+       # use system scallop library
+       export SCALLOP_NO_VENDOR=1
 }
 
 src_unpack() {
@@ -57,33 +68,25 @@ src_unpack() {
 }
 
 src_compile() {
-       # For scallop building bash
-       # TODO: Package scallop
-       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
+               "${BIN}" completion --dir shell || die
        fi
 }
 
 src_test() {
+       # FAIL [   0.148s] pkgcruft::pkgcruft diff::output
+       # FAIL [   0.018s] pkgcruft::pkgcruft show::reports::all
+       # FAIL [   0.045s] pkgcruft::pkgcruft show::reports::sets
        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') \
+       edo ${CARGO} nextest run $(usev !debug '--release') \
                --color always \
-               --all-features \
                --tests \
                --no-fail-fast
 }

Reply via email to