/[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.90 - (hide annotations) (download)
Sun Apr 28 23:50:44 2013 UTC (5 years, 5 months ago) by floppym
Branch: MAIN
Changes since 1.89: +4 -4 lines
Minor tweaks.

(Portage version: 2.2.0_alpha173/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.90 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.89 2013/04/28 19:44:09 floppym Exp $
4 vapier 1.21
5 floppym 1.89 EAPI=5
6     AUTOTOOLS_AUTO_DEPEND=yes
7 vapier 1.1
8 floppym 1.89 inherit autotools-utils eutils flag-o-matic multibuild pax-utils toolchain-funcs
9    
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     )
33     else
34     inherit bzr
35     EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
36 vapier 1.1 fi
37    
38 vapier 1.32 DESCRIPTION="GNU GRUB boot loader"
39 vapier 1.1 HOMEPAGE="http://www.gnu.org/software/grub/"
40    
41 vapier 1.4 LICENSE="GPL-3"
42 scarabeus 1.37 SLOT="2"
43 floppym 1.89 IUSE="custom-cflags debug device-mapper doc efiemu mount multislot nls static sdl truetype libzfs"
44 scarabeus 1.37
45 floppym 1.89 GRUB_ALL_PLATFORMS=(
46 vapier 1.47 # everywhere:
47     emu
48     # mips only:
49     qemu-mips yeeloong
50     # amd64, x86, ppc, ppc64:
51     ieee1275
52     # amd64, x86:
53     coreboot multiboot efi-32 pc qemu
54 floppym 1.56 # amd64, ia64:
55 vapier 1.47 efi-64
56     )
57 floppym 1.89 IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
58 scarabeus 1.37
59 floppym 1.86 REQUIRED_USE="grub_platforms_qemu? ( truetype )
60     grub_platforms_yeeloong? ( truetype )"
61 floppym 1.71
62 scarabeus 1.37 # os-prober: Used on runtime to detect other OSes
63     # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
64     RDEPEND="
65 floppym 1.73 app-arch/xz-utils
66 scarabeus 1.37 >=sys-libs/ncurses-5.2-r5
67 vapier 1.32 debug? (
68     sdl? ( media-libs/libsdl )
69     )
70     device-mapper? ( >=sys-fs/lvm2-2.02.45 )
71 floppym 1.50 libzfs? ( sys-fs/zfs )
72     mount? ( sys-fs/fuse )
73 floppym 1.62 truetype? (
74     media-libs/freetype
75 scarabeus 1.69 media-fonts/dejavu
76 floppym 1.62 >=media-fonts/unifont-5
77     )
78 josejx 1.64 ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
79     ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
80 floppym 1.62 "
81 vapier 1.9 DEPEND="${RDEPEND}
82 floppym 1.89 app-misc/pax-utils
83 mattst88 1.35 >=dev-lang/python-2.5.2
84 scarabeus 1.37 sys-devel/flex
85 floppym 1.70 sys-devel/bison
86 floppym 1.75 sys-apps/help2man
87 flameeyes 1.45 sys-apps/texinfo
88 floppym 1.89 >=sys-devel/autogen-5.10
89 floppym 1.62 static? (
90     truetype? (
91     app-arch/bzip2[static-libs(+)]
92     media-libs/freetype[static-libs(+)]
93     sys-libs/zlib[static-libs(+)]
94     )
95     )
96 scarabeus 1.37 "
97 floppym 1.55 RDEPEND+="
98 floppym 1.86 kernel_linux? (
99     grub_platforms_efi-32? ( sys-boot/efibootmgr )
100     grub_platforms_efi-64? ( sys-boot/efibootmgr )
101     )
102 floppym 1.89 !multislot? ( !sys-boot/grub:0 )
103 floppym 1.55 "
104 scarabeus 1.37
105 floppym 1.89 STRIP_MASK="*/grub/*/*.{mod,img}"
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     epatch_user
141     bash autogen.sh || die
142     autopoint() { return 0; }
143     eautoreconf
144     }
145    
146     grub_configure() {
147     local platform
148 floppym 1.75
149 floppym 1.89 case ${MULTIBUILD_VARIANT} in
150     efi-32)
151     platform=efi
152     if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
153     local CTARGET=${CTARGET:-i386}
154     fi ;;
155     efi-64)
156     platform=efi
157     if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
158     local CTARGET=${CTARGET:-x86_64}
159     local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
160     local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
161     export TARGET_CFLAGS TARGET_CPPFLAGS
162     fi ;;
163     guessed) ;;
164     *) platform=${MULTIBUILD_VARIANT} ;;
165     esac
166 floppym 1.65
167 floppym 1.89 local myeconfargs=(
168     --disable-werror
169     --program-prefix=
170 floppym 1.90 --libdir="${EPREFIX}"/usr/lib
171     --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
172 floppym 1.89 $(use_enable debug mm-debug)
173     $(use_enable debug grub-emu-usb)
174     $(use_enable efiemu)
175     $(use_enable mount grub-mount)
176     $(use_enable nls)
177     $(use_enable truetype grub-mkfont)
178     $(use_enable libzfs)
179     $(use sdl && use_enable debug grub-emu-sdl)
180     ${platform:+--with-platform=}${platform}
181     )
182 vapier 1.7
183 floppym 1.89 if use multislot; then
184     myeconfargs+=(
185     --program-transform-name="s,grub,grub2,"
186     --with-grubdir=grub2
187     )
188 vapier 1.17 fi
189 vapier 1.34
190 floppym 1.89 autotools-utils_src_configure
191 vapier 1.6 }
192    
193 vapier 1.33 src_configure() {
194 floppym 1.76 use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
195 vapier 1.1 use static && append-ldflags -static
196    
197 floppym 1.89 tc-export CC NM OBJCOPY STRIP
198     export TARGET_CC=${TARGET_CC:-${CC}}
199 floppym 1.74
200 floppym 1.89 # Portage will take care of cleaning up GRUB_PLATFORMS
201     MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
202     multibuild_parallel_foreach_variant grub_configure
203 vapier 1.33 }
204    
205     src_compile() {
206 floppym 1.89 multibuild_foreach_variant autotools-utils_src_compile
207 floppym 1.79
208 floppym 1.89 use doc && multibuild_for_best_variant \
209     autotools-utils_src_compile -C docs html
210 vapier 1.1 }
211    
212     src_install() {
213 floppym 1.89 multibuild_foreach_variant autotools-utils_src_install \
214     bashcompletiondir=/usr/share/bash-completion
215 scarabeus 1.37
216 floppym 1.89 use doc && multibuild_for_best_variant run_in_build_dir \
217     emake -C docs DESTDIR="${D}" install-html
218 scarabeus 1.37
219 floppym 1.89 if use multislot; then
220 floppym 1.90 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
221 floppym 1.89 fi
222 alexxy 1.40
223 scarabeus 1.37 insinto /etc/default
224 scarabeus 1.69 newins "${FILESDIR}"/grub.default-2 grub
225 scarabeus 1.44
226 floppym 1.89 cd "${ED}" || die
227     pax-mark mpes $(scanelf -BF %F usr/{bin,sbin})
228 floppym 1.86 }
229    
230 floppym 1.50 pkg_postinst() {
231     elog "For information on how to configure grub-2 please refer to the guide:"
232 floppym 1.60 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
233 floppym 1.89 if [[ -z ${REPLACING_VERSIONS} ]]; then
234     if ! has_version sys-boot/os-prober; then
235     elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
236     fi
237     if ! has_version dev-libs/libisoburn; then
238     elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
239     fi
240 floppym 1.86 fi
241 vapier 1.3 }

  ViewVC Help
Powered by ViewVC 1.1.20