/[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.111 - (show annotations) (download)
Tue Oct 22 20:44:38 2013 UTC (8 months, 2 weeks ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Changes since 1.110: +1 -1 lines
FILE REMOVED
Revbump for git migration.

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

  ViewVC Help
Powered by ViewVC 1.1.20