/[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.97 - (hide annotations) (download)
Sun Jul 28 17:27:18 2013 UTC (5 years, 3 months ago) by floppym
Branch: MAIN
Changes since 1.96: +13 -20 lines
Add new snapshot for bug 468136.

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

  ViewVC Help
Powered by ViewVC 1.1.20