/[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.95 - (hide annotations) (download)
Sun Jul 21 00:37:11 2013 UTC (4 years, 7 months ago) by floppym
Branch: MAIN
Changes since 1.94: +9 -3 lines
Add support for probing EFI system partition, bug 477314 by Ben Kohler. Respect bashcompdir, bug 477392 by Alphat-PC.

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

1 floppym 1.86 # Copyright 1999-2013 Gentoo Foundation
2 vapier 1.1 # Distributed under the terms of the GNU General Public License v2
3 floppym 1.95 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.94 2013/06/30 18:25:01 floppym Exp $
4 vapier 1.21
5 floppym 1.89 EAPI=5
6     AUTOTOOLS_AUTO_DEPEND=yes
7 vapier 1.1
8 floppym 1.95 inherit autotools-utils bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs
9 floppym 1.89
10     if [[ ${PV} != 9999 ]]; then
11 scarabeus 1.37 MY_P=${P/_/\~}
12 floppym 1.68 if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
13 floppym 1.52 SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
14 floppym 1.50 else
15     SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
16 floppym 1.89 mirror://gentoo/${MY_P}.tar.xz"
17 floppym 1.50 fi
18 floppym 1.73 KEYWORDS="~amd64 ~x86"
19 scarabeus 1.37 S=${WORKDIR}/${MY_P}
20 floppym 1.89 PATCHES=(
21     "${FILESDIR}/${P}-parallel-make.patch" #424231
22     "${FILESDIR}/${P}-no-gets.patch" #424703
23     "${FILESDIR}/${P}-config-quoting.patch" #426364
24     "${FILESDIR}/${P}-tftp-endian.patch" # 438612
25     "${FILESDIR}/${P}-hardcoded-awk.patch" #424137
26     "${FILESDIR}/${P}-freebsd.patch" #442050
27     "${FILESDIR}/${P}-compression.patch" #424527
28     "${FILESDIR}/${P}-zfs-feature-flag-support-r1.patch" #455358
29     "${FILESDIR}/${P}-20_linux_xen.patch" #463992
30     "${FILESDIR}/${P}-dmraid.patch" #430748
31     "${FILESDIR}/${P}-texinfo.patch"
32 floppym 1.95 "${FILESDIR}/${P}-os-prober-efi-system.patch" #477314
33 floppym 1.89 )
34     else
35     inherit bzr
36     EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
37 vapier 1.1 fi
38    
39 vapier 1.32 DESCRIPTION="GNU GRUB boot loader"
40 vapier 1.1 HOMEPAGE="http://www.gnu.org/software/grub/"
41    
42 vapier 1.4 LICENSE="GPL-3"
43 scarabeus 1.37 SLOT="2"
44 floppym 1.93 IUSE="custom-cflags debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
45 scarabeus 1.37
46 floppym 1.89 GRUB_ALL_PLATFORMS=(
47 vapier 1.47 # everywhere:
48     emu
49     # mips only:
50     qemu-mips yeeloong
51     # amd64, x86, ppc, ppc64:
52     ieee1275
53     # amd64, x86:
54     coreboot multiboot efi-32 pc qemu
55 floppym 1.56 # amd64, ia64:
56 vapier 1.47 efi-64
57     )
58 floppym 1.89 IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
59 scarabeus 1.37
60 floppym 1.86 REQUIRED_USE="grub_platforms_qemu? ( truetype )
61     grub_platforms_yeeloong? ( truetype )"
62 floppym 1.71
63 scarabeus 1.37 # os-prober: Used on runtime to detect other OSes
64     # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
65     RDEPEND="
66 floppym 1.73 app-arch/xz-utils
67 scarabeus 1.37 >=sys-libs/ncurses-5.2-r5
68 vapier 1.32 debug? (
69     sdl? ( media-libs/libsdl )
70     )
71     device-mapper? ( >=sys-fs/lvm2-2.02.45 )
72 floppym 1.50 libzfs? ( sys-fs/zfs )
73     mount? ( sys-fs/fuse )
74 floppym 1.62 truetype? (
75     media-libs/freetype
76 scarabeus 1.69 media-fonts/dejavu
77 floppym 1.62 >=media-fonts/unifont-5
78     )
79 josejx 1.64 ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
80     ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
81 floppym 1.62 "
82 vapier 1.9 DEPEND="${RDEPEND}
83 floppym 1.89 app-misc/pax-utils
84 mattst88 1.35 >=dev-lang/python-2.5.2
85 scarabeus 1.37 sys-devel/flex
86 floppym 1.70 sys-devel/bison
87 floppym 1.75 sys-apps/help2man
88 flameeyes 1.45 sys-apps/texinfo
89 floppym 1.89 >=sys-devel/autogen-5.10
90 floppym 1.62 static? (
91     truetype? (
92     app-arch/bzip2[static-libs(+)]
93     media-libs/freetype[static-libs(+)]
94     sys-libs/zlib[static-libs(+)]
95     )
96     )
97 floppym 1.92 test? (
98     dev-libs/libisoburn
99     app-emulation/qemu
100     )
101 scarabeus 1.37 "
102 floppym 1.55 RDEPEND+="
103 floppym 1.86 kernel_linux? (
104     grub_platforms_efi-32? ( sys-boot/efibootmgr )
105     grub_platforms_efi-64? ( sys-boot/efibootmgr )
106     )
107 floppym 1.89 !multislot? ( !sys-boot/grub:0 )
108 floppym 1.55 "
109 scarabeus 1.37
110 floppym 1.89 STRIP_MASK="*/grub/*/*.{mod,img}"
111 floppym 1.95 RESTRICT="test"
112 floppym 1.50
113 scarabeus 1.37 QA_EXECSTACK="
114 floppym 1.50 usr/bin/grub*
115     usr/sbin/grub*
116     usr/lib*/grub/*/*.mod
117 floppym 1.89 usr/lib*/grub/*/*.module
118 floppym 1.50 usr/lib*/grub/*/kernel.exec
119     usr/lib*/grub/*/kernel.img
120 scarabeus 1.37 "
121    
122 scarabeus 1.41 QA_WX_LOAD="
123 floppym 1.50 usr/lib*/grub/*/kernel.exec
124     usr/lib*/grub/*/kernel.img
125     usr/lib*/grub/*/*.image
126     "
127    
128     QA_PRESTRIPPED="
129     usr/lib.*/grub/.*/kernel.img
130 scarabeus 1.41 "
131    
132 floppym 1.85 pkg_pretend() {
133     if [[ ${MERGE_TYPE} != binary ]]; then
134     # Bug 439082
135     if $(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 vapier 1.33 src_prepare() {
144 floppym 1.89 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
145     sed -i -e /autoreconf/d autogen.sh || die
146 floppym 1.95 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 floppym 1.89 epatch_user
151     bash autogen.sh || die
152     autopoint() { return 0; }
153     eautoreconf
154     }
155    
156     grub_configure() {
157     local platform
158 floppym 1.75
159 floppym 1.89 case ${MULTIBUILD_VARIANT} in
160     efi-32)
161     platform=efi
162     if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
163     local CTARGET=${CTARGET:-i386}
164     fi ;;
165     efi-64)
166     platform=efi
167     if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
168     local CTARGET=${CTARGET:-x86_64}
169     local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
170     local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
171     export TARGET_CFLAGS TARGET_CPPFLAGS
172     fi ;;
173     guessed) ;;
174     *) platform=${MULTIBUILD_VARIANT} ;;
175     esac
176 floppym 1.65
177 floppym 1.89 local myeconfargs=(
178     --disable-werror
179     --program-prefix=
180 floppym 1.90 --libdir="${EPREFIX}"/usr/lib
181     --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
182 floppym 1.89 $(use_enable debug mm-debug)
183     $(use_enable debug grub-emu-usb)
184     $(use_enable efiemu)
185     $(use_enable mount grub-mount)
186     $(use_enable nls)
187     $(use_enable truetype grub-mkfont)
188     $(use_enable libzfs)
189     $(use sdl && use_enable debug grub-emu-sdl)
190     ${platform:+--with-platform=}${platform}
191     )
192 vapier 1.7
193 floppym 1.89 if use multislot; then
194     myeconfargs+=(
195     --program-transform-name="s,grub,grub2,"
196     --with-grubdir=grub2
197     )
198 vapier 1.17 fi
199 vapier 1.34
200 floppym 1.89 autotools-utils_src_configure
201 vapier 1.6 }
202    
203 vapier 1.33 src_configure() {
204 floppym 1.76 use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
205 vapier 1.1 use static && append-ldflags -static
206    
207 floppym 1.89 tc-export CC NM OBJCOPY STRIP
208     export TARGET_CC=${TARGET_CC:-${CC}}
209 floppym 1.74
210 floppym 1.89 # Portage will take care of cleaning up GRUB_PLATFORMS
211     MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
212     multibuild_parallel_foreach_variant grub_configure
213 vapier 1.33 }
214    
215     src_compile() {
216 floppym 1.94 # Sandbox bug 404013.
217     use libzfs && addpredict /etc/dfs:/dev/zfs
218    
219 floppym 1.89 multibuild_foreach_variant autotools-utils_src_compile
220 floppym 1.79
221 floppym 1.89 use doc && multibuild_for_best_variant \
222     autotools-utils_src_compile -C docs html
223 vapier 1.1 }
224    
225 floppym 1.91 src_test() {
226 floppym 1.92 # The qemu dependency is a bit complex.
227     # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
228 floppym 1.91 multibuild_foreach_variant autotools-utils_src_test
229     }
230    
231 vapier 1.1 src_install() {
232 floppym 1.89 multibuild_foreach_variant autotools-utils_src_install \
233 floppym 1.95 bashcompletiondir="$(get_bashcompdir)"
234 scarabeus 1.37
235 floppym 1.89 use doc && multibuild_for_best_variant run_in_build_dir \
236     emake -C docs DESTDIR="${D}" install-html
237 scarabeus 1.37
238 floppym 1.89 if use multislot; then
239 floppym 1.90 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
240 floppym 1.89 fi
241 alexxy 1.40
242 scarabeus 1.37 insinto /etc/default
243 scarabeus 1.69 newins "${FILESDIR}"/grub.default-2 grub
244 scarabeus 1.44
245 floppym 1.89 cd "${ED}" || die
246     pax-mark mpes $(scanelf -BF %F usr/{bin,sbin})
247 floppym 1.86 }
248    
249 floppym 1.50 pkg_postinst() {
250     elog "For information on how to configure grub-2 please refer to the guide:"
251 floppym 1.60 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
252 floppym 1.89 if [[ -z ${REPLACING_VERSIONS} ]]; then
253     if ! has_version sys-boot/os-prober; then
254     elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
255     fi
256     if ! has_version dev-libs/libisoburn; then
257     elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
258     fi
259 floppym 1.86 fi
260 vapier 1.3 }

  ViewVC Help
Powered by ViewVC 1.1.20