/[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.98 - (hide annotations) (download)
Sun Jul 28 17:32:59 2013 UTC (5 years, 2 months ago) by floppym
Branch: MAIN
Changes since 1.97: +5 -2 lines
We don't need autogen with a pristine snapshot.

(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.98 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.97 2013/07/28 17:27:18 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.62 static? (
81     truetype? (
82     app-arch/bzip2[static-libs(+)]
83     media-libs/freetype[static-libs(+)]
84     sys-libs/zlib[static-libs(+)]
85     )
86     )
87 floppym 1.92 test? (
88     dev-libs/libisoburn
89     app-emulation/qemu
90     )
91 scarabeus 1.37 "
92 floppym 1.55 RDEPEND+="
93 floppym 1.86 kernel_linux? (
94     grub_platforms_efi-32? ( sys-boot/efibootmgr )
95     grub_platforms_efi-64? ( sys-boot/efibootmgr )
96     )
97 floppym 1.89 !multislot? ( !sys-boot/grub:0 )
98 floppym 1.55 "
99 scarabeus 1.37
100 floppym 1.98 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
101     DEPEND+=" >=sys-devel/autogen-5.10"
102     fi
103    
104 floppym 1.89 STRIP_MASK="*/grub/*/*.{mod,img}"
105 floppym 1.95 RESTRICT="test"
106 floppym 1.50
107 scarabeus 1.37 QA_EXECSTACK="
108 floppym 1.50 usr/bin/grub*
109     usr/sbin/grub*
110     usr/lib*/grub/*/*.mod
111 floppym 1.89 usr/lib*/grub/*/*.module
112 floppym 1.50 usr/lib*/grub/*/kernel.exec
113     usr/lib*/grub/*/kernel.img
114 scarabeus 1.37 "
115    
116 scarabeus 1.41 QA_WX_LOAD="
117 floppym 1.50 usr/lib*/grub/*/kernel.exec
118     usr/lib*/grub/*/kernel.img
119     usr/lib*/grub/*/*.image
120     "
121    
122     QA_PRESTRIPPED="
123     usr/lib.*/grub/.*/kernel.img
124 scarabeus 1.41 "
125    
126 floppym 1.85 pkg_pretend() {
127     if [[ ${MERGE_TYPE} != binary ]]; then
128     # Bug 439082
129     if $(tc-getLD) --version | grep -q "GNU gold"; then
130     eerror "GRUB does not function correctly when built with the gold linker."
131     eerror "Please select the bfd linker with binutils-config."
132     die "GNU gold detected"
133     fi
134     fi
135     }
136    
137 vapier 1.33 src_prepare() {
138 floppym 1.89 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
139     sed -i -e /autoreconf/d autogen.sh || die
140 floppym 1.95 if use multislot; then
141     # fix texinfo file name, bug 416035
142     sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
143     fi
144 floppym 1.89 epatch_user
145 floppym 1.97 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
146     bash autogen.sh || die
147     autopoint() { return 0; }
148     eautoreconf
149     fi
150 floppym 1.89 }
151    
152     grub_configure() {
153     local platform
154 floppym 1.75
155 floppym 1.89 case ${MULTIBUILD_VARIANT} in
156     efi-32)
157     platform=efi
158     if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
159     local CTARGET=${CTARGET:-i386}
160     fi ;;
161     efi-64)
162     platform=efi
163     if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
164     local CTARGET=${CTARGET:-x86_64}
165     local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
166     local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
167     export TARGET_CFLAGS TARGET_CPPFLAGS
168     fi ;;
169     guessed) ;;
170     *) platform=${MULTIBUILD_VARIANT} ;;
171     esac
172 floppym 1.65
173 floppym 1.89 local myeconfargs=(
174     --disable-werror
175     --program-prefix=
176 floppym 1.90 --libdir="${EPREFIX}"/usr/lib
177     --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
178 floppym 1.89 $(use_enable debug mm-debug)
179     $(use_enable debug grub-emu-usb)
180     $(use_enable mount grub-mount)
181     $(use_enable nls)
182     $(use_enable truetype grub-mkfont)
183     $(use_enable libzfs)
184     $(use sdl && use_enable debug grub-emu-sdl)
185     ${platform:+--with-platform=}${platform}
186 floppym 1.96
187     # Let configure detect this where supported
188     $(usex efiemu '' --disable-efiemu)
189 floppym 1.89 )
190 vapier 1.7
191 floppym 1.89 if use multislot; then
192     myeconfargs+=(
193     --program-transform-name="s,grub,grub2,"
194     --with-grubdir=grub2
195     )
196 vapier 1.17 fi
197 vapier 1.34
198 floppym 1.89 autotools-utils_src_configure
199 vapier 1.6 }
200    
201 vapier 1.33 src_configure() {
202 floppym 1.76 use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
203 vapier 1.1 use static && append-ldflags -static
204    
205 floppym 1.89 tc-export CC NM OBJCOPY STRIP
206     export TARGET_CC=${TARGET_CC:-${CC}}
207 floppym 1.74
208 floppym 1.89 # Portage will take care of cleaning up GRUB_PLATFORMS
209     MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
210     multibuild_parallel_foreach_variant grub_configure
211 vapier 1.33 }
212    
213     src_compile() {
214 floppym 1.94 # Sandbox bug 404013.
215     use libzfs && addpredict /etc/dfs:/dev/zfs
216    
217 floppym 1.89 multibuild_foreach_variant autotools-utils_src_compile
218 floppym 1.79
219 floppym 1.89 use doc && multibuild_for_best_variant \
220     autotools-utils_src_compile -C docs html
221 vapier 1.1 }
222    
223 floppym 1.91 src_test() {
224 floppym 1.92 # The qemu dependency is a bit complex.
225     # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
226 floppym 1.91 multibuild_foreach_variant autotools-utils_src_test
227     }
228    
229 vapier 1.1 src_install() {
230 floppym 1.89 multibuild_foreach_variant autotools-utils_src_install \
231 floppym 1.95 bashcompletiondir="$(get_bashcompdir)"
232 scarabeus 1.37
233 floppym 1.89 use doc && multibuild_for_best_variant run_in_build_dir \
234     emake -C docs DESTDIR="${D}" install-html
235 scarabeus 1.37
236 floppym 1.89 if use multislot; then
237 floppym 1.90 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
238 floppym 1.89 fi
239 alexxy 1.40
240 scarabeus 1.37 insinto /etc/default
241 scarabeus 1.69 newins "${FILESDIR}"/grub.default-2 grub
242 scarabeus 1.44
243 floppym 1.89 cd "${ED}" || die
244     pax-mark mpes $(scanelf -BF %F usr/{bin,sbin})
245 floppym 1.86 }
246    
247 floppym 1.50 pkg_postinst() {
248     elog "For information on how to configure grub-2 please refer to the guide:"
249 floppym 1.60 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
250 floppym 1.89 if [[ -z ${REPLACING_VERSIONS} ]]; then
251     if ! has_version sys-boot/os-prober; then
252     elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
253     fi
254     if ! has_version dev-libs/libisoburn; then
255     elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
256     fi
257 floppym 1.86 fi
258 vapier 1.3 }

  ViewVC Help
Powered by ViewVC 1.1.20