Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/
Date: Tue, 08 Jun 2021 19:59:12
Message-Id: 1623182309.5e82d5f6cdbe4735f4ed355d9798de0154bf5d9a.floppym@gentoo
1 commit: 5e82d5f6cdbe4735f4ed355d9798de0154bf5d9a
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 8 19:58:29 2021 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 8 19:58:29 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e82d5f6
7
8 sys-boot/grub: add 2.06
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 sys-boot/grub/Manifest | 1 +
13 sys-boot/grub/grub-2.06.ebuild | 301 +++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 302 insertions(+)
15
16 diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest
17 index aeb888abbb9..f9c1f46a8bb 100644
18 --- a/sys-boot/grub/Manifest
19 +++ b/sys-boot/grub/Manifest
20 @@ -1,3 +1,4 @@
21 DIST dejavu-sans-ttf-2.37.zip 417746 BLAKE2B c8904f3cd5a49370a7dc10e456684c88aeae998a99090bf4d0a5baa4f36cc8fb8f70586cf6d610a5ffeee97261d28c80f55bbe9dcfc3ed796d5c2d60e79adb58 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae
22 +DIST grub-2.06.tar.xz 6581924 BLAKE2B 2a40b9b03d7bb3b9e7b1309ab274d686f01b3c42e7035ebc6e5a0e59a59c3b7362ba518341664b314cb0dbc8222bb10ea05ce09f08ce9d58a293207cb909e417 SHA512 4f11c648f3078567e53fc0c74d5026fdc6da4be27d188975e79d9a4df817ade0fe5ad2ddd694238a07edc45adfa02943d83c57767dd51548102b375e529e8efe
23 DIST grub-2.06~rc1.tar.xz 6543784 BLAKE2B 2cd322db808e09533aa91db3e03147896f3f8a2fb6bcc932161aace2f1bab9fd1ceb8b56eddf2e531413932c1ef407cdaf5aae49c0b26e7c6c308dbf7916685d SHA512 093890b0af71b0d346afb415dec106681fd9e3f2f5bda14093c060b861d55ee1b50c8fb24afd072d24968ebebedde290f8220b0374cbd2b2e4508dfb00924122
24 DIST unifont-12.1.02.pcf.gz 1335424 BLAKE2B 97080312468e3f3c8aa6f49cef08f5622641e8c9c035f3ede1e09d8d98de4e78d3b23c8aba2e8070eb46cbebd2d55e8568e467d7f15f35aa8fc8db792b7e5f14 SHA512 b280b2db7cf5f480b0668c331130dede2c0cc87d5e02e44566b77787113d0f6604d0105522858288f2ac6b8e77df7a2d9878725013a6c778dc5bfb183156e2f0
25
26 diff --git a/sys-boot/grub/grub-2.06.ebuild b/sys-boot/grub/grub-2.06.ebuild
27 new file mode 100644
28 index 00000000000..8046d169817
29 --- /dev/null
30 +++ b/sys-boot/grub/grub-2.06.ebuild
31 @@ -0,0 +1,301 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +if [[ ${PV} == 9999 ]]; then
38 + GRUB_AUTORECONF=1
39 + GRUB_BOOTSTRAP=1
40 +fi
41 +
42 +PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} )
43 +WANT_LIBTOOL=none
44 +
45 +if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
46 + inherit python-any-r1
47 +fi
48 +
49 +if [[ -n ${GRUB_AUTORECONF} ]]; then
50 + inherit autotools
51 +fi
52 +
53 +inherit bash-completion-r1 flag-o-matic multibuild optfeature pax-utils toolchain-funcs
54 +
55 +if [[ ${PV} != 9999 ]]; then
56 + if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
57 + # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
58 + MY_P=${P/_/'~'}
59 + SRC_URI="https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz"
60 + S=${WORKDIR}/${MY_P}
61 + else
62 + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
63 + S=${WORKDIR}/${P%_*}
64 + fi
65 + KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
66 +else
67 + inherit git-r3
68 + EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git"
69 +fi
70 +
71 +PATCHES=(
72 + "${FILESDIR}"/gfxpayload.patch
73 + "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
74 + "${FILESDIR}"/grub-2.06-test-words.patch
75 +)
76 +
77 +DEJAVU=dejavu-sans-ttf-2.37
78 +UNIFONT=unifont-12.1.02
79 +SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
80 + themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
81 +
82 +DESCRIPTION="GNU GRUB boot loader"
83 +HOMEPAGE="https://www.gnu.org/software/grub/"
84 +
85 +# Includes licenses for dejavu and unifont
86 +LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )"
87 +SLOT="2/${PVR}"
88 +IUSE="device-mapper doc efiemu +fonts mount nls sdl test +themes truetype libzfs"
89 +
90 +GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot qemu qemu-mips pc uboot xen xen-32 xen-pvh )
91 +IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
92 +
93 +REQUIRED_USE="
94 + grub_platforms_coreboot? ( fonts )
95 + grub_platforms_qemu? ( fonts )
96 + grub_platforms_ieee1275? ( fonts )
97 + grub_platforms_loongson? ( fonts )
98 +"
99 +
100 +BDEPEND="
101 + ${PYTHON_DEPS}
102 + app-misc/pax-utils
103 + sys-devel/flex
104 + sys-devel/bison
105 + sys-apps/help2man
106 + sys-apps/texinfo
107 + fonts? (
108 + media-libs/freetype:2
109 + virtual/pkgconfig
110 + )
111 + test? (
112 + app-admin/genromfs
113 + app-arch/cpio
114 + app-arch/lzop
115 + app-emulation/qemu
116 + dev-libs/libisoburn
117 + sys-apps/miscfiles
118 + sys-block/parted
119 + sys-fs/squashfs-tools
120 + )
121 + themes? (
122 + app-arch/unzip
123 + media-libs/freetype:2
124 + virtual/pkgconfig
125 + )
126 + truetype? ( virtual/pkgconfig )
127 +"
128 +DEPEND="
129 + app-arch/xz-utils
130 + >=sys-libs/ncurses-5.2-r5:0=
131 + grub_platforms_emu? (
132 + sdl? ( media-libs/libsdl )
133 + )
134 + device-mapper? ( >=sys-fs/lvm2-2.02.45 )
135 + libzfs? ( sys-fs/zfs:= )
136 + mount? ( sys-fs/fuse:0 )
137 + truetype? ( media-libs/freetype:2= )
138 + ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
139 + ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
140 +"
141 +RDEPEND="${DEPEND}
142 + kernel_linux? (
143 + grub_platforms_efi-32? ( sys-boot/efibootmgr )
144 + grub_platforms_efi-64? ( sys-boot/efibootmgr )
145 + )
146 + !sys-boot/grub:0
147 + nls? ( sys-devel/gettext )
148 +"
149 +
150 +RESTRICT="!test? ( test )"
151 +
152 +QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*"
153 +QA_PRESTRIPPED="usr/lib/grub/.*"
154 +QA_MULTILIB_PATHS="usr/lib/grub/.*"
155 +QA_WX_LOAD="usr/lib/grub/*"
156 +
157 +pkg_setup() {
158 + :
159 +}
160 +
161 +src_unpack() {
162 + if [[ ${PV} == 9999 ]]; then
163 + git-r3_src_unpack
164 + pushd "${P}" >/dev/null || die
165 + local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git"
166 + local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}")
167 + git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}"
168 + git-r3_checkout "${GNULIB_URI}" gnulib
169 + popd >/dev/null || die
170 + fi
171 + default
172 +}
173 +
174 +src_prepare() {
175 + default
176 +
177 + sed -i -e /autoreconf/d autogen.sh || die
178 +
179 + if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
180 + python_setup
181 + else
182 + export PYTHON=true
183 + fi
184 +
185 + if [[ -n ${GRUB_BOOTSTRAP} ]]; then
186 + eautopoint --force
187 + AUTOPOINT=: AUTORECONF=: ./bootstrap || die
188 + elif [[ -n ${GRUB_AUTOGEN} ]]; then
189 + ./autogen.sh || die
190 + fi
191 +
192 + if [[ -n ${GRUB_AUTORECONF} ]]; then
193 + eautoreconf
194 + fi
195 +}
196 +
197 +grub_do() {
198 + multibuild_foreach_variant run_in_build_dir "$@"
199 +}
200 +
201 +grub_do_once() {
202 + multibuild_for_best_variant run_in_build_dir "$@"
203 +}
204 +
205 +grub_configure() {
206 + local platform
207 +
208 + case ${MULTIBUILD_VARIANT} in
209 + efi*) platform=efi ;;
210 + xen-pvh) platform=xen_pvh ;;
211 + xen*) platform=xen ;;
212 + guessed) ;;
213 + *) platform=${MULTIBUILD_VARIANT} ;;
214 + esac
215 +
216 + case ${MULTIBUILD_VARIANT} in
217 + *-32)
218 + if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
219 + local CTARGET=i386
220 + fi ;;
221 + *-64)
222 + if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
223 + local CTARGET=x86_64
224 + local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
225 + local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
226 + fi ;;
227 + esac
228 +
229 + local myeconfargs=(
230 + --disable-werror
231 + --program-prefix=
232 + --libdir="${EPREFIX}"/usr/lib
233 + $(use_enable device-mapper)
234 + $(use_enable mount grub-mount)
235 + $(use_enable nls)
236 + $(use_enable themes grub-themes)
237 + $(use_enable truetype grub-mkfont)
238 + $(use_enable libzfs)
239 + $(use_enable sdl grub-emu-sdl)
240 + ${platform:+--with-platform=}${platform}
241 +
242 + # Let configure detect this where supported
243 + $(usex efiemu '' '--disable-efiemu')
244 + )
245 +
246 + if use fonts; then
247 + ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
248 + fi
249 +
250 + if use themes; then
251 + ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
252 + fi
253 +
254 + local ECONF_SOURCE="${S}"
255 + econf "${myeconfargs[@]}"
256 +}
257 +
258 +src_configure() {
259 + # Bug 508758.
260 + replace-flags -O3 -O2
261 +
262 + # We don't want to leak flags onto boot code.
263 + export HOST_CCASFLAGS=${CCASFLAGS}
264 + export HOST_CFLAGS=${CFLAGS}
265 + export HOST_CPPFLAGS=${CPPFLAGS}
266 + export HOST_LDFLAGS=${LDFLAGS}
267 + unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
268 +
269 + tc-ld-disable-gold #439082 #466536 #526348
270 + export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}"
271 + unset LDFLAGS
272 +
273 + tc-export CC NM OBJCOPY RANLIB STRIP
274 + tc-export BUILD_CC BUILD_PKG_CONFIG
275 +
276 + MULTIBUILD_VARIANTS=()
277 + local p
278 + for p in "${GRUB_ALL_PLATFORMS[@]}"; do
279 + use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" )
280 + done
281 + [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed )
282 + grub_do grub_configure
283 +}
284 +
285 +src_compile() {
286 + # Sandbox bug 404013.
287 + use libzfs && addpredict /etc/dfs:/dev/zfs
288 +
289 + grub_do emake
290 + use doc && grub_do_once emake -C docs html
291 +}
292 +
293 +src_test() {
294 + # The qemu dependency is a bit complex.
295 + # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
296 + grub_do emake check
297 +}
298 +
299 +src_install() {
300 + grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)"
301 + use doc && grub_do_once emake -C docs install-html DESTDIR="${D}"
302 +
303 + einstalldocs
304 +
305 + insinto /etc/default
306 + newins "${FILESDIR}"/grub.default-3 grub
307 +
308 + # https://bugs.gentoo.org/231935
309 + dostrip -x /usr/lib/grub
310 +}
311 +
312 +pkg_postinst() {
313 + elog "For information on how to configure GRUB2 please refer to the guide:"
314 + elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
315 +
316 + if has_version 'sys-boot/grub:0'; then
317 + elog "A migration guide for GRUB Legacy users is available:"
318 + elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
319 + fi
320 +
321 + if [[ -z ${REPLACING_VERSIONS} ]]; then
322 + elog
323 + optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober
324 + optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn
325 + optfeature "enabling RAID device detection" sys-fs/mdadm
326 + fi
327 +
328 + if has_version sys-boot/os-prober; then
329 + ewarn "Due to security concerns, os-prober is disabled by default."
330 + ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it."
331 + fi
332 +}