/[gentoo-x86]/sys-boot/grub/grub-9999.ebuild
Gentoo

Contents of /sys-boot/grub/grub-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.63 - (show annotations) (download)
Wed May 9 23:00:07 2012 UTC (2 years, 3 months ago) by floppym
Branch: MAIN
Changes since 1.62: +7 -3 lines
Version bump. Should resolve bug 412497.
Repleace dependencies on os-prober and libisoburn with elog messages.

(Portage version: 2.2.0_alpha102/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.62 2012/04/28 03:23:03 floppym Exp $
4
5 EAPI=4
6
7 if [[ ${PV} == "9999" ]] ; then
8 EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
9 LIVE_ECLASS="bzr"
10 SRC_URI=""
11 DO_AUTORECONF="true"
12 else
13 MY_P=${P/_/\~}
14 if [[ ${PV} == *_alpha* || ${PV} == *_beta* ]]; then
15 SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
16 else
17 SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
18 mirror://gentoo/${MY_P}.tar.xz"
19 fi
20 # Masked until documentation guys consolidate the guide and approve
21 # it for usage.
22 #KEYWORDS="~amd64 ~mips ~x86"
23 S=${WORKDIR}/${MY_P}
24 fi
25
26 inherit eutils flag-o-matic pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
27 unset LIVE_ECLASS
28
29 DESCRIPTION="GNU GRUB boot loader"
30 HOMEPAGE="http://www.gnu.org/software/grub/"
31
32 LICENSE="GPL-3"
33 SLOT="2"
34 IUSE="custom-cflags debug device-mapper efiemu mount nls static sdl truetype libzfs"
35
36 GRUB_PLATFORMS=(
37 # everywhere:
38 emu
39 # mips only:
40 qemu-mips yeeloong
41 # amd64, x86, ppc, ppc64:
42 ieee1275
43 # amd64, x86:
44 coreboot multiboot efi-32 pc qemu
45 # amd64, ia64:
46 efi-64
47 )
48 IUSE+=" ${GRUB_PLATFORMS[@]/#/grub_platforms_}"
49
50 # os-prober: Used on runtime to detect other OSes
51 # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
52 RDEPEND="
53 dev-libs/lzo
54 >=sys-libs/ncurses-5.2-r5
55 debug? (
56 sdl? ( media-libs/libsdl )
57 )
58 device-mapper? ( >=sys-fs/lvm2-2.02.45 )
59 libzfs? ( sys-fs/zfs )
60 mount? ( sys-fs/fuse )
61 truetype? (
62 media-libs/freetype
63 >=media-fonts/unifont-5
64 )
65 "
66 DEPEND="${RDEPEND}
67 >=dev-lang/python-2.5.2
68 sys-devel/flex
69 virtual/yacc
70 sys-apps/texinfo
71 static? (
72 truetype? (
73 app-arch/bzip2[static-libs(+)]
74 media-libs/freetype[static-libs(+)]
75 sys-libs/zlib[static-libs(+)]
76 )
77 )
78 "
79 RDEPEND+="
80 grub_platforms_efi-32? ( sys-boot/efibootmgr )
81 grub_platforms_efi-64? ( sys-boot/efibootmgr )
82 "
83 if [[ -n ${DO_AUTORECONF} ]] ; then
84 DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
85 else
86 DEPEND+=" app-arch/xz-utils"
87 fi
88
89 export STRIP_MASK="*/grub/*/*.{mod,img}"
90
91 QA_EXECSTACK="
92 usr/bin/grub*
93 usr/sbin/grub*
94 usr/lib*/grub/*/*.mod
95 usr/lib*/grub/*/kernel.exec
96 usr/lib*/grub/*/kernel.img
97 usr/lib*/grub/*/setjmp.module
98 "
99
100 QA_WX_LOAD="
101 usr/lib*/grub/*/kernel.exec
102 usr/lib*/grub/*/kernel.img
103 usr/lib*/grub/*/*.image
104 "
105
106 QA_PRESTRIPPED="
107 usr/lib.*/grub/.*/kernel.img
108 "
109
110 grub_run_phase() {
111 local phase=$1
112 local platform=$2
113 [[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
114
115 [[ -d "${WORKDIR}/build-${platform}" ]] || \
116 { mkdir "${WORKDIR}/build-${platform}" || die ; }
117 pushd "${WORKDIR}/build-${platform}" > /dev/null || die
118
119 echo ">>> Running ${phase} for platform \"${platform}\""
120 echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
121
122 grub_${phase} ${platform}
123
124 popd > /dev/null || die
125 }
126
127 grub_src_configure() {
128 local platform=$1
129 local with_platform=
130
131 [[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
132
133 # Used below for efi cross-building
134 tc-export CC NM OBJCOPY STRIP
135
136 estack_push CTARGET "${CTARGET}"
137 estack_push TARGET_CC "${TARGET_CC}"
138 estack_push TARGET_CFLAGS "${TARGET_CFLAGS}"
139 estack_push TARGET_CPPFLAGS "${TARGET_CPPFLAGS}"
140
141 case ${platform} in
142 efi-32)
143 if [[ ${CHOST} == x86_64* ]]; then
144 CTARGET="${CTARGET:-i386}"
145 TARGET_CC="${TARGET_CC:-${CC}}"
146 export TARGET_CC
147 fi
148 with_platform="--with-platform=efi"
149 ;;
150 efi-64)
151 if [[ ${CHOST} == i?86* ]]; then
152 CTARGET="${CTARGET:-x86_64}"
153 TARGET_CC="${TARGET_CC:-${CC}}"
154 TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
155 TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
156 export TARGET_CC TARGET_CFLAGS TARGET_CPPFLAGS
157 fi
158 with_platform="--with-platform=efi"
159 ;;
160 guessed) ;;
161 *) with_platform="--with-platform=${platform}" ;;
162 esac
163
164 ECONF_SOURCE="${S}" \
165 econf \
166 --disable-werror \
167 --program-prefix= \
168 --program-transform-name="s,grub,grub2," \
169 --with-grubdir=grub2 \
170 ${with_platform} \
171 $(use_enable debug mm-debug) \
172 $(use_enable debug grub-emu-usb) \
173 $(use_enable device-mapper) \
174 $(use_enable efiemu) \
175 $(use_enable mount grub-mount) \
176 $(use_enable nls) \
177 $(use_enable truetype grub-mkfont) \
178 $(use_enable libzfs) \
179 $(use sdl && use_enable debug grub-emu-sdl)
180
181 estack_pop CTARGET CTARGET || die
182 estack_pop TARGET_CC TARGET_CC || die
183 estack_pop TARGET_CFLAGS TARGET_CFLAGS || die
184 estack_pop TARGET_CPPFLAGS TARGET_CPPFLAGS || die
185 }
186
187 grub_src_compile() {
188 default_src_compile
189 pax-mark -mpes "${grub_binaries[@]}"
190 }
191
192 grub_src_install() {
193 default_src_install
194 }
195
196 src_prepare() {
197 local i j
198
199 epatch_user
200
201 # autogen.sh does more than just run autotools
202 if [[ -n ${DO_AUTORECONF} ]] ; then
203 sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
204 (. ./autogen.sh) || die
205 fi
206
207 # install into the right dir for eselect #372735
208 sed -i \
209 -e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
210 util/bash-completion.d/Makefile.in || die
211
212 # get enabled platforms
213 GRUB_ENABLED_PLATFORMS=""
214 for i in ${GRUB_PLATFORMS[@]}; do
215 use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
216 done
217 [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
218 elog "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
219 }
220
221 src_configure() {
222 local i
223
224 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
225 use libzfs && addpredict /etc/dfs
226 use static && append-ldflags -static
227
228 for i in ${GRUB_ENABLED_PLATFORMS}; do
229 grub_run_phase ${FUNCNAME} ${i}
230 done
231 }
232
233 src_compile() {
234 # Used for pax marking in grub_src_compile
235 local grub_binaries=(
236 grub-editenv
237 grub-fstest
238 grub-menulst2cfg
239 grub-mkimage
240 grub-mklayout
241 grub-mkpasswd-pbkdf2
242 grub-mkrelpath
243 grub-script-check
244 grub-bios-setup
245 grub-ofpathname
246 grub-probe
247 grub-sparc64-setup
248 )
249 use mount && grub_binaries+=( grub-mount )
250 use truetype && grub_binaries+=( grub-mkfont )
251
252 local i
253
254 for i in ${GRUB_ENABLED_PLATFORMS}; do
255 grub_run_phase ${FUNCNAME} ${i}
256 done
257 }
258
259 src_install() {
260 local i
261
262 for i in ${GRUB_ENABLED_PLATFORMS}; do
263 grub_run_phase ${FUNCNAME} ${i}
264 done
265
266 mv "${ED}"usr/share/info/grub{,2}.info || die
267
268 # can't be in docs array as we use default_src_install in different builddir
269 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
270 insinto /etc/default
271 newins "${FILESDIR}"/grub.default grub
272 }
273
274 pkg_postinst() {
275 # display the link to guide
276 elog "For information on how to configure grub-2 please refer to the guide:"
277 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
278 if ! has_version sys-boot/os-prober; then
279 elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
280 fi
281 if ! has_version dev-libs/libisoburn; then
282 elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
283 fi
284 }

  ViewVC Help
Powered by ViewVC 1.1.20