/[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.58 - (hide annotations) (download)
Sat Mar 17 22:30:14 2012 UTC (2 years, 6 months ago) by floppym
Branch: MAIN
Changes since 1.57: +20 -8 lines
Sync live ebuild.

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

  ViewVC Help
Powered by ViewVC 1.1.20