1 |
commit: 57568aec7083b445fd1efd2ea4ce91588b82381e |
2 |
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 25 14:34:54 2018 +0000 |
4 |
Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 25 14:35:09 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57568aec |
7 |
|
8 |
media-gfx/splashutils: Fix build failure |
9 |
|
10 |
I think this one is caused by newer glibc, |
11 |
maybe the patch is not optimal but works for me |
12 |
|
13 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
14 |
|
15 |
.../files/splashutils-1.5.4.4-sysmacros.patch | 11 + |
16 |
.../splashutils/splashutils-1.5.4.4-r8.ebuild | 240 +++++++++++++++++++++ |
17 |
2 files changed, 251 insertions(+) |
18 |
|
19 |
diff --git a/media-gfx/splashutils/files/splashutils-1.5.4.4-sysmacros.patch b/media-gfx/splashutils/files/splashutils-1.5.4.4-sysmacros.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..7ed37ea6aff |
22 |
--- /dev/null |
23 |
+++ b/media-gfx/splashutils/files/splashutils-1.5.4.4-sysmacros.patch |
24 |
@@ -0,0 +1,11 @@ |
25 |
+--- src/common.c.old 2018-02-25 22:23:32.382369471 +0800 |
26 |
++++ src/common.c 2018-02-25 22:23:02.236854316 +0800 |
27 |
+@@ -19,6 +19,7 @@ |
28 |
+ #include <termios.h> |
29 |
+ #include <sys/ioctl.h> |
30 |
+ #include <sys/types.h> |
31 |
++#include <sys/sysmacros.h> |
32 |
+ #include <sys/mman.h> |
33 |
+ #include <dirent.h> |
34 |
+ #include <errno.h> |
35 |
+ |
36 |
|
37 |
diff --git a/media-gfx/splashutils/splashutils-1.5.4.4-r8.ebuild b/media-gfx/splashutils/splashutils-1.5.4.4-r8.ebuild |
38 |
new file mode 100644 |
39 |
index 00000000000..7abb3f77e4a |
40 |
--- /dev/null |
41 |
+++ b/media-gfx/splashutils/splashutils-1.5.4.4-r8.ebuild |
42 |
@@ -0,0 +1,240 @@ |
43 |
+# Copyright 1999-2018 Gentoo Foundation |
44 |
+# Distributed under the terms of the GNU General Public License v2 |
45 |
+ |
46 |
+EAPI=5 |
47 |
+inherit autotools eutils multilib toolchain-funcs |
48 |
+ |
49 |
+MISCSPLASH="miscsplashutils-0.1.8" |
50 |
+GENTOOSPLASH="splashutils-gentoo-1.0.17" |
51 |
+V_JPEG="8a" |
52 |
+V_PNG="1.4.3" |
53 |
+V_ZLIB="1.2.3" |
54 |
+V_FT="2.3.12" |
55 |
+ |
56 |
+ZLIBSRC="libs/zlib-${V_ZLIB}" |
57 |
+LPNGSRC="libs/libpng-${V_PNG}" |
58 |
+JPEGSRC="libs/jpeg-${V_JPEG}" |
59 |
+FT2SRC="libs/freetype-${V_FT}" |
60 |
+ |
61 |
+RESTRICT="test" |
62 |
+IUSE="hardened +png +truetype gpm fbcondecor" |
63 |
+ |
64 |
+DESCRIPTION="Framebuffer splash utilities" |
65 |
+HOMEPAGE="https://sourceforge.net/projects/fbsplash.berlios/" |
66 |
+SRC_URI=" |
67 |
+ mirror://sourceforge/fbsplash.berlios/${PN}-lite-${PV}.tar.bz2 |
68 |
+ mirror://sourceforge/fbsplash.berlios/${GENTOOSPLASH}.tar.bz2 |
69 |
+ mirror://gentoo/${MISCSPLASH}.tar.bz2 |
70 |
+ mirror://sourceforge/libpng/libpng-${V_PNG}.tar.bz2 |
71 |
+ ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v${V_JPEG}.tar.gz |
72 |
+ mirror://sourceforge/freetype/freetype-${V_FT}.tar.bz2 |
73 |
+ http://www.gzip.org/zlib/zlib-${V_ZLIB}.tar.bz2 |
74 |
+" |
75 |
+ |
76 |
+LICENSE="GPL-2" |
77 |
+SLOT="0" |
78 |
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
79 |
+ |
80 |
+RDEPEND=" |
81 |
+ gpm? ( sys-libs/gpm[static-libs(+)] ) |
82 |
+ truetype? ( |
83 |
+ >=media-libs/freetype-2[static-libs] |
84 |
+ app-arch/bzip2[static-libs(+)] |
85 |
+ sys-libs/zlib[static-libs(+)] |
86 |
+ ) |
87 |
+ png? ( |
88 |
+ >=media-libs/libpng-1.4.3[static-libs] |
89 |
+ sys-libs/zlib[static-libs(+)] |
90 |
+ ) |
91 |
+ virtual/jpeg:0[static-libs] |
92 |
+ app-arch/cpio |
93 |
+ media-gfx/fbgrab |
94 |
+ !sys-apps/lcdsplash |
95 |
+ sys-apps/openrc" |
96 |
+ |
97 |
+DEPEND="${RDEPEND} |
98 |
+ >=dev-libs/klibc-1.5 |
99 |
+ virtual/pkgconfig |
100 |
+" |
101 |
+ |
102 |
+S="${WORKDIR}/${P/_/-}" |
103 |
+SG="${WORKDIR}/${GENTOOSPLASH}" |
104 |
+SM="${WORKDIR}/${MISCSPLASH}" |
105 |
+ |
106 |
+pkg_setup() { |
107 |
+ if use hardened; then |
108 |
+ ewarn "Due to problems with klibc, it is currently impossible to compile splashutils" |
109 |
+ ewarn "with 'hardened' GCC flags. As a workaround, the package will be compiled with" |
110 |
+ ewarn "-fno-stack-protector. Hardened GCC features will not be used while building" |
111 |
+ ewarn "the splash kernel helper." |
112 |
+ fi |
113 |
+} |
114 |
+ |
115 |
+src_prepare() { |
116 |
+ mv "${WORKDIR}"/{libpng-${V_PNG},jpeg-${V_JPEG},zlib-${V_ZLIB},freetype-${V_FT}} "${S}/libs" |
117 |
+ |
118 |
+ # We need to delete the Makefile and let it be rebuilt when splashutils |
119 |
+ # is being configured. Either that, or we end up with a segfaulting kernel |
120 |
+ # helper. |
121 |
+ rm "${S}/libs/zlib-${V_ZLIB}/Makefile" |
122 |
+ |
123 |
+ cd "${SG}" |
124 |
+ epatch "${FILESDIR}/splashutils-1.5.4.4-gentoo-typo-fix.patch" |
125 |
+ epatch "${FILESDIR}/splashutils-1.5.4.4-sys-queue.patch" |
126 |
+ |
127 |
+ if use truetype ; then |
128 |
+ cd "${SM}" |
129 |
+ epatch "${FILESDIR}/splashutils-1.5.4.4-freetype-bz2.patch" |
130 |
+ cd "${WORKDIR}" |
131 |
+ epatch "${FILESDIR}/splashutils-1.5.4.4-ft25.patch" |
132 |
+ fi |
133 |
+ |
134 |
+ cd "${S}" |
135 |
+ ln -sf "${S}/src" "${WORKDIR}/core" |
136 |
+ |
137 |
+ #epatch "${FILESDIR}/${P}-bzip2.patch" |
138 |
+ epatch "${FILESDIR}/${P}-multi-keyboard.patch" |
139 |
+ # Bug #557126 |
140 |
+ epatch "${FILESDIR}/${P}-no-la.patch" |
141 |
+ |
142 |
+ if ! tc-is-cross-compiler && \ |
143 |
+ has_version "sys-devel/gcc:$(gcc-version)[vanilla]" ; then |
144 |
+ ewarn "Your GCC was built with the 'vanilla' flag set. If you can't compile" |
145 |
+ ewarn "splashutils, you're on your own, as this configuration is not supported." |
146 |
+ else |
147 |
+ # This should make splashutils compile on systems with hardened GCC. |
148 |
+ sed -e 's@K_CFLAGS =@K_CFLAGS = -fno-stack-protector@' -i "${S}/Makefile.in" |
149 |
+ fi |
150 |
+ |
151 |
+ if ! use truetype ; then |
152 |
+ sed -i -e 's/fbtruetype kbd/kbd/' "${SM}/Makefile" |
153 |
+ fi |
154 |
+ |
155 |
+ # Latest version of klibc defined its own version of ferror, so there is |
156 |
+ # not need for the hack in klibc_compat.h |
157 |
+ if has_version ">=dev-libs/klibc-1.5.20"; then |
158 |
+ echo > "libs/klibc_compat.h" |
159 |
+ fi |
160 |
+ |
161 |
+ rm -f m4/* |
162 |
+ epatch_user |
163 |
+ export PKG_CONFIG="pkg-config --static" |
164 |
+ eautoreconf |
165 |
+ epatch "${FILESDIR}"/splashutils-1.5.4.4-sysmacros.patch |
166 |
+} |
167 |
+ |
168 |
+src_configure() { |
169 |
+ tc-export CC |
170 |
+ cd "${SM}" |
171 |
+ emake CC="${CC}" LIB=$(get_libdir) STRIP=true |
172 |
+ |
173 |
+ cd "${S}" |
174 |
+ econf \ |
175 |
+ $(use_with png) \ |
176 |
+ --without-mng \ |
177 |
+ $(use_with gpm) \ |
178 |
+ $(use_with truetype ttf) \ |
179 |
+ $(use_with truetype ttf-kernel) \ |
180 |
+ $(use_enable fbcondecor) \ |
181 |
+ --docdir=/usr/share/doc/${PF} \ |
182 |
+ --with-freetype2-src=${FT2SRC} \ |
183 |
+ --with-jpeg-src=${JPEGSRC} \ |
184 |
+ --with-lpng-src=${LPNGSRC} \ |
185 |
+ --with-zlib-src=${ZLIBSRC} \ |
186 |
+ --with-essential-libdir=/$(get_libdir) |
187 |
+} |
188 |
+ |
189 |
+src_compile() { |
190 |
+ emake CC="${CC}" STRIP="true" |
191 |
+ |
192 |
+ cd "${SG}" |
193 |
+ emake LIB=$(get_libdir) |
194 |
+} |
195 |
+ |
196 |
+src_install() { |
197 |
+ local LIB=$(get_libdir) |
198 |
+ |
199 |
+ cd "${SM}" |
200 |
+ emake DESTDIR="${D}" LIB=${LIB} install |
201 |
+ |
202 |
+ cd "${S}" |
203 |
+ emake DESTDIR="${D}" STRIP="true" install |
204 |
+ |
205 |
+ mv "${D}"/usr/${LIB}/libfbsplash.so* "${D}"/${LIB}/ |
206 |
+ gen_usr_ldscript libfbsplash.so |
207 |
+ |
208 |
+ echo 'CONFIG_PROTECT_MASK="/etc/splash"' > 99splash |
209 |
+ doenvd 99splash |
210 |
+ |
211 |
+ if use fbcondecor ; then |
212 |
+ newinitd "${SG}"/init-fbcondecor fbcondecor |
213 |
+ newconfd "${SG}"/fbcondecor.conf fbcondecor |
214 |
+ fi |
215 |
+ newconfd "${SG}"/splash.conf splash |
216 |
+ |
217 |
+ insinto /usr/share/${PN} |
218 |
+ doins "${SG}"/initrd.splash |
219 |
+ |
220 |
+ insinto /etc/splash |
221 |
+ doins "${SM}"/fbtruetype/luxisri.ttf |
222 |
+ |
223 |
+ cd "${SG}" |
224 |
+ make DESTDIR="${D}" LIB=${LIB} install |
225 |
+ prune_libtool_files |
226 |
+ |
227 |
+ sed -i -e "s#/lib/splash#/${LIB}/splash#" "${D}"/sbin/splash-functions.sh |
228 |
+ keepdir /${LIB}/splash/{tmp,cache,bin,sys} |
229 |
+ dosym /${LIB}/splash/bin/fbres /sbin/fbres |
230 |
+} |
231 |
+ |
232 |
+pkg_preinst() { |
233 |
+ has_version "<${CATEGORY}/${PN}-1.0" |
234 |
+ previous_less_than_1_0=$? |
235 |
+ |
236 |
+ has_version "<${CATEGORY}/${PN}-1.5.3" |
237 |
+ previous_less_than_1_5_3=$? |
238 |
+} |
239 |
+ |
240 |
+pkg_postinst() { |
241 |
+ if has_version sys-fs/devfsd || ! has_version virtual/udev ; then |
242 |
+ elog "This package has been designed with udev in mind. Other solutions, such as" |
243 |
+ elog "devfs or a static /dev tree might work, but are generally discouraged and" |
244 |
+ elog "not supported. If you decide to switch to udev, you might want to have a" |
245 |
+ elog "look at 'The Gentoo udev Guide', which can be found at" |
246 |
+ elog " https://wiki.gentoo.org/wiki/Udev" |
247 |
+ elog "" |
248 |
+ fi |
249 |
+ |
250 |
+ if [[ $previous_less_than_1_0 = 0 ]] ; then |
251 |
+ elog "Since you are upgrading from a pre-1.0 version, please make sure that you" |
252 |
+ elog "rebuild your initrds. You can use the splash_geninitramfs script to do that." |
253 |
+ elog "" |
254 |
+ fi |
255 |
+ |
256 |
+ if [[ $previous_less_than_1_5_3 = 0 ]] && ! use fbcondecor ; then |
257 |
+ elog "Starting with splashutils-1.5.3, support for the fbcondecor kernel patch" |
258 |
+ elog "is optional and dependent on the the 'fbcondecor' USE flag. If you wish" |
259 |
+ elog "to use fbcondecor, run:" |
260 |
+ elog " echo \"media-gfx/splashutils fbcondecor\" >> /etc/portage/package.use" |
261 |
+ elog "and re-emerge splashutils." |
262 |
+ fi |
263 |
+ |
264 |
+ if ! test -f /proc/cmdline || |
265 |
+ ! egrep -q '(console=tty1|CONSOLE=/dev/tty1)' /proc/cmdline ; then |
266 |
+ elog "It is required that you add 'console=tty1' to your kernel" |
267 |
+ elog "command line parameters." |
268 |
+ elog "" |
269 |
+ elog "After these modifications, the relevant part of the kernel command" |
270 |
+ elog "line might look like:" |
271 |
+ elog " splash=silent,fadein,theme:emergence console=tty1" |
272 |
+ elog "" |
273 |
+ fi |
274 |
+ |
275 |
+ if ! has_version 'media-gfx/splash-themes-livecd' && |
276 |
+ ! has_version 'media-gfx/splash-themes-gentoo'; then |
277 |
+ elog "The sample Gentoo themes (emergence, gentoo) have been removed from the" |
278 |
+ elog "core splashutils package. To get some themes you might want to emerge:" |
279 |
+ elog " media-gfx/splash-themes-livecd" |
280 |
+ elog " media-gfx/splash-themes-gentoo" |
281 |
+ fi |
282 |
+} |