1 |
commit: 9920419c734ebd89a9522abbe7d2e8982fad69e5 |
2 |
Author: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 3 14:46:42 2020 +0000 |
4 |
Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 3 14:49:40 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9920419c |
7 |
|
8 |
dev-perl/App-cpanminus: Add -9999 version |
9 |
|
10 |
This work is based on the existing work in app-admin/rex, as latest |
11 |
cpanm uses Dzil in its build chain. |
12 |
|
13 |
TODO: Provision fatlib entries *exclusively* from installed gentoo |
14 |
stuff, but that might be really tricky. |
15 |
|
16 |
What it currently does is fatpack bundled copies of upstream stuff |
17 |
|
18 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
19 |
Signed-off-by: Kent Fredric <kentnl <AT> gentoo.org> |
20 |
|
21 |
dev-perl/App-cpanminus/App-cpanminus-9999.ebuild | 108 +++++++++++++++++++++++ |
22 |
1 file changed, 108 insertions(+) |
23 |
|
24 |
diff --git a/dev-perl/App-cpanminus/App-cpanminus-9999.ebuild b/dev-perl/App-cpanminus/App-cpanminus-9999.ebuild |
25 |
new file mode 100644 |
26 |
index 00000000000..5c7c7bda4a0 |
27 |
--- /dev/null |
28 |
+++ b/dev-perl/App-cpanminus/App-cpanminus-9999.ebuild |
29 |
@@ -0,0 +1,108 @@ |
30 |
+# Copyright 1999-2020 Gentoo Authors |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=7 |
34 |
+ |
35 |
+if [[ ${PV} == 9999 ]]; then |
36 |
+ GITHUB_USER=miyagawa |
37 |
+ GITHUB_REPO=cpanminus |
38 |
+ EGIT_REPO_URI="https://github.com/${GITHUB_USER}/${GITHUB_REPO}.git" |
39 |
+ EGIT_BRANCH="devel" |
40 |
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}-git" |
41 |
+ VCS_ECLASS="git-r3" |
42 |
+else |
43 |
+ DIST_AUTHOR=MIYAGAWA |
44 |
+ DIST_VERSION=1.7044 |
45 |
+ KEYWORDS="amd64 ~ppc x86" |
46 |
+fi |
47 |
+inherit perl-module ${VCS_ECLASS} |
48 |
+ |
49 |
+DESCRIPTION="Get, unpack, build and install modules from CPAN" |
50 |
+SLOT="0" |
51 |
+IUSE="test" |
52 |
+RESTRICT="!test? ( test )" |
53 |
+ |
54 |
+GIT_DEPENDS=" |
55 |
+ dev-perl/Dist-Milla |
56 |
+ dev-perl/Dist-Zilla |
57 |
+ dev-perl/Dist-Zilla-Plugin-Run |
58 |
+ dev-perl/Perl-Version |
59 |
+ dev-perl/App-FatPacker |
60 |
+ dev-perl/Module-Install |
61 |
+ dev-perl/Module-Signature |
62 |
+ dev-perl/Perl-Strip |
63 |
+" |
64 |
+BDEPEND="${RDEPEND} |
65 |
+ virtual/perl-ExtUtils-MakeMaker |
66 |
+ test? ( virtual/perl-Test-Simple ) |
67 |
+" |
68 |
+[[ ${PV} == 9999 ]] && BDEPEND+=" ${GIT_DEPENDS}" |
69 |
+ |
70 |
+dzil_env_setup() { |
71 |
+ # NextRelease noise :( |
72 |
+ mkdir -p ~/.dzil/ |
73 |
+ local user="$(whoami)" |
74 |
+ local host="$(hostname)" |
75 |
+ printf '[%%User]\nname = %s\nemail = %s' "${user}" "${user}@${host}" >> ~/.dzil/config.ini |
76 |
+} |
77 |
+dzil_to_distdir() { |
78 |
+ local dzil_root dest has_missing modname dzil_version |
79 |
+ dzil_root="$1" |
80 |
+ dest="$2" |
81 |
+ |
82 |
+ cd "${dzil_root}" || die "Can't enter git workdir '${dzil_root}'"; |
83 |
+ |
84 |
+ dzil_env_setup |
85 |
+ |
86 |
+ dzil_version="$(dzil version)" || die "Error invoking 'dzil version'" |
87 |
+ einfo "Generating CPAN dist with ${dzil_version}" |
88 |
+ |
89 |
+ has_missing="" |
90 |
+ |
91 |
+ einfo "Checking dzil authordeps" |
92 |
+ while IFS= read -d $'\n' -r modname; do |
93 |
+ if [[ -z "${has_missing}" ]]; then |
94 |
+ has_missing=1 |
95 |
+ eerror "'dzil authordeps' indicates missing build dependencies" |
96 |
+ eerror "These will prevent building, please report a bug" |
97 |
+ eerror "Missing:" |
98 |
+ fi |
99 |
+ eerror " ${modname}" |
100 |
+ done < <( dzil authordeps --missing --versions ) |
101 |
+ |
102 |
+ [[ -z "${has_missing}" ]] || die "Satisfy all missing authordeps first" |
103 |
+ |
104 |
+ einfo "Checking dzil build deps" |
105 |
+ while IFS= read -d $'\n' -r modname; do |
106 |
+ if [[ -z "${has_missing}" ]]; then |
107 |
+ has_missing=1 |
108 |
+ ewarn "'dzil listdeps' indicates missing build dependencies" |
109 |
+ ewarn "These may prevent building, please report a bug if they do" |
110 |
+ ewarn "Missing:" |
111 |
+ fi |
112 |
+ ewarn " ${modname}" |
113 |
+ done < <( dzil listdeps --missing --versions --author ) |
114 |
+ |
115 |
+ einfo "Generating release" |
116 |
+ dzil build --notgz --in "${dest}" || die "Unable to build CPAN dist in '${dest}'" |
117 |
+} |
118 |
+ |
119 |
+src_unpack() { |
120 |
+ if [[ ${PV} == 9999 ]]; then |
121 |
+ "${VCS_ECLASS}"_src_unpack |
122 |
+ mkdir -p "${S}" || die "Can't make ${S}" |
123 |
+ else |
124 |
+ default |
125 |
+ fi |
126 |
+} |
127 |
+ |
128 |
+src_prepare() { |
129 |
+ if [[ ${PV} == 9999 ]]; then |
130 |
+ # Uses git sources in WORKDIR/rex-git |
131 |
+ # to generate a CPAN-style tree in ${S} |
132 |
+ # before letting perl-module.eclass do the rest |
133 |
+ dzil_to_distdir "${EGIT_CHECKOUT_DIR}/App-cpanminus" "${S}" |
134 |
+ fi |
135 |
+ cd "${S}" || die "Can't enter build dir" |
136 |
+ perl-module_src_prepare |
137 |
+} |