Diff App-cpanminus-1.704.700 with a App-cpanminus-9999

/usr/portage/dev-perl/App-cpanminus/App-cpanminus-9999.ebuild 2023-10-09 14:52:29.816368358 +0300
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2020 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=8
4
EAPI=7
5 5

  
6
DIST_AUTHOR=MIYAGAWA
7
DIST_VERSION=1.7047
8
inherit perl-module
6
if [[ ${PV} == 9999 ]]; then
7
	GITHUB_USER=miyagawa
8
	GITHUB_REPO=cpanminus
9
	EGIT_REPO_URI="https://github.com/${GITHUB_USER}/${GITHUB_REPO}.git"
10
	EGIT_BRANCH="devel"
11
	EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}-git"
12
	VCS_ECLASS="git-r3"
13
else
14
	DIST_AUTHOR=MIYAGAWA
15
	DIST_VERSION=1.7044
16
	KEYWORDS="amd64 ~ppc x86"
17
fi
18
inherit perl-module ${VCS_ECLASS}
9 19

  
10 20
DESCRIPTION="Get, unpack, build and install modules from CPAN"
11

  
12 21
SLOT="0"
13
KEYWORDS="amd64 ~arm64 ~ppc ~riscv x86"
22
IUSE="test"
23
RESTRICT="!test? ( test )"
24

  
25
GIT_DEPENDS="
26
	dev-perl/Dist-Milla
27
	dev-perl/Dist-Zilla
28
	dev-perl/Dist-Zilla-Plugin-Run
29
	dev-perl/Perl-Version
30
	dev-perl/App-FatPacker
31
	dev-perl/Module-Install
32
	dev-perl/Module-Signature
33
	dev-perl/Perl-Strip
34
"
35
BDEPEND="${RDEPEND}
36
	virtual/perl-ExtUtils-MakeMaker
37
	test? ( virtual/perl-Test-Simple )
38
"
39
[[ ${PV} == 9999 ]] && BDEPEND+=" ${GIT_DEPENDS}"
40

  
41
dzil_env_setup() {
42
	# NextRelease noise :(
43
	mkdir -p ~/.dzil/
44
	local user="$(whoami)"
45
	local host="$(hostname)"
46
	printf '[%%User]\nname = %s\nemail = %s' "${user}" "${user}@${host}" >> ~/.dzil/config.ini
47
}
48
dzil_to_distdir() {
49
	local dzil_root dest has_missing modname dzil_version
50
	dzil_root="$1"
51
	dest="$2"
52

  
53
	cd "${dzil_root}" || die "Can't enter git workdir '${dzil_root}'";
54

  
55
	dzil_env_setup
56

  
57
	dzil_version="$(dzil version)" || die "Error invoking 'dzil version'"
58
	einfo "Generating CPAN dist with ${dzil_version}"
59

  
60
	has_missing=""
61

  
62
	einfo "Checking dzil authordeps"
63
	while IFS= read -d $'\n' -r modname; do
64
		if [[ -z "${has_missing}" ]]; then
65
		has_missing=1
66
			eerror "'dzil authordeps' indicates missing build dependencies"
67
			eerror "These will prevent building, please report a bug"
68
			eerror "Missing:"
69
		fi
70
		eerror "  ${modname}"
71
	done < <( dzil authordeps --missing --versions )
72

  
73
	[[ -z "${has_missing}" ]] || die "Satisfy all missing authordeps first"
74

  
75
	einfo "Checking dzil build deps"
76
	while IFS= read -d $'\n' -r modname; do
77
		if [[ -z "${has_missing}" ]]; then
78
			has_missing=1
79
			ewarn "'dzil listdeps' indicates missing build dependencies"
80
			ewarn "These may prevent building, please report a bug if they do"
81
			ewarn "Missing:"
82
		fi
83
		ewarn "  ${modname}"
84
	done < <( dzil listdeps --missing --versions --author )
85

  
86
	einfo "Generating release"
87
	dzil build --notgz --in "${dest}" || die "Unable to build CPAN dist in '${dest}'"
88
}
89

  
90
src_unpack() {
91
	if [[ ${PV} == 9999 ]]; then
92
		"${VCS_ECLASS}"_src_unpack
93
		mkdir -p "${S}" || die "Can't make ${S}"
94
	else
95
		default
96
	fi
97
}
98

  
99
src_prepare() {
100
	if [[ ${PV} == 9999 ]]; then
101
		# Uses git sources in WORKDIR/rex-git
102
		# to generate a CPAN-style tree in ${S}
103
		# before letting perl-module.eclass do the rest
104
		dzil_to_distdir "${EGIT_CHECKOUT_DIR}/App-cpanminus" "${S}"
105
	fi
106
	cd "${S}" || die "Can't enter build dir"
107
	perl-module_src_prepare
108
}
Thank you!