1 |
commit: f636811e4dcdd14a9196d36e04fa4cc742ac83d2 |
2 |
Author: Tomas Chvatal <scarabeus <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 30 13:20:20 2011 +0000 |
4 |
Commit: Tomas Chvatal <scarabeus <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 30 13:20:20 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=f636811e |
7 |
|
8 |
[sys-boot/grub] Add USE_EXPAND for platform. TODO: somehow make it not fail so we detect what useflag is possible on what cpu. |
9 |
|
10 |
--- |
11 |
sys-boot/grub/Manifest | 4 +- |
12 |
sys-boot/grub/grub-1.99.ebuild | 104 +++++++++++++++++++++++++++++++++------- |
13 |
sys-boot/grub/grub-9999.ebuild | 104 +++++++++++++++++++++++++++++++++------- |
14 |
3 files changed, 176 insertions(+), 36 deletions(-) |
15 |
|
16 |
diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest |
17 |
index e99e876..31425b7 100644 |
18 |
--- a/sys-boot/grub/Manifest |
19 |
+++ b/sys-boot/grub/Manifest |
20 |
@@ -1,5 +1,5 @@ |
21 |
AUX grub.default 1127 RMD160 a884e842cb203687cac4cac6551b0feed58d3b7a SHA1 5878147845b5d4b4aac34ce046ead60b93c3170c SHA256 32664f2e0bdd05cf9579f8e098aa0add76ef7bf7b37eb103c6d0f625204f44d3 |
22 |
DIST grub-1.99.tar.xz 2639224 RMD160 d59a47fa40b2be0d5ea5b2b00ff5538cfa147747 SHA1 a5ae9558f30ce7757a76aa130088b053a87e2fb6 SHA256 f308148d4c83c6f16a73b58a0cd39381656edb740929028cae7ad5f0d651021b |
23 |
-EBUILD grub-1.99.ebuild 4015 RMD160 35212619b0ec881a665bcd481062e7e640071cfe SHA1 bdff1287700e0da8a16f7d079dd04ed9c75e96e5 SHA256 8a312c21f31e6dda4c80fd52b3178b28a9284c186015f430483779637088d922 |
24 |
-EBUILD grub-9999.ebuild 4015 RMD160 35212619b0ec881a665bcd481062e7e640071cfe SHA1 bdff1287700e0da8a16f7d079dd04ed9c75e96e5 SHA256 8a312c21f31e6dda4c80fd52b3178b28a9284c186015f430483779637088d922 |
25 |
+EBUILD grub-1.99.ebuild 5608 RMD160 7d5fc5f793e025bc271077c02d5942f19a2f2a61 SHA1 7a6087fd1c58d6566b5eab0faecf4b192b1502dd SHA256 b68ca2209a986c683177e8abb2f5c98d25820a919388880e52eeb82b5f339c9e |
26 |
+EBUILD grub-9999.ebuild 5608 RMD160 7d5fc5f793e025bc271077c02d5942f19a2f2a61 SHA1 7a6087fd1c58d6566b5eab0faecf4b192b1502dd SHA256 b68ca2209a986c683177e8abb2f5c98d25820a919388880e52eeb82b5f339c9e |
27 |
MISC metadata.xml 264 RMD160 3cb995676f964b9637fbfc0027a81b9409802608 SHA1 c4d35e3a71c545cdf1aae525de803126bf54f596 SHA256 9bd1ce830cf1b821978ab90c81b2e369177a8d7c1bfe2dd2868419872c097f64 |
28 |
|
29 |
diff --git a/sys-boot/grub/grub-1.99.ebuild b/sys-boot/grub/grub-1.99.ebuild |
30 |
index a00a605..2d41728 100644 |
31 |
--- a/sys-boot/grub/grub-1.99.ebuild |
32 |
+++ b/sys-boot/grub/grub-1.99.ebuild |
33 |
@@ -2,9 +2,6 @@ |
34 |
# Distributed under the terms of the GNU General Public License v2 |
35 |
# $Header: $ |
36 |
|
37 |
-# FIXME: somehow depend on python-2 only; using python eclass maybe? |
38 |
-# NOTE: good idea would be to move grub-2 to new package called grub2 |
39 |
- |
40 |
EAPI=4 |
41 |
|
42 |
if [[ ${PV} == "9999" ]] ; then |
43 |
@@ -29,6 +26,12 @@ SLOT="0" |
44 |
[[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~x86" |
45 |
IUSE="custom-cflags debug device-mapper nls static sdl truetype" |
46 |
|
47 |
+GRUB_PLATFORMS="coreboot efi emu ieee1275 pc qemu yeeloong" |
48 |
+for i in ${GRUB_PLATFORMS}; do |
49 |
+ IUSE+=" grub_platform_${i}" |
50 |
+done |
51 |
+unset i |
52 |
+ |
53 |
# os-prober: Used on runtime to detect other OSes |
54 |
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue |
55 |
RDEPEND=" |
56 |
@@ -59,23 +62,34 @@ QA_EXECSTACK=" |
57 |
bin/grub-fstest |
58 |
" |
59 |
|
60 |
-DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) |
61 |
+grub_run_phase() { |
62 |
+ local phase=$1 |
63 |
+ local platform=$2 |
64 |
+ [[ -z ${phase} ]] && die "${FUNCNAME}: Phase is undefined" |
65 |
+ [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" |
66 |
|
67 |
-src_prepare() { |
68 |
- epatch_user |
69 |
+ [[ -d "${WORKDIR}/build-${platform}" ]] || \ |
70 |
+ { mkdir "${WORKDIR}/build-${platform}" || die ; } |
71 |
+ pushd "${WORKDIR}/build-${platform}" > /dev/null || die |
72 |
|
73 |
- # autogen.sh does more than just run autotools |
74 |
- if [[ ${PV} == "9999" ]] ; then |
75 |
- sed -i -e '/^autoreconf/ d' autogen.sh || die |
76 |
- (. ./autogen.sh) || die |
77 |
- eautoreconf |
78 |
- fi |
79 |
+ echo ">>> Running ${phase} for platform \"${platform}\"" |
80 |
+ echo ">>> Working in: \"${WORKDIR}/build-${platform}\"" |
81 |
+ |
82 |
+ grub_${phase} ${platform} |
83 |
+ |
84 |
+ popd > /dev/null || die |
85 |
} |
86 |
|
87 |
-src_configure() { |
88 |
- use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS |
89 |
- use static && append-ldflags -static |
90 |
+grub_src_configure() { |
91 |
+ local platform=$1 |
92 |
|
93 |
+ [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" |
94 |
+ |
95 |
+ [[ ${platform} == "guessed" ]] \ |
96 |
+ && platform="" \ |
97 |
+ || platform="--with-platform=${platform}" |
98 |
+ |
99 |
+ ECONF_SOURCE="${WORKDIR}/${P}/" \ |
100 |
econf \ |
101 |
--disable-werror \ |
102 |
--sbindir=/sbin \ |
103 |
@@ -87,12 +101,68 @@ src_configure() { |
104 |
$(use_enable nls) \ |
105 |
$(use_enable debug mm-debug) \ |
106 |
$(use sdl && use_enable debug grub-emu-sdl) \ |
107 |
- $(use_enable debug grub-emu-usb) |
108 |
+ $(use_enable debug grub-emu-usb) \ |
109 |
+ ${platform} |
110 |
+} |
111 |
+ |
112 |
+grub_src_compile() { |
113 |
+ default_src_compile |
114 |
+} |
115 |
+ |
116 |
+grub_src_install() { |
117 |
+ default_src_install |
118 |
+} |
119 |
+ |
120 |
+src_prepare() { |
121 |
+ local i |
122 |
+ |
123 |
+ epatch_user |
124 |
+ |
125 |
+ # autogen.sh does more than just run autotools |
126 |
+ if [[ ${PV} == "9999" ]] ; then |
127 |
+ sed -i -e '/^autoreconf/ d' autogen.sh || die |
128 |
+ (. ./autogen.sh) || die |
129 |
+ eautoreconf |
130 |
+ fi |
131 |
+ |
132 |
+ # get enabled platforms |
133 |
+ GRUB_ENABLED_PLATFORMS="" |
134 |
+ for i in ${GRUB_PLATFORMS}; do |
135 |
+ use grub_platform_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}" |
136 |
+ done |
137 |
+} |
138 |
+ |
139 |
+src_configure() { |
140 |
+ local i |
141 |
+ |
142 |
+ use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS |
143 |
+ use static && append-ldflags -static |
144 |
+ |
145 |
+ [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed |
146 |
+ for i in ${GRUB_ENABLED_PLATFORMS}; do |
147 |
+ grub_run_phase ${FUNCNAME} ${i} |
148 |
+ done |
149 |
+} |
150 |
+ |
151 |
+src_compile() { |
152 |
+ local i |
153 |
+ |
154 |
+ [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed |
155 |
+ for i in ${GRUB_ENABLED_PLATFORMS}; do |
156 |
+ grub_run_phase ${FUNCNAME} ${i} |
157 |
+ done |
158 |
} |
159 |
|
160 |
src_install() { |
161 |
- default |
162 |
+ local i |
163 |
+ |
164 |
+ [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed |
165 |
+ for i in ${GRUB_ENABLED_PLATFORMS}; do |
166 |
+ grub_run_phase ${FUNCNAME} ${i} |
167 |
+ done |
168 |
|
169 |
+ # can't be in docs array as we use defualt_src_install in different builddir |
170 |
+ dodoc AUTHORS ChangeLog NEWS README THANKS TODO |
171 |
insinto /etc/default |
172 |
newins "${FILESDIR}"/grub.default grub |
173 |
cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib |
174 |
|
175 |
diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild |
176 |
index a00a605..2d41728 100644 |
177 |
--- a/sys-boot/grub/grub-9999.ebuild |
178 |
+++ b/sys-boot/grub/grub-9999.ebuild |
179 |
@@ -2,9 +2,6 @@ |
180 |
# Distributed under the terms of the GNU General Public License v2 |
181 |
# $Header: $ |
182 |
|
183 |
-# FIXME: somehow depend on python-2 only; using python eclass maybe? |
184 |
-# NOTE: good idea would be to move grub-2 to new package called grub2 |
185 |
- |
186 |
EAPI=4 |
187 |
|
188 |
if [[ ${PV} == "9999" ]] ; then |
189 |
@@ -29,6 +26,12 @@ SLOT="0" |
190 |
[[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~x86" |
191 |
IUSE="custom-cflags debug device-mapper nls static sdl truetype" |
192 |
|
193 |
+GRUB_PLATFORMS="coreboot efi emu ieee1275 pc qemu yeeloong" |
194 |
+for i in ${GRUB_PLATFORMS}; do |
195 |
+ IUSE+=" grub_platform_${i}" |
196 |
+done |
197 |
+unset i |
198 |
+ |
199 |
# os-prober: Used on runtime to detect other OSes |
200 |
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue |
201 |
RDEPEND=" |
202 |
@@ -59,23 +62,34 @@ QA_EXECSTACK=" |
203 |
bin/grub-fstest |
204 |
" |
205 |
|
206 |
-DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) |
207 |
+grub_run_phase() { |
208 |
+ local phase=$1 |
209 |
+ local platform=$2 |
210 |
+ [[ -z ${phase} ]] && die "${FUNCNAME}: Phase is undefined" |
211 |
+ [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" |
212 |
|
213 |
-src_prepare() { |
214 |
- epatch_user |
215 |
+ [[ -d "${WORKDIR}/build-${platform}" ]] || \ |
216 |
+ { mkdir "${WORKDIR}/build-${platform}" || die ; } |
217 |
+ pushd "${WORKDIR}/build-${platform}" > /dev/null || die |
218 |
|
219 |
- # autogen.sh does more than just run autotools |
220 |
- if [[ ${PV} == "9999" ]] ; then |
221 |
- sed -i -e '/^autoreconf/ d' autogen.sh || die |
222 |
- (. ./autogen.sh) || die |
223 |
- eautoreconf |
224 |
- fi |
225 |
+ echo ">>> Running ${phase} for platform \"${platform}\"" |
226 |
+ echo ">>> Working in: \"${WORKDIR}/build-${platform}\"" |
227 |
+ |
228 |
+ grub_${phase} ${platform} |
229 |
+ |
230 |
+ popd > /dev/null || die |
231 |
} |
232 |
|
233 |
-src_configure() { |
234 |
- use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS |
235 |
- use static && append-ldflags -static |
236 |
+grub_src_configure() { |
237 |
+ local platform=$1 |
238 |
|
239 |
+ [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" |
240 |
+ |
241 |
+ [[ ${platform} == "guessed" ]] \ |
242 |
+ && platform="" \ |
243 |
+ || platform="--with-platform=${platform}" |
244 |
+ |
245 |
+ ECONF_SOURCE="${WORKDIR}/${P}/" \ |
246 |
econf \ |
247 |
--disable-werror \ |
248 |
--sbindir=/sbin \ |
249 |
@@ -87,12 +101,68 @@ src_configure() { |
250 |
$(use_enable nls) \ |
251 |
$(use_enable debug mm-debug) \ |
252 |
$(use sdl && use_enable debug grub-emu-sdl) \ |
253 |
- $(use_enable debug grub-emu-usb) |
254 |
+ $(use_enable debug grub-emu-usb) \ |
255 |
+ ${platform} |
256 |
+} |
257 |
+ |
258 |
+grub_src_compile() { |
259 |
+ default_src_compile |
260 |
+} |
261 |
+ |
262 |
+grub_src_install() { |
263 |
+ default_src_install |
264 |
+} |
265 |
+ |
266 |
+src_prepare() { |
267 |
+ local i |
268 |
+ |
269 |
+ epatch_user |
270 |
+ |
271 |
+ # autogen.sh does more than just run autotools |
272 |
+ if [[ ${PV} == "9999" ]] ; then |
273 |
+ sed -i -e '/^autoreconf/ d' autogen.sh || die |
274 |
+ (. ./autogen.sh) || die |
275 |
+ eautoreconf |
276 |
+ fi |
277 |
+ |
278 |
+ # get enabled platforms |
279 |
+ GRUB_ENABLED_PLATFORMS="" |
280 |
+ for i in ${GRUB_PLATFORMS}; do |
281 |
+ use grub_platform_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}" |
282 |
+ done |
283 |
+} |
284 |
+ |
285 |
+src_configure() { |
286 |
+ local i |
287 |
+ |
288 |
+ use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS |
289 |
+ use static && append-ldflags -static |
290 |
+ |
291 |
+ [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed |
292 |
+ for i in ${GRUB_ENABLED_PLATFORMS}; do |
293 |
+ grub_run_phase ${FUNCNAME} ${i} |
294 |
+ done |
295 |
+} |
296 |
+ |
297 |
+src_compile() { |
298 |
+ local i |
299 |
+ |
300 |
+ [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed |
301 |
+ for i in ${GRUB_ENABLED_PLATFORMS}; do |
302 |
+ grub_run_phase ${FUNCNAME} ${i} |
303 |
+ done |
304 |
} |
305 |
|
306 |
src_install() { |
307 |
- default |
308 |
+ local i |
309 |
+ |
310 |
+ [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed |
311 |
+ for i in ${GRUB_ENABLED_PLATFORMS}; do |
312 |
+ grub_run_phase ${FUNCNAME} ${i} |
313 |
+ done |
314 |
|
315 |
+ # can't be in docs array as we use defualt_src_install in different builddir |
316 |
+ dodoc AUTHORS ChangeLog NEWS README THANKS TODO |
317 |
insinto /etc/default |
318 |
newins "${FILESDIR}"/grub.default grub |
319 |
cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib |