/[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.68 - (hide annotations) (download)
Mon Jun 25 03:53:43 2012 UTC (3 years ago) by floppym
Branch: MAIN
Changes since 1.67: +12 -4 lines
Version bump. Tweak efiemu configure option, bug 422835 by Rafał Mużyło.

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

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

  ViewVC Help
Powered by ViewVC 1.1.20