/[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.101 - (show annotations) (download)
Sat Sep 7 23:01:12 2013 UTC (5 years ago) by floppym
Branch: MAIN
Changes since 1.100: +11 -5 lines
Drop the --with-grubdir=grub2 option and emit a warning on upgrades.

(Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)

1 # Copyright 1999-2013 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.100 2013/08/14 09:16:56 patrick Exp $
4
5 EAPI=5
6
7 if [[ ${PV} == 9999 ]]; then
8 AUTOTOOLS_AUTORECONF=1
9 fi
10
11 inherit autotools-utils bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs versionator
12
13 if [[ ${PV} != 9999 ]]; then
14 if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
15 MY_P=${P/_/~}
16 SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
17 S=${WORKDIR}/${MY_P}
18 else
19 SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
20 mirror://gentoo/${P}.tar.xz
21 http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
22 S=${WORKDIR}/${P%_*}
23 fi
24 KEYWORDS="~amd64 ~x86"
25 PATCHES=()
26 else
27 inherit bzr
28 EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
29 fi
30
31 DESCRIPTION="GNU GRUB boot loader"
32 HOMEPAGE="http://www.gnu.org/software/grub/"
33
34 LICENSE="GPL-3"
35 SLOT="2"
36 IUSE="custom-cflags debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
37
38 GRUB_ALL_PLATFORMS=(
39 # everywhere:
40 emu
41 # mips only:
42 qemu-mips yeeloong
43 # amd64, x86, ppc, ppc64:
44 ieee1275
45 # amd64, x86:
46 coreboot multiboot efi-32 pc qemu
47 # amd64, ia64:
48 efi-64
49 )
50 IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
51
52 REQUIRED_USE="grub_platforms_qemu? ( truetype )
53 grub_platforms_yeeloong? ( truetype )"
54
55 # os-prober: Used on runtime to detect other OSes
56 # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
57 RDEPEND="
58 app-arch/xz-utils
59 >=sys-libs/ncurses-5.2-r5
60 debug? (
61 sdl? ( media-libs/libsdl )
62 )
63 device-mapper? ( >=sys-fs/lvm2-2.02.45 )
64 libzfs? ( sys-fs/zfs )
65 mount? ( sys-fs/fuse )
66 truetype? (
67 media-libs/freetype
68 media-fonts/dejavu
69 >=media-fonts/unifont-5
70 )
71 ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
72 ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
73 "
74 DEPEND="${RDEPEND}
75 app-misc/pax-utils
76 >=dev-lang/python-2.5.2
77 sys-devel/flex
78 sys-devel/bison
79 sys-apps/help2man
80 sys-apps/texinfo
81 static? (
82 truetype? (
83 app-arch/bzip2[static-libs(+)]
84 media-libs/freetype[static-libs(+)]
85 sys-libs/zlib[static-libs(+)]
86 )
87 )
88 test? (
89 dev-libs/libisoburn
90 app-emulation/qemu
91 )
92 "
93 RDEPEND+="
94 kernel_linux? (
95 grub_platforms_efi-32? ( sys-boot/efibootmgr )
96 grub_platforms_efi-64? ( sys-boot/efibootmgr )
97 )
98 !multislot? ( !sys-boot/grub:0 )
99 "
100
101 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
102 DEPEND+=" >=sys-devel/autogen-5.10"
103 fi
104
105 STRIP_MASK="*/grub/*/*.{mod,img}"
106 RESTRICT="test"
107
108 QA_EXECSTACK="
109 usr/bin/grub*
110 usr/sbin/grub*
111 usr/lib*/grub/*/*.mod
112 usr/lib*/grub/*/*.module
113 usr/lib*/grub/*/kernel.exec
114 usr/lib*/grub/*/kernel.img
115 "
116
117 QA_WX_LOAD="
118 usr/lib*/grub/*/kernel.exec
119 usr/lib*/grub/*/kernel.img
120 usr/lib*/grub/*/*.image
121 "
122
123 QA_PRESTRIPPED="
124 usr/lib.*/grub/.*/kernel.img
125 "
126
127 pkg_pretend() {
128 if [[ ${MERGE_TYPE} != binary ]]; then
129 # Bug 439082
130 if ! version_is_at_least 4.8 "$(gcc-version)" &&
131 $(tc-getLD) --version | grep -q "GNU gold"; then
132 eerror "GRUB does not function correctly when built with the gold linker."
133 eerror "Please select the bfd linker with binutils-config."
134 die "GNU gold detected"
135 fi
136 fi
137 }
138
139 src_prepare() {
140 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
141 sed -i -e /autoreconf/d autogen.sh || die
142 if use multislot; then
143 # fix texinfo file name, bug 416035
144 sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
145 fi
146 epatch_user
147 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
148 bash autogen.sh || die
149 autopoint() { return 0; }
150 eautoreconf
151 fi
152 }
153
154 grub_configure() {
155 local platform
156
157 case ${MULTIBUILD_VARIANT} in
158 efi-32)
159 platform=efi
160 if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
161 local CTARGET=${CTARGET:-i386}
162 fi ;;
163 efi-64)
164 platform=efi
165 if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
166 local CTARGET=${CTARGET:-x86_64}
167 local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
168 local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
169 export TARGET_CFLAGS TARGET_CPPFLAGS
170 fi ;;
171 guessed) ;;
172 *) platform=${MULTIBUILD_VARIANT} ;;
173 esac
174
175 local myeconfargs=(
176 --disable-werror
177 --program-prefix=
178 --libdir="${EPREFIX}"/usr/lib
179 --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
180 $(use_enable debug mm-debug)
181 $(use_enable debug grub-emu-usb)
182 $(use_enable mount grub-mount)
183 $(use_enable nls)
184 $(use_enable truetype grub-mkfont)
185 $(use_enable libzfs)
186 $(use sdl && use_enable debug grub-emu-sdl)
187 ${platform:+--with-platform=}${platform}
188
189 # Let configure detect this where supported
190 $(usex efiemu '' '--disable-efiemu')
191 )
192
193 if use multislot; then
194 myeconfargs+=( --program-transform-name="s,grub,grub2," )
195 fi
196
197 autotools-utils_src_configure
198 }
199
200 src_configure() {
201 use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
202 use static && append-ldflags -static
203
204 if version_is_at_least 4.8 "$(gcc-version)"; then
205 export TARGET_LDFLAGS+=" -fuse-ld=bfd"
206 fi
207
208 tc-export CC NM OBJCOPY STRIP
209 export TARGET_CC=${TARGET_CC:-${CC}}
210
211 # Portage will take care of cleaning up GRUB_PLATFORMS
212 MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
213 multibuild_parallel_foreach_variant grub_configure
214 }
215
216 src_compile() {
217 # Sandbox bug 404013.
218 use libzfs && addpredict /etc/dfs:/dev/zfs
219
220 multibuild_foreach_variant autotools-utils_src_compile
221
222 use doc && multibuild_for_best_variant \
223 autotools-utils_src_compile -C docs html
224 }
225
226 src_test() {
227 # The qemu dependency is a bit complex.
228 # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
229 multibuild_foreach_variant autotools-utils_src_test
230 }
231
232 src_install() {
233 multibuild_foreach_variant autotools-utils_src_install \
234 bashcompletiondir="$(get_bashcompdir)"
235
236 use doc && multibuild_for_best_variant run_in_build_dir \
237 emake -C docs DESTDIR="${D}" install-html
238
239 if use multislot; then
240 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
241 fi
242
243 insinto /etc/default
244 newins "${FILESDIR}"/grub.default-2 grub
245
246 cd "${ED}" || die
247 pax-mark mpes $(scanelf -BF %F usr/{bin,sbin})
248 }
249
250 pkg_postinst() {
251 elog "For information on how to configure grub-2 please refer to the guide:"
252 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
253 if [[ -z ${REPLACING_VERSIONS} ]]; then
254 if ! has_version sys-boot/os-prober; then
255 elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
256 fi
257 if ! has_version dev-libs/libisoburn; then
258 elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
259 fi
260 else
261 local v
262 for v in ${REPLACING_VERSIONS}; do
263 if use multislot && ! version_is_at_least 2.00_p5107-r1 ${v}; then
264 ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
265 ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
266 break
267 fi
268 done
269 fi
270 }

  ViewVC Help
Powered by ViewVC 1.1.20