/[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.99 - (hide annotations) (download)
Sun Aug 4 20:42:32 2013 UTC (4 years, 5 months ago) by floppym
Branch: MAIN
Changes since 1.98: +15 -9 lines
New snapshot, resolves bug 468136. Append -fuse-ld=bfd to LDFLAGS for gcc-4.8+ as a workaround for bug 439082.

(Portage version: 2.2.0_alpha193/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.99 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.98 2013/07/28 17:32:59 floppym Exp $
4 vapier 1.21
5 floppym 1.89 EAPI=5
6 floppym 1.97
7     if [[ ${PV} == 9999 ]]; then
8     AUTOTOOLS_AUTORECONF=1
9     fi
10 vapier 1.1
11 floppym 1.99 inherit autotools-utils bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs versionator
12 floppym 1.89
13     if [[ ${PV} != 9999 ]]; then
14 floppym 1.68 if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
15 floppym 1.99 MY_P=${P/_/~}
16 floppym 1.52 SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
17 floppym 1.99 S=${WORKDIR}/${MY_P}
18 floppym 1.50 else
19 floppym 1.99 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 floppym 1.50 fi
24 floppym 1.73 KEYWORDS="~amd64 ~x86"
25 floppym 1.97 PATCHES=()
26 floppym 1.89 else
27     inherit bzr
28     EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
29 vapier 1.1 fi
30    
31 vapier 1.32 DESCRIPTION="GNU GRUB boot loader"
32 vapier 1.1 HOMEPAGE="http://www.gnu.org/software/grub/"
33    
34 vapier 1.4 LICENSE="GPL-3"
35 scarabeus 1.37 SLOT="2"
36 floppym 1.93 IUSE="custom-cflags debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
37 scarabeus 1.37
38 floppym 1.89 GRUB_ALL_PLATFORMS=(
39 vapier 1.47 # 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 floppym 1.56 # amd64, ia64:
48 vapier 1.47 efi-64
49     )
50 floppym 1.89 IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
51 scarabeus 1.37
52 floppym 1.86 REQUIRED_USE="grub_platforms_qemu? ( truetype )
53     grub_platforms_yeeloong? ( truetype )"
54 floppym 1.71
55 scarabeus 1.37 # os-prober: Used on runtime to detect other OSes
56     # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
57     RDEPEND="
58 floppym 1.73 app-arch/xz-utils
59 scarabeus 1.37 >=sys-libs/ncurses-5.2-r5
60 vapier 1.32 debug? (
61     sdl? ( media-libs/libsdl )
62     )
63     device-mapper? ( >=sys-fs/lvm2-2.02.45 )
64 floppym 1.50 libzfs? ( sys-fs/zfs )
65     mount? ( sys-fs/fuse )
66 floppym 1.62 truetype? (
67     media-libs/freetype
68 scarabeus 1.69 media-fonts/dejavu
69 floppym 1.62 >=media-fonts/unifont-5
70     )
71 josejx 1.64 ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
72     ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
73 floppym 1.62 "
74 vapier 1.9 DEPEND="${RDEPEND}
75 floppym 1.89 app-misc/pax-utils
76 mattst88 1.35 >=dev-lang/python-2.5.2
77 scarabeus 1.37 sys-devel/flex
78 floppym 1.70 sys-devel/bison
79 floppym 1.75 sys-apps/help2man
80 flameeyes 1.45 sys-apps/texinfo
81 floppym 1.62 static? (
82     truetype? (
83     app-arch/bzip2[static-libs(+)]
84     media-libs/freetype[static-libs(+)]
85     sys-libs/zlib[static-libs(+)]
86     )
87     )
88 floppym 1.92 test? (
89     dev-libs/libisoburn
90     app-emulation/qemu
91     )
92 scarabeus 1.37 "
93 floppym 1.55 RDEPEND+="
94 floppym 1.86 kernel_linux? (
95     grub_platforms_efi-32? ( sys-boot/efibootmgr )
96     grub_platforms_efi-64? ( sys-boot/efibootmgr )
97     )
98 floppym 1.89 !multislot? ( !sys-boot/grub:0 )
99 floppym 1.55 "
100 scarabeus 1.37
101 floppym 1.98 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
102     DEPEND+=" >=sys-devel/autogen-5.10"
103     fi
104    
105 floppym 1.89 STRIP_MASK="*/grub/*/*.{mod,img}"
106 floppym 1.95 RESTRICT="test"
107 floppym 1.50
108 scarabeus 1.37 QA_EXECSTACK="
109 floppym 1.50 usr/bin/grub*
110     usr/sbin/grub*
111     usr/lib*/grub/*/*.mod
112 floppym 1.89 usr/lib*/grub/*/*.module
113 floppym 1.50 usr/lib*/grub/*/kernel.exec
114     usr/lib*/grub/*/kernel.img
115 scarabeus 1.37 "
116    
117 scarabeus 1.41 QA_WX_LOAD="
118 floppym 1.50 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 scarabeus 1.41 "
126    
127 floppym 1.85 pkg_pretend() {
128     if [[ ${MERGE_TYPE} != binary ]]; then
129     # Bug 439082
130 floppym 1.99 if ! version_is_at_least 4.8 "$(gcc-version)" &&
131     $(tc-getLD) --version | grep -q "GNU gold"; then
132 floppym 1.85 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 vapier 1.33 src_prepare() {
140 floppym 1.89 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
141     sed -i -e /autoreconf/d autogen.sh || die
142 floppym 1.95 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 floppym 1.89 epatch_user
147 floppym 1.97 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
148     bash autogen.sh || die
149     autopoint() { return 0; }
150     eautoreconf
151     fi
152 floppym 1.89 }
153    
154     grub_configure() {
155     local platform
156 floppym 1.75
157 floppym 1.89 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 floppym 1.65
175 floppym 1.89 local myeconfargs=(
176     --disable-werror
177     --program-prefix=
178 floppym 1.90 --libdir="${EPREFIX}"/usr/lib
179     --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
180 floppym 1.89 $(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 floppym 1.96
189     # Let configure detect this where supported
190 floppym 1.99 $(usex efiemu '' '--disable-efiemu')
191 floppym 1.89 )
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.99 if version_is_at_least 4.8 "$(gcc-version)"; then
208     export TARGET_LDFLAGS+=" -fuse-ld=bfd"
209     fi
210    
211 floppym 1.89 tc-export CC NM OBJCOPY STRIP
212     export TARGET_CC=${TARGET_CC:-${CC}}
213 floppym 1.74
214 floppym 1.89 # Portage will take care of cleaning up GRUB_PLATFORMS
215     MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
216     multibuild_parallel_foreach_variant grub_configure
217 vapier 1.33 }
218    
219     src_compile() {
220 floppym 1.94 # Sandbox bug 404013.
221     use libzfs && addpredict /etc/dfs:/dev/zfs
222    
223 floppym 1.89 multibuild_foreach_variant autotools-utils_src_compile
224 floppym 1.79
225 floppym 1.89 use doc && multibuild_for_best_variant \
226     autotools-utils_src_compile -C docs html
227 vapier 1.1 }
228    
229 floppym 1.91 src_test() {
230 floppym 1.92 # The qemu dependency is a bit complex.
231     # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
232 floppym 1.91 multibuild_foreach_variant autotools-utils_src_test
233     }
234    
235 vapier 1.1 src_install() {
236 floppym 1.89 multibuild_foreach_variant autotools-utils_src_install \
237 floppym 1.95 bashcompletiondir="$(get_bashcompdir)"
238 scarabeus 1.37
239 floppym 1.89 use doc && multibuild_for_best_variant run_in_build_dir \
240     emake -C docs DESTDIR="${D}" install-html
241 scarabeus 1.37
242 floppym 1.89 if use multislot; then
243 floppym 1.90 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
244 floppym 1.89 fi
245 alexxy 1.40
246 scarabeus 1.37 insinto /etc/default
247 scarabeus 1.69 newins "${FILESDIR}"/grub.default-2 grub
248 scarabeus 1.44
249 floppym 1.89 cd "${ED}" || die
250     pax-mark mpes $(scanelf -BF %F usr/{bin,sbin})
251 floppym 1.86 }
252    
253 floppym 1.50 pkg_postinst() {
254     elog "For information on how to configure grub-2 please refer to the guide:"
255 floppym 1.60 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
256 floppym 1.89 if [[ -z ${REPLACING_VERSIONS} ]]; then
257     if ! has_version sys-boot/os-prober; then
258     elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
259     fi
260     if ! has_version dev-libs/libisoburn; then
261     elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
262     fi
263 floppym 1.86 fi
264 vapier 1.3 }

  ViewVC Help
Powered by ViewVC 1.1.20