1 |
commit: 6083c01b19d77bff46f257539f918287c5f8139b |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 29 23:38:11 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 30 00:39:15 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6083c01b |
7 |
|
8 |
dev-php/theseer-Autoload: new package |
9 |
|
10 |
Package-Manager: Portage-3.0.10, Repoman-3.0.2 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
dev-php/theseer-Autoload/Manifest | 1 + |
14 |
dev-php/theseer-Autoload/files/autoload.php.tpl | 26 +++++++ |
15 |
dev-php/theseer-Autoload/files/fedora.php.tpl | 12 ++++ |
16 |
dev-php/theseer-Autoload/files/fedora2.php.tpl | 12 ++++ |
17 |
.../theseer-Autoload-1.26.0-autoload.php.patch | 12 ++++ |
18 |
dev-php/theseer-Autoload/metadata.xml | 11 +++ |
19 |
.../theseer-Autoload-1.26.0.ebuild | 82 ++++++++++++++++++++++ |
20 |
7 files changed, 156 insertions(+) |
21 |
|
22 |
diff --git a/dev-php/theseer-Autoload/Manifest b/dev-php/theseer-Autoload/Manifest |
23 |
new file mode 100644 |
24 |
index 00000000000..8317998a990 |
25 |
--- /dev/null |
26 |
+++ b/dev-php/theseer-Autoload/Manifest |
27 |
@@ -0,0 +1 @@ |
28 |
+DIST theseer-Autoload-1.26.0.tar.gz 43119 BLAKE2B 7b2413bc2fb281472cee03010c175aae1c8304ab0629c31f09e11497bd6f46d58bae8625da610f5a513b19fc8aafc45c35be7271ba13188466f576e7b4a7392f SHA512 c8fcb3ad39c140517d695c44e6dea3797ea0135ff64246478e55cbf167e4b9fbb3e5027732c201f66b404039a313952c7125f13fdeb1cd96633dbccfdda6f143 |
29 |
|
30 |
diff --git a/dev-php/theseer-Autoload/files/autoload.php.tpl b/dev-php/theseer-Autoload/files/autoload.php.tpl |
31 |
new file mode 100644 |
32 |
index 00000000000..cb88eb77c45 |
33 |
--- /dev/null |
34 |
+++ b/dev-php/theseer-Autoload/files/autoload.php.tpl |
35 |
@@ -0,0 +1,26 @@ |
36 |
+<?php |
37 |
+ |
38 |
+require_once 'TheSeer/DirectoryScanner/autoload.php'; |
39 |
+require_once 'ezc/Base/autoload.php'; |
40 |
+require_once 'ezc/ConsoleTools/autoload.php'; |
41 |
+ |
42 |
+// @codingStandardsIgnoreFile |
43 |
+// @codeCoverageIgnoreStart |
44 |
+// this is an autogenerated file - do not edit |
45 |
+spl_autoload_register( |
46 |
+ function($class) { |
47 |
+ static $classes = null; |
48 |
+ if ($classes === null) { |
49 |
+ $classes = array( |
50 |
+ ___CLASSLIST___ |
51 |
+ ); |
52 |
+ } |
53 |
+ $cn = strtolower($class); |
54 |
+ if (isset($classes[$cn])) { |
55 |
+ require ___BASEDIR___$classes[$cn]; |
56 |
+ } |
57 |
+ }, |
58 |
+ true, |
59 |
+ false |
60 |
+); |
61 |
+// @codeCoverageIgnoreEnd |
62 |
|
63 |
diff --git a/dev-php/theseer-Autoload/files/fedora.php.tpl b/dev-php/theseer-Autoload/files/fedora.php.tpl |
64 |
new file mode 100644 |
65 |
index 00000000000..d05f2723189 |
66 |
--- /dev/null |
67 |
+++ b/dev-php/theseer-Autoload/files/fedora.php.tpl |
68 |
@@ -0,0 +1,12 @@ |
69 |
+<?php |
70 |
+// @codingStandardsIgnoreFile |
71 |
+// @codeCoverageIgnoreStart |
72 |
+require_once '/usr/share/php/Fedora/Autoloader'.'/autoload.php'; |
73 |
+ |
74 |
+\Fedora\Autoloader\Autoload::addClassMap( |
75 |
+ array( |
76 |
+ ___CLASSLIST___, |
77 |
+ ), |
78 |
+ __DIR__ |
79 |
+); |
80 |
+// @codeCoverageIgnoreEnd |
81 |
|
82 |
diff --git a/dev-php/theseer-Autoload/files/fedora2.php.tpl b/dev-php/theseer-Autoload/files/fedora2.php.tpl |
83 |
new file mode 100644 |
84 |
index 00000000000..b337b9646b3 |
85 |
--- /dev/null |
86 |
+++ b/dev-php/theseer-Autoload/files/fedora2.php.tpl |
87 |
@@ -0,0 +1,12 @@ |
88 |
+<?php |
89 |
+// @codingStandardsIgnoreFile |
90 |
+// @codeCoverageIgnoreStart |
91 |
+require_once 'Fedora/Autoloader'.'/autoload.php'; |
92 |
+ |
93 |
+\Fedora\Autoloader\Autoload::addClassMap( |
94 |
+ array( |
95 |
+ ___CLASSLIST___, |
96 |
+ ), |
97 |
+ __DIR__ |
98 |
+); |
99 |
+// @codeCoverageIgnoreEnd |
100 |
|
101 |
diff --git a/dev-php/theseer-Autoload/files/theseer-Autoload-1.26.0-autoload.php.patch b/dev-php/theseer-Autoload/files/theseer-Autoload-1.26.0-autoload.php.patch |
102 |
new file mode 100644 |
103 |
index 00000000000..d85409d4712 |
104 |
--- /dev/null |
105 |
+++ b/dev-php/theseer-Autoload/files/theseer-Autoload-1.26.0-autoload.php.patch |
106 |
@@ -0,0 +1,12 @@ |
107 |
+--- a/composer/bin/phpab |
108 |
++++ b/composer/bin/phpab |
109 |
+@@ -56,7 +56,7 @@ foreach ($files as $file) { |
110 |
+ } |
111 |
+ } |
112 |
+ |
113 |
+-require __DIR__ . '/../../src/autoload.php'; |
114 |
++require 'TheSeer/Autoload/autoload.php'; |
115 |
+ |
116 |
+ $factory = new \TheSeer\Autoload\Factory(); |
117 |
+ $factory->getCLI()->run(); |
118 |
+ |
119 |
|
120 |
diff --git a/dev-php/theseer-Autoload/metadata.xml b/dev-php/theseer-Autoload/metadata.xml |
121 |
new file mode 100644 |
122 |
index 00000000000..bb9f50f08f6 |
123 |
--- /dev/null |
124 |
+++ b/dev-php/theseer-Autoload/metadata.xml |
125 |
@@ -0,0 +1,11 @@ |
126 |
+<?xml version='1.0' encoding='UTF-8'?> |
127 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
128 |
+<pkgmetadata> |
129 |
+ <maintainer type="project"> |
130 |
+ <email>php-bugs@g.o</email> |
131 |
+ <name>PHP</name> |
132 |
+ </maintainer> |
133 |
+ <upstream> |
134 |
+ <remote-id type="github">theseer/Autoload</remote-id> |
135 |
+ </upstream> |
136 |
+</pkgmetadata> |
137 |
|
138 |
diff --git a/dev-php/theseer-Autoload/theseer-Autoload-1.26.0.ebuild b/dev-php/theseer-Autoload/theseer-Autoload-1.26.0.ebuild |
139 |
new file mode 100644 |
140 |
index 00000000000..01afc209be0 |
141 |
--- /dev/null |
142 |
+++ b/dev-php/theseer-Autoload/theseer-Autoload-1.26.0.ebuild |
143 |
@@ -0,0 +1,82 @@ |
144 |
+# Copyright 1999-2020 Gentoo Authors |
145 |
+# Distributed under the terms of the GNU General Public License v2 |
146 |
+ |
147 |
+EAPI=7 |
148 |
+ |
149 |
+MY_PN="Autoload" |
150 |
+ |
151 |
+DESCRIPTION="PHP Autoload Builder" |
152 |
+HOMEPAGE="https://github.com/theseer/Autoload" |
153 |
+SRC_URI="https://github.com/theseer/${MY_PN}/archive/1.26.0.tar.gz -> ${P}.tar.gz" |
154 |
+ |
155 |
+LICENSE="BSD" |
156 |
+SLOT="0" |
157 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86" |
158 |
+IUSE="test" |
159 |
+RESTRICT="!test? ( test )" |
160 |
+ |
161 |
+CDEPEND="dev-lang/php:* |
162 |
+ >=dev-php/theseer-DirectoryScanner-1.3 |
163 |
+ <dev-php/theseer-DirectoryScanner-2 |
164 |
+ >=dev-php/zetacomponents-Base-1.8 |
165 |
+ <dev-php/zetacomponents-Base-2 |
166 |
+ >=dev-php/zetacomponents-ConsoleTools-1.7.1 |
167 |
+ <dev-php/zetacomponents-ConsoleTools-2" |
168 |
+ |
169 |
+BDEPEND="${CDEPEND} |
170 |
+ test? ( |
171 |
+ >=dev-php/phpunit-8 |
172 |
+ <dev-php/phpunit-9 |
173 |
+ )" |
174 |
+ |
175 |
+RDEPEND="${CDEPEND}" |
176 |
+ |
177 |
+PATCHES=( "${FILESDIR}"/${PN}-1.26.0-autoload.php.patch ) |
178 |
+ |
179 |
+S="${WORKDIR}/${MY_PN}-${PV}" |
180 |
+ |
181 |
+src_prepare() { |
182 |
+ default |
183 |
+ |
184 |
+ # Set version |
185 |
+ sed -i \ |
186 |
+ -e "s/%development%/${PV}/" \ |
187 |
+ phpab.php \ |
188 |
+ composer/bin/phpab \ |
189 |
+ || die |
190 |
+ |
191 |
+ cp --target-directory src/templates/ci \ |
192 |
+ "${FILESDIR}"/fedora.php.tpl \ |
193 |
+ "${FILESDIR}"/fedora2.php.tpl \ |
194 |
+ || die |
195 |
+ |
196 |
+ # Mimick layout to bootstrap phpab |
197 |
+ mkdir --parents \ |
198 |
+ vendor/theseer/directoryscanner \ |
199 |
+ vendor/zetacomponents/base \ |
200 |
+ vendor/zetacomponents/console-tools \ |
201 |
+ || die |
202 |
+ |
203 |
+ ln -s /usr/share/php/TheSeer/DirectoryScanner vendor/theseer/directoryscanner/src || die |
204 |
+ ln -s /usr/share/php/ezc/Base vendor/zetacomponents/base/src || die |
205 |
+ ln -s /usr/share/php/ezc/ConsoleTools vendor/zetacomponents/console-tools/src || die |
206 |
+ |
207 |
+ ./phpab.php \ |
208 |
+ --output src/autoload.php \ |
209 |
+ --template "${FILESDIR}"/autoload.php.tpl \ |
210 |
+ --basedir src \ |
211 |
+ src || die |
212 |
+} |
213 |
+ |
214 |
+src_test() { |
215 |
+ phpunit --no-coverage --verbose || die "Unit testing failed!" |
216 |
+} |
217 |
+ |
218 |
+src_install() { |
219 |
+ insinto /usr/share/php/TheSeer/${MY_PN} |
220 |
+ doins -r src/* |
221 |
+ |
222 |
+ dobin "${S}"/composer/bin/phpab |
223 |
+ |
224 |
+ einstalldocs |
225 |
+} |