/[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.111 - (hide annotations) (download)
Tue Oct 22 20:44:38 2013 UTC (13 months ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Changes since 1.110: +1 -1 lines
FILE REMOVED
Revbump for git migration.

(Portage version: 2.2.7/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.111 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.110 2013/10/22 20:15:04 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.106 inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot 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 floppym 1.110 inherit git-r3
28     EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
29     http://git.savannah.gnu.org/r/grub.git"
30 vapier 1.1 fi
31    
32 vapier 1.32 DESCRIPTION="GNU GRUB boot loader"
33 vapier 1.1 HOMEPAGE="http://www.gnu.org/software/grub/"
34    
35 vapier 1.4 LICENSE="GPL-3"
36 scarabeus 1.37 SLOT="2"
37 floppym 1.93 IUSE="custom-cflags debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
38 scarabeus 1.37
39 floppym 1.89 GRUB_ALL_PLATFORMS=(
40 vapier 1.47 # everywhere:
41     emu
42     # mips only:
43     qemu-mips yeeloong
44     # amd64, x86, ppc, ppc64:
45     ieee1275
46     # amd64, x86:
47     coreboot multiboot efi-32 pc qemu
48 floppym 1.56 # amd64, ia64:
49 vapier 1.47 efi-64
50     )
51 floppym 1.89 IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
52 scarabeus 1.37
53 floppym 1.86 REQUIRED_USE="grub_platforms_qemu? ( truetype )
54     grub_platforms_yeeloong? ( truetype )"
55 floppym 1.71
56 scarabeus 1.37 # os-prober: Used on runtime to detect other OSes
57     # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
58     RDEPEND="
59 floppym 1.73 app-arch/xz-utils
60 scarabeus 1.37 >=sys-libs/ncurses-5.2-r5
61 vapier 1.32 debug? (
62     sdl? ( media-libs/libsdl )
63     )
64     device-mapper? ( >=sys-fs/lvm2-2.02.45 )
65 floppym 1.50 libzfs? ( sys-fs/zfs )
66     mount? ( sys-fs/fuse )
67 floppym 1.62 truetype? (
68     media-libs/freetype
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 floppym 1.108 app-arch/xz-utils[static-libs(+)]
82 floppym 1.62 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 floppym 1.109 truetype? (
93     media-fonts/dejavu
94     >=media-fonts/unifont-5
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.98 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
106     DEPEND+=" >=sys-devel/autogen-5.10"
107     fi
108    
109 floppym 1.89 STRIP_MASK="*/grub/*/*.{mod,img}"
110 floppym 1.95 RESTRICT="test"
111 floppym 1.50
112 scarabeus 1.37 QA_EXECSTACK="
113 floppym 1.50 usr/bin/grub*
114     usr/sbin/grub*
115     usr/lib*/grub/*/*.mod
116 floppym 1.89 usr/lib*/grub/*/*.module
117 floppym 1.50 usr/lib*/grub/*/kernel.exec
118     usr/lib*/grub/*/kernel.img
119 scarabeus 1.37 "
120    
121 scarabeus 1.41 QA_WX_LOAD="
122 floppym 1.50 usr/lib*/grub/*/kernel.exec
123     usr/lib*/grub/*/kernel.img
124     usr/lib*/grub/*/*.image
125     "
126    
127     QA_PRESTRIPPED="
128     usr/lib.*/grub/.*/kernel.img
129 scarabeus 1.41 "
130    
131 floppym 1.85 pkg_pretend() {
132     if [[ ${MERGE_TYPE} != binary ]]; then
133     # Bug 439082
134 floppym 1.99 if ! version_is_at_least 4.8 "$(gcc-version)" &&
135     $(tc-getLD) --version | grep -q "GNU gold"; then
136 floppym 1.85 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 floppym 1.97 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
152     bash autogen.sh || die
153     autopoint() { return 0; }
154     eautoreconf
155     fi
156 floppym 1.89 }
157    
158     grub_configure() {
159     local platform
160 floppym 1.75
161 floppym 1.89 case ${MULTIBUILD_VARIANT} in
162     efi-32)
163     platform=efi
164     if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
165     local CTARGET=${CTARGET:-i386}
166     fi ;;
167     efi-64)
168     platform=efi
169     if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
170     local CTARGET=${CTARGET:-x86_64}
171     local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
172     local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
173     export TARGET_CFLAGS TARGET_CPPFLAGS
174     fi ;;
175     guessed) ;;
176     *) platform=${MULTIBUILD_VARIANT} ;;
177     esac
178 floppym 1.65
179 floppym 1.89 local myeconfargs=(
180     --disable-werror
181     --program-prefix=
182 floppym 1.90 --libdir="${EPREFIX}"/usr/lib
183     --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
184 floppym 1.89 $(use_enable debug mm-debug)
185     $(use_enable debug grub-emu-usb)
186 floppym 1.108 $(use_enable device-mapper)
187 floppym 1.89 $(use_enable mount grub-mount)
188     $(use_enable nls)
189     $(use_enable truetype grub-mkfont)
190     $(use_enable libzfs)
191     $(use sdl && use_enable debug grub-emu-sdl)
192     ${platform:+--with-platform=}${platform}
193 floppym 1.96
194     # Let configure detect this where supported
195 patrick 1.100 $(usex efiemu '' '--disable-efiemu')
196 floppym 1.89 )
197 vapier 1.7
198 floppym 1.89 if use multislot; then
199 floppym 1.101 myeconfargs+=( --program-transform-name="s,grub,grub2," )
200 vapier 1.17 fi
201 vapier 1.34
202 floppym 1.89 autotools-utils_src_configure
203 vapier 1.6 }
204    
205 vapier 1.33 src_configure() {
206 floppym 1.76 use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
207 floppym 1.108 use static && export HOST_LDFLAGS="${HOST_LDFLAGS} -static"
208 vapier 1.1
209 floppym 1.99 if version_is_at_least 4.8 "$(gcc-version)"; then
210     export TARGET_LDFLAGS+=" -fuse-ld=bfd"
211     fi
212    
213 floppym 1.89 tc-export CC NM OBJCOPY STRIP
214     export TARGET_CC=${TARGET_CC:-${CC}}
215 floppym 1.104 tc-export BUILD_CC # Bug 485592
216 floppym 1.74
217 floppym 1.89 # Portage will take care of cleaning up GRUB_PLATFORMS
218     MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
219     multibuild_parallel_foreach_variant grub_configure
220 vapier 1.33 }
221    
222     src_compile() {
223 floppym 1.94 # Sandbox bug 404013.
224     use libzfs && addpredict /etc/dfs:/dev/zfs
225    
226 floppym 1.89 multibuild_foreach_variant autotools-utils_src_compile
227 floppym 1.79
228 floppym 1.89 use doc && multibuild_for_best_variant \
229     autotools-utils_src_compile -C docs html
230 vapier 1.1 }
231    
232 floppym 1.91 src_test() {
233 floppym 1.92 # The qemu dependency is a bit complex.
234     # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
235 floppym 1.91 multibuild_foreach_variant autotools-utils_src_test
236     }
237    
238 vapier 1.1 src_install() {
239 floppym 1.89 multibuild_foreach_variant autotools-utils_src_install \
240 floppym 1.95 bashcompletiondir="$(get_bashcompdir)"
241 scarabeus 1.37
242 floppym 1.89 use doc && multibuild_for_best_variant run_in_build_dir \
243     emake -C docs DESTDIR="${D}" install-html
244 scarabeus 1.37
245 floppym 1.89 if use multislot; then
246 floppym 1.90 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
247 floppym 1.89 fi
248 alexxy 1.40
249 scarabeus 1.37 insinto /etc/default
250 scarabeus 1.69 newins "${FILESDIR}"/grub.default-2 grub
251 scarabeus 1.44
252 floppym 1.89 cd "${ED}" || die
253     pax-mark mpes $(scanelf -BF %F usr/{bin,sbin})
254 floppym 1.86 }
255    
256 floppym 1.50 pkg_postinst() {
257 floppym 1.107 mount-boot_mount_boot_partition
258    
259 floppym 1.106 if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" && ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
260     mkdir -p "${ROOT%/}/boot/grub"
261     ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
262     fi
263    
264     mount-boot_pkg_postinst
265    
266 floppym 1.105 elog "For information on how to configure GRUB2 please refer to the guide:"
267 floppym 1.60 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
268 floppym 1.105
269     if has_version 'sys-boot/grub:0'; then
270     elog "A migration guide for GRUB Legacy users is available:"
271     elog " http://www.gentoo.org/doc/en/grub2-migration.xml"
272     fi
273    
274 floppym 1.89 if [[ -z ${REPLACING_VERSIONS} ]]; then
275     if ! has_version sys-boot/os-prober; then
276     elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
277     fi
278     if ! has_version dev-libs/libisoburn; then
279     elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
280     fi
281 floppym 1.101 else
282     local v
283     for v in ${REPLACING_VERSIONS}; do
284     if use multislot && ! version_is_at_least 2.00_p5107-r1 ${v}; then
285     ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
286     ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
287     break
288     fi
289     done
290 floppym 1.86 fi
291 vapier 1.3 }

  ViewVC Help
Powered by ViewVC 1.1.20