/[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.54 - (show annotations) (download)
Tue Mar 6 00:58:38 2012 UTC (2 years, 9 months ago) by floppym
Branch: MAIN
Changes since 1.53: +2 -7 lines
Don't use the platform to tranform the utility names; it's pointless. Users may need to specify the --target option if grub2-install fails to auto-detect it.

(Portage version: 2.2.0_alpha89/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-2.00_beta0.ebuild,v 1.4 2012/03/04 21:23:33 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:
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/libisoburn
54 dev-libs/lzo
55 sys-boot/os-prober
56 >=sys-libs/ncurses-5.2-r5
57 debug? (
58 sdl? ( media-libs/libsdl )
59 )
60 device-mapper? ( >=sys-fs/lvm2-2.02.45 )
61 libzfs? ( sys-fs/zfs )
62 mount? ( sys-fs/fuse )
63 truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
64 DEPEND="${RDEPEND}
65 >=dev-lang/python-2.5.2
66 sys-devel/flex
67 virtual/yacc
68 sys-apps/texinfo
69 "
70 if [[ -n ${DO_AUTORECONF} ]] ; then
71 DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
72 else
73 DEPEND+=" app-arch/xz-utils"
74 fi
75
76 export STRIP_MASK="*/grub/*/*.{mod,img}"
77
78 QA_EXECSTACK="
79 usr/bin/grub*
80 usr/sbin/grub*
81 usr/lib*/grub/*/*.mod
82 usr/lib*/grub/*/kernel.exec
83 usr/lib*/grub/*/kernel.img
84 usr/lib*/grub/*/setjmp.module
85 "
86
87 QA_WX_LOAD="
88 usr/lib*/grub/*/kernel.exec
89 usr/lib*/grub/*/kernel.img
90 usr/lib*/grub/*/*.image
91 "
92
93 QA_PRESTRIPPED="
94 usr/lib.*/grub/.*/kernel.img
95 "
96
97 grub_run_phase() {
98 local phase=$1
99 local platform=$2
100 [[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
101
102 [[ -d "${WORKDIR}/build-${platform}" ]] || \
103 { mkdir "${WORKDIR}/build-${platform}" || die ; }
104 pushd "${WORKDIR}/build-${platform}" > /dev/null || die
105
106 echo ">>> Running ${phase} for platform \"${platform}\""
107 echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
108
109 grub_${phase} ${platform}
110
111 popd > /dev/null || die
112 }
113
114 grub_src_configure() {
115 local platform=$1
116 local target
117 local with_platform
118
119 [[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
120
121 # check if we have to specify the target (EFI)
122 # or just append correct --with-platform
123 if [[ ${platform} == efi* ]]; then
124 # EFI platform hack
125 [[ ${platform/*-} == 32 ]] && target=i386
126 [[ ${platform/*-} == 64 ]] && target=x86_64
127 # program-prefix is required empty because otherwise it is equal to
128 # target variable, which we do not want at all
129 with_platform="
130 --with-platform=${platform/-*}
131 --target=${target}
132 --program-prefix=
133 "
134 elif [[ ${platform} != "guessed" ]]; then
135 with_platform=" --with-platform=${platform}"
136 fi
137
138 ECONF_SOURCE="${S}" \
139 econf \
140 --disable-werror \
141 --program-transform-name="s,grub,grub2," \
142 --with-grubdir=grub2 \
143 $(use_enable debug mm-debug) \
144 $(use_enable debug grub-emu-usb) \
145 $(use_enable device-mapper) \
146 $(use_enable efiemu) \
147 $(use_enable mount grub-mount) \
148 $(use_enable nls) \
149 $(use_enable truetype grub-mkfont) \
150 $(use_enable libzfs) \
151 $(use sdl && use_enable debug grub-emu-sdl) \
152 ${with_platform}
153 }
154
155 grub_src_compile() {
156 default_src_compile
157 pax-mark -mpes "${grub_binaries[@]}"
158 }
159
160 grub_src_install() {
161 default_src_install
162 }
163
164 src_prepare() {
165 local i j
166
167 epatch_user
168
169 # autogen.sh does more than just run autotools
170 if [[ -n ${DO_AUTORECONF} ]] ; then
171 sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
172 (. ./autogen.sh) || die
173 fi
174
175 # install into the right dir for eselect #372735
176 sed -i \
177 -e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
178 util/bash-completion.d/Makefile.in || die
179
180 # get enabled platforms
181 GRUB_ENABLED_PLATFORMS=""
182 for i in ${GRUB_PLATFORMS[@]}; do
183 use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
184 done
185 [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
186 elog "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
187 }
188
189 src_configure() {
190 local i
191
192 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
193 use libzfs && addpredict /etc/dfs
194 use static && append-ldflags -static
195
196 for i in ${GRUB_ENABLED_PLATFORMS}; do
197 grub_run_phase ${FUNCNAME} ${i}
198 done
199 }
200
201 src_compile() {
202 # Used for pax marking in grub_src_compile
203 local grub_binaries=(
204 grub-editenv
205 grub-fstest
206 grub-menulst2cfg
207 grub-mkimage
208 grub-mklayout
209 grub-mkpasswd-pbkdf2
210 grub-mkrelpath
211 grub-script-check
212 grub-bios-setup
213 grub-ofpathname
214 grub-probe
215 grub-sparc64-setup
216 )
217 use mount && grub_binaries+=( grub-mount )
218 use truetype && grub_binaries+=( grub-mkfont )
219
220 local i
221
222 for i in ${GRUB_ENABLED_PLATFORMS}; do
223 grub_run_phase ${FUNCNAME} ${i}
224 done
225 }
226
227 src_install() {
228 local i
229
230 for i in ${GRUB_ENABLED_PLATFORMS}; do
231 grub_run_phase ${FUNCNAME} ${i}
232 done
233
234 mv "${ED}"usr/share/info/grub{,2}.info || die
235
236 # can't be in docs array as we use default_src_install in different builddir
237 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
238 insinto /etc/default
239 newins "${FILESDIR}"/grub.default grub
240 }
241
242 pkg_postinst() {
243 # display the link to guide
244 elog "For information on how to configure grub-2 please refer to the guide:"
245 elog " http://wiki.gentoo.org/wiki/GRUB2"
246 }

  ViewVC Help
Powered by ViewVC 1.1.20