Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/yaboot/, sys-boot/yaboot/files/
Date: Wed, 16 Jan 2019 22:13:53
Message-Id: 1547676815.80e699db21db9352bb9d309c6c9056ffb1902c69.slyfox@gentoo
1 commit: 80e699db21db9352bb9d309c6c9056ffb1902c69
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 16 22:13:26 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 16 22:13:35 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80e699db
7
8 sys-boot/yaboot: bundle e2fsprogs-1.42.13, bug #641560
9
10 By default yaboot setup is unusual: it provides it's own
11 ext2fs headers and links against systems' ext2fs code.
12
13 That occasionally breaks when ext2fs.a gets too much out
14 of sync with expected interface. Pin it to something that
15 was observed to work by Olivier Néumin.
16
17 Reported-by: Paul Osmialowski
18 Bug: https://bugs.gentoo.org/641560
19 Package-Manager: Portage-2.3.56, Repoman-2.3.12
20 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
21
22 sys-boot/yaboot/Manifest | 1 +
23 .../files/e2fsprogs-1.42.13-sysmacros.h.patch | 85 ++++++++++++++++
24 sys-boot/yaboot/yaboot-1.3.17-r3.ebuild | 112 +++++++++++++++++++++
25 3 files changed, 198 insertions(+)
26
27 diff --git a/sys-boot/yaboot/Manifest b/sys-boot/yaboot/Manifest
28 index dac7ca649e1..65faee10607 100644
29 --- a/sys-boot/yaboot/Manifest
30 +++ b/sys-boot/yaboot/Manifest
31 @@ -1,3 +1,4 @@
32 +DIST e2fsprogs-1.42.13.tar.gz 6511931 BLAKE2B 2f849e82ad366f86d9d166f1901a99a8ac0ddc94471a29fb0de9132ae2ba8f8dc0f4c143acf889afdaa1daf1c57e7bf545a2b4e15ebb8463667f2768a8bc2ebb SHA512 d341790f55c3bff34425369063757280b9ba6ac08f405e14f94f299345ae76c0dc6e90871b746cc98c73467448d888fe5bc029688b5eed5fd22c3c37bf285cd0
33 DIST yaboot-1.3.14.tar.gz 219089 BLAKE2B e9f71476502dd61e1e277980eab486b35675f809249e27d72627f6469c75c7ea43740898cc8dc58196bb70d08dce52ef334fcd035ac92c66a4f77236a0371049 SHA512 7542073159a15787e27fd8246fe4c84c48cec5cc6fe76be06f4591bb9ca459ad0c81f0085f08d944745a186da005a5ace0d3d0b2598711ca3309fad1c5a00e74
34 DIST yaboot-1.3.16.tar.gz 220360 BLAKE2B e717b101f14b6178f9fdcd4cf45077c1b9c5db91504f8a000710c02d8b35f6094deb590710c09352fcd18385122a1824b99de5600b176c79da0937fa5b287b0b SHA512 9cd98335c8b32787567253e628549fe88af5ebe4b81fb6b99741fbbcc0ae3b44dc4fdad527ed27da00103bc0482d9a33d3f128f542884387f5aa754546624e14
35 DIST yaboot-1.3.17.tar.gz 224325 BLAKE2B 41f96266f2342eebbfdc3c0eb64eeaf59e55a31d7388f86839cf9318d231ef808d3aa16fb3b3fdfe85a6fca743e191d064f0ed633723f135a7ca25483e460566 SHA512 da910c4c6ca2de817342bf4dbcefe2857606043e614782581a86bae206cf6cfe5597ad47aea15369feb60e02d8a4f9f4aa3b12863d715c757584c1f4d7ffb9de
36
37 diff --git a/sys-boot/yaboot/files/e2fsprogs-1.42.13-sysmacros.h.patch b/sys-boot/yaboot/files/e2fsprogs-1.42.13-sysmacros.h.patch
38 new file mode 100644
39 index 00000000000..8bf887026ea
40 --- /dev/null
41 +++ b/sys-boot/yaboot/files/e2fsprogs-1.42.13-sysmacros.h.patch
42 @@ -0,0 +1,85 @@
43 +From 3fb715b55426875902dfef3056b2cf7335953178 Mon Sep 17 00:00:00 2001
44 +From: Mike Frysinger <vapier@g.o>
45 +Date: Fri, 19 May 2017 13:25:59 -0400
46 +Subject: [PATCH] include sys/sysmacros.h as needed
47 +
48 +The minor/major/makedev macros are not entirely standard. glibc has had
49 +the definitions in sys/sysmacros.h since the start, and wants to move away
50 +from always defining them implicitly via sys/types.h (as this pollutes the
51 +namespace in violation of POSIX). Other C libraries have already dropped
52 +them. Since the configure script already checks for this header, use that
53 +to pull in the header in files that use these macros.
54 +
55 +Signed-off-by: Mike Frysinger <vapier@g.o>
56 +Signed-off-by: Theodore Ts'o <tytso@×××.edu>
57 +---
58 + lib/blkid/devname.c | 3 +++
59 + lib/blkid/devno.c | 3 +++
60 + lib/ext2fs/finddev.c | 3 +++
61 + lib/ext2fs/ismounted.c | 3 +++
62 + misc/mk_hugefiles.c | 3 +++
63 + 7 files changed, 22 insertions(+)
64 +
65 +--- a/lib/blkid/devname.c
66 ++++ b/lib/blkid/devname.c
67 +@@ -36,6 +36,9 @@
68 + #if HAVE_SYS_MKDEV_H
69 + #include <sys/mkdev.h>
70 + #endif
71 ++#ifdef HAVE_SYS_SYSMACROS_H
72 ++#include <sys/sysmacros.h>
73 ++#endif
74 + #include <time.h>
75 +
76 + #include "blkidP.h"
77 +--- a/lib/blkid/devno.c
78 ++++ b/lib/blkid/devno.c
79 +@@ -31,6 +31,9 @@
80 + #if HAVE_SYS_MKDEV_H
81 + #include <sys/mkdev.h>
82 + #endif
83 ++#ifdef HAVE_SYS_SYSMACROS_H
84 ++#include <sys/sysmacros.h>
85 ++#endif
86 +
87 + #include "blkidP.h"
88 +
89 +--- a/lib/ext2fs/finddev.c
90 ++++ b/lib/ext2fs/finddev.c
91 +@@ -31,6 +31,9 @@
92 + #if HAVE_SYS_MKDEV_H
93 + #include <sys/mkdev.h>
94 + #endif
95 ++#ifdef HAVE_SYS_SYSMACROS_H
96 ++#include <sys/sysmacros.h>
97 ++#endif
98 +
99 + #include "ext2_fs.h"
100 + #include "ext2fs.h"
101 +--- a/lib/ext2fs/ismounted.c
102 ++++ b/lib/ext2fs/ismounted.c
103 +@@ -49,6 +49,9 @@
104 + #endif /* HAVE_GETMNTINFO */
105 + #include <string.h>
106 + #include <sys/stat.h>
107 ++#ifdef HAVE_SYS_SYSMACROS_H
108 ++#include <sys/sysmacros.h>
109 ++#endif
110 +
111 + #include "ext2_fs.h"
112 + #include "ext2fs.h"
113 +--- a/misc/mk_hugefiles.c
114 ++++ b/misc/mk_hugefiles.c
115 +@@ -35,6 +35,9 @@ extern int optind;
116 + #include <sys/ioctl.h>
117 + #include <sys/types.h>
118 + #include <sys/stat.h>
119 ++#ifdef HAVE_SYS_SYSMACROS_H
120 ++#include <sys/sysmacros.h>
121 ++#endif
122 + #include <libgen.h>
123 + #include <limits.h>
124 + #include <blkid/blkid.h>
125 +--
126 +2.20.1
127 +
128
129 diff --git a/sys-boot/yaboot/yaboot-1.3.17-r3.ebuild b/sys-boot/yaboot/yaboot-1.3.17-r3.ebuild
130 new file mode 100644
131 index 00000000000..b127a5072d3
132 --- /dev/null
133 +++ b/sys-boot/yaboot/yaboot-1.3.17-r3.ebuild
134 @@ -0,0 +1,112 @@
135 +# Copyright 1999-2019 Gentoo Authors
136 +# Distributed under the terms of the GNU General Public License v2
137 +
138 +EAPI=7
139 +
140 +inherit flag-o-matic toolchain-funcs
141 +
142 +# yaboot is sensitive to external libc dependencies
143 +# of e2fsprogs. Pin to known working versions.
144 +# As a bonus we can control CFLAGS used to build e2fsprogs.
145 +# See compile_bundled_e2fsprogs() below and https://bugs.gentoo.org/641560
146 +E2FS_P="e2fsprogs-1.42.13"
147 +
148 +DESCRIPTION="PPC Bootloader"
149 +HOMEPAGE="http://yaboot.ozlabs.org"
150 +SRC_URI="
151 + http://yaboot.ozlabs.org/releases/${P}.tar.gz
152 + mirror://sourceforge/e2fsprogs/${E2FS_P}.tar.gz
153 +"
154 +
155 +LICENSE="GPL-2"
156 +SLOT="0"
157 +KEYWORDS="-* ~ppc -ppc64"
158 +IUSE="ibm"
159 +
160 +DEPEND="
161 + sys-apps/powerpc-utils
162 +"
163 +RDEPEND="!sys-boot/yaboot-static
164 + !ibm? (
165 + sys-fs/hfsutils
166 + sys-fs/hfsplusutils
167 + sys-fs/mac-fdisk
168 + )"
169 +
170 +PATCHES=(
171 + # dual boot patch
172 + "${FILESDIR}/yabootconfig-1.3.13.patch"
173 + "${FILESDIR}/chrpfix.patch"
174 + "${FILESDIR}/${P}-nopiessp-gcc4.patch"
175 + "${FILESDIR}/${PN}-stubfuncs.patch"
176 +
177 + # Fix the devspec path on newer kernels
178 + "${FILESDIR}/new-ofpath-devspec.patch"
179 +)
180 +
181 +src_prepare() {
182 + # has to be copied before 'new-ofpath-devspec'
183 + cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath" || die
184 + default
185 +
186 + pushd "${WORKDIR}/${E2FS_P}"
187 + eapply "${FILESDIR}"/e2fsprogs-1.42.13-sysmacros.h.patch
188 + popd
189 +
190 + # No need to hardcode this path -- the compiler already knows to use it.
191 + # Error only on real errors, for prom printing format compile failure.
192 + sed -i \
193 + -e 's:-I/usr/include::' \
194 + -e 's:-Werror:-Wno-error:g' \
195 + Makefile || die
196 +
197 + # We'll install bundled libext2fs.a here
198 + DEPS_DIR="${T}"/bundled-deps
199 + export DEPS_DIR
200 +}
201 +
202 +src_configure() {
203 + pushd "${WORKDIR}/${E2FS_P}" || die
204 + econf \
205 + --enable-libblkid \
206 + --enable-libuuid \
207 + --disable-fsck \
208 + --disable-quota
209 + popd
210 +
211 + default
212 +}
213 +
214 +src_compile() {
215 + # Note: we use unmodified host's CFLAGS to build depends.
216 + emake -C "${WORKDIR}/${E2FS_P}" V=1
217 + # install-libs to install libext2fs.a for yaboot to statically link against
218 + emake -C "${WORKDIR}/${E2FS_P}" DESTDIR="${DEPS_DIR}" install-libs V=1
219 +
220 + unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
221 + # -std=gnu90 is needed to preserve 'inline' semantics
222 + # of pre-c99 (always-inline) to avoid duplicate symbol
223 + # definition, bug #641560.
224 + # -L${deps_prefix}/usr/lib is needed to inject known
225 + # working libext2fs.a as yaboot bundles header overrides
226 + # that assume matcking implementation. System's version
227 + # frequently does not work like in bug #641560.
228 + emake \
229 + PREFIX=/usr \
230 + MANDIR=share/man \
231 + CC="$(tc-getCC) -std=gnu90" \
232 + LD="$(tc-getLD) -L${DEPS_DIR}/usr/lib"
233 +}
234 +
235 +src_install() {
236 + sed -i -e 's/\/local//' etc/yaboot.conf || die
237 + emake \
238 + ROOT="${D}" \
239 + PREFIX=/usr \
240 + MANDIR=share/man \
241 + CC="$(tc-getCC) -std=gnu90" \
242 + LD="$(tc-getLD) -L${DEPS_DIR}/usr/lib" \
243 + \
244 + install
245 + mv "${ED}"/etc/yaboot.conf{,.sample} || die
246 +}