/[gentoo-x86]/sys-boot/grub/grub-2.02_beta2-r3.ebuild
Gentoo

Contents of /sys-boot/grub/grub-2.02_beta2-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Wed Apr 8 20:32:47 2015 UTC (3 years, 8 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +2 -2 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-2.02_beta2-r3.ebuild,v 1.9 2015/03/17 18:51:49 floppym Exp $
4
5 EAPI=5
6
7 AUTOTOOLS_AUTORECONF=1
8 GRUB_AUTOGEN=1
9
10 if [[ -n ${GRUB_AUTOGEN} ]]; then
11 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
12 inherit python-any-r1
13 fi
14
15 inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
16
17 if [[ ${PV} != 9999 ]]; then
18 if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
19 # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
20 MY_P=${P/_/'~'}
21 SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz
22 http://dev.gentoo.org/~floppym/dist/${P}-gentoo.tar.xz"
23 S=${WORKDIR}/${MY_P}
24 else
25 SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
26 http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
27 S=${WORKDIR}/${P%_*}
28 fi
29 KEYWORDS="amd64 x86"
30 PATCHES=()
31 else
32 inherit git-r3
33 EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
34 http://git.savannah.gnu.org/r/grub.git"
35 fi
36
37 DEJAVU=dejavu-sans-ttf-2.34
38 UNIFONT=unifont-7.0.01
39 SRC_URI+=" mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz
40 truetype? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
41
42 DESCRIPTION="GNU GRUB boot loader"
43 HOMEPAGE="http://www.gnu.org/software/grub/"
44
45 # Includes licenses for dejavu and unifont
46 LICENSE="GPL-3 truetype? ( BitstreamVera GPL-2-with-font-exception )"
47 SLOT="2"
48 IUSE="debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
49
50 GRUB_ALL_PLATFORMS=(
51 # everywhere:
52 emu
53 # mips only:
54 qemu-mips loongson
55 # amd64, x86, ppc, ppc64:
56 ieee1275
57 # amd64, x86:
58 coreboot multiboot efi-32 pc qemu xen
59 # amd64, ia64:
60 efi-64
61 )
62 IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
63
64 # os-prober: Used on runtime to detect other OSes
65 # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
66 RDEPEND="
67 app-arch/xz-utils
68 >=sys-libs/ncurses-5.2-r5
69 debug? (
70 sdl? ( media-libs/libsdl )
71 )
72 device-mapper? ( >=sys-fs/lvm2-2.02.45 )
73 libzfs? ( sys-fs/zfs )
74 mount? ( sys-fs/fuse )
75 truetype? ( media-libs/freetype:2= )
76 ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
77 ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
78 "
79 DEPEND="${RDEPEND}
80 ${PYTHON_DEPS}
81 app-misc/pax-utils
82 sys-devel/flex
83 sys-devel/bison
84 sys-apps/help2man
85 sys-apps/texinfo
86 grub_platforms_coreboot? ( media-libs/freetype:2 )
87 grub_platforms_qemu? ( media-libs/freetype:2 )
88 grub_platforms_ieee1275? ( media-libs/freetype:2 )
89 grub_platforms_loongson? ( media-libs/freetype:2 )
90 grub_platforms_xen? ( app-emulation/xen-tools )
91 static? (
92 app-arch/xz-utils[static-libs(+)]
93 truetype? (
94 app-arch/bzip2[static-libs(+)]
95 media-libs/freetype[static-libs(+)]
96 sys-libs/zlib[static-libs(+)]
97 )
98 )
99 test? (
100 dev-libs/libisoburn
101 app-emulation/qemu
102 )
103 truetype? ( app-arch/unzip )
104 "
105 RDEPEND+="
106 kernel_linux? (
107 grub_platforms_efi-32? ( sys-boot/efibootmgr )
108 grub_platforms_efi-64? ( sys-boot/efibootmgr )
109 )
110 !multislot? ( !sys-boot/grub:0 )
111 nls? ( sys-devel/gettext )
112 "
113
114 DEPEND+=" !!=media-libs/freetype-2.5.4"
115
116 STRIP_MASK="*/grub/*/*.{mod,img}"
117 RESTRICT="test"
118
119 QA_EXECSTACK="
120 usr/bin/grub*-emu*
121 usr/lib*/grub/*/*.mod
122 usr/lib*/grub/*/*.module
123 usr/lib*/grub/*/kernel.exec
124 usr/lib*/grub/*/kernel.img
125 "
126
127 QA_WX_LOAD="
128 usr/lib*/grub/*/kernel.exec
129 usr/lib*/grub/*/kernel.img
130 usr/lib*/grub/*/*.image
131 "
132
133 QA_PRESTRIPPED="
134 usr/lib.*/grub/.*/kernel.img
135 "
136
137 src_unpack() {
138 if [[ ${PV} == 9999 ]]; then
139 git-r3_src_unpack
140 fi
141 default_src_unpack
142 }
143
144 src_prepare() {
145 EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
146
147 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
148
149 sed -i -e /autoreconf/d autogen.sh || die
150
151 if use multislot; then
152 # fix texinfo file name, bug 416035
153 sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
154 fi
155
156 epatch_user
157
158 if [[ -n ${GRUB_AUTOGEN} ]]; then
159 python_setup
160 bash autogen.sh || die
161 fi
162
163 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
164 autopoint() { return 0; }
165 eautoreconf
166 fi
167 }
168
169 setup_fonts() {
170 ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
171 if use truetype; then
172 ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
173 fi
174 }
175
176 grub_configure() {
177 local platform
178
179 case ${MULTIBUILD_VARIANT} in
180 efi-32)
181 platform=efi
182 if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
183 local CTARGET=${CTARGET:-i386}
184 fi ;;
185 efi-64)
186 platform=efi
187 if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
188 local CTARGET=${CTARGET:-x86_64}
189 local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
190 local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
191 export TARGET_CFLAGS TARGET_CPPFLAGS
192 fi ;;
193 guessed) ;;
194 *) platform=${MULTIBUILD_VARIANT} ;;
195 esac
196
197 local myeconfargs=(
198 --disable-werror
199 --program-prefix=
200 --libdir="${EPREFIX}"/usr/lib
201 --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
202 $(use_enable debug mm-debug)
203 $(use_enable debug grub-emu-usb)
204 $(use_enable device-mapper)
205 $(use_enable mount grub-mount)
206 $(use_enable nls)
207 $(use_enable truetype grub-mkfont)
208 $(use_enable libzfs)
209 $(use sdl && use_enable debug grub-emu-sdl)
210 ${platform:+--with-platform=}${platform}
211
212 # Let configure detect this where supported
213 $(usex efiemu '' '--disable-efiemu')
214 )
215
216 if use multislot; then
217 myeconfargs+=( --program-transform-name="s,grub,grub2," )
218 fi
219
220 mkdir -p "${BUILD_DIR}" || die
221 run_in_build_dir setup_fonts
222
223 autotools-utils_src_configure
224 }
225
226 src_configure() {
227 # Bug 508758.
228 replace-flags -O3 -O2
229
230 # We don't want to leak flags onto boot code.
231 export HOST_CCASFLAGS=${CCASFLAGS}
232 export HOST_CFLAGS=${CFLAGS}
233 export HOST_CPPFLAGS=${CPPFLAGS}
234 export HOST_LDFLAGS=${LDFLAGS}
235 unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
236
237 use static && HOST_LDFLAGS+=" -static"
238
239 tc-ld-disable-gold #439082 #466536 #526348
240 export TARGET_LDFLAGS+=" ${LDFLAGS}"
241 unset LDFLAGS
242
243 tc-export CC NM OBJCOPY STRIP
244 export TARGET_CC=${TARGET_CC:-${CC}}
245 tc-export BUILD_CC # Bug 485592
246
247 # Portage will take care of cleaning up GRUB_PLATFORMS
248 MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
249 multibuild_parallel_foreach_variant grub_configure
250 }
251
252 src_compile() {
253 # Sandbox bug 404013.
254 use libzfs && addpredict /etc/dfs:/dev/zfs
255
256 multibuild_foreach_variant autotools-utils_src_compile
257
258 use doc && multibuild_for_best_variant \
259 autotools-utils_src_compile -C docs html
260 }
261
262 src_test() {
263 # The qemu dependency is a bit complex.
264 # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
265 multibuild_foreach_variant autotools-utils_src_test
266 }
267
268 src_install() {
269 multibuild_foreach_variant autotools-utils_src_install \
270 bashcompletiondir="$(get_bashcompdir)"
271
272 use doc && multibuild_for_best_variant run_in_build_dir \
273 emake -C docs DESTDIR="${D}" install-html
274
275 if use multislot; then
276 mv "${ED%/}"/usr/share/info/grub{,2}.info || die
277 fi
278
279 insinto /etc/default
280 newins "${FILESDIR}"/grub.default-3 grub
281 }
282
283 pkg_postinst() {
284 mount-boot_mount_boot_partition
285
286 if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" ]]; then
287 ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
288 ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
289
290 if [[ ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
291 mkdir -p "${ROOT%/}/boot/grub"
292 ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
293 fi
294 fi
295
296 mount-boot_pkg_postinst
297
298 elog "For information on how to configure GRUB2 please refer to the guide:"
299 elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
300
301 if has_version 'sys-boot/grub:0'; then
302 elog "A migration guide for GRUB Legacy users is available:"
303 elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
304 fi
305
306 if [[ -z ${REPLACING_VERSIONS} ]]; then
307 elog
308 elog "You may consider installing the following optional packages:"
309 optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober
310 optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn
311 optfeature "Enable RAID device detection" sys-fs/mdadm
312 fi
313 }

  ViewVC Help
Powered by ViewVC 1.1.20