1 |
commit: e8e25b692b8ae413127a7766ae5c66461b33a864 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 1 22:34:49 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 1 22:35:31 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8e25b69 |
7 |
|
8 |
sys-boot/elilo: fix build failure against gnu-efi-3.0.8 |
9 |
|
10 |
Build failed as: |
11 |
> ./../fs/../strops.h:30:16: error: conflicting types for 'StrnCpy' |
12 |
> extern CHAR16 *StrnCpy(OUT CHAR16 *dst, IN const CHAR16 *src, UINTN count); |
13 |
> ^~~~~~~ |
14 |
|
15 |
Work it around by renaming local 'StrnCpy' definition to 'elilo_StrnCpy'. |
16 |
|
17 |
Reported-by: Bill Glessner |
18 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
19 |
Package-Manager: Portage-2.3.50, Repoman-2.3.11 |
20 |
|
21 |
sys-boot/elilo/elilo-3.16-r3.ebuild | 89 ++++++++++++++++++++++ |
22 |
.../elilo/files/elilo-3.16-strncpy-clash.patch | 23 ++++++ |
23 |
2 files changed, 112 insertions(+) |
24 |
|
25 |
diff --git a/sys-boot/elilo/elilo-3.16-r3.ebuild b/sys-boot/elilo/elilo-3.16-r3.ebuild |
26 |
new file mode 100644 |
27 |
index 00000000000..de13af20f9a |
28 |
--- /dev/null |
29 |
+++ b/sys-boot/elilo/elilo-3.16-r3.ebuild |
30 |
@@ -0,0 +1,89 @@ |
31 |
+# Copyright 1999-2018 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=6 |
35 |
+ |
36 |
+inherit toolchain-funcs eutils multilib |
37 |
+ |
38 |
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64" |
39 |
+HOMEPAGE="https://sourceforge.net/projects/elilo/" |
40 |
+SRC_URI="mirror://sourceforge/elilo/${P}-all.tar.gz |
41 |
+ mirror://debian/pool/main/e/elilo/elilo_3.14-3.debian.tar.gz" |
42 |
+ |
43 |
+LICENSE="GPL-2" |
44 |
+SLOT="0" |
45 |
+KEYWORDS="~amd64 ~ia64 ~x86" |
46 |
+IUSE="" |
47 |
+ |
48 |
+# gnu-efi contains only static libs, so there's no run-time dep on it |
49 |
+DEPEND=">=sys-boot/gnu-efi-3.0g |
50 |
+ dev-util/patchutils" |
51 |
+# dosfstools[compat] to enable 'dosfsck' symlink |
52 |
+RDEPEND="sys-boot/efibootmgr |
53 |
+ sys-fs/dosfstools[compat]" |
54 |
+ |
55 |
+S="${WORKDIR}/${P}-source" |
56 |
+ |
57 |
+PATCHES=( |
58 |
+ "${FILESDIR}"/${PN}-3.16-elilo-loop.patch #299665 |
59 |
+ "${FILESDIR}"/${PN}-3.16-gnu-efi-3.0.6-ia64.patch |
60 |
+ "${FILESDIR}"/${PN}-3.16-strncpy-clash.patch |
61 |
+) |
62 |
+ |
63 |
+src_unpack() { |
64 |
+ unpack ${A} ./${P}-source.tar.gz |
65 |
+ mv debian "${S}"/ || die |
66 |
+} |
67 |
+ |
68 |
+src_prepare() { |
69 |
+ default |
70 |
+ |
71 |
+ case $(tc-arch) in |
72 |
+ ia64) iarch=ia64 ;; |
73 |
+ x86) iarch=ia32 ;; |
74 |
+ amd64) iarch=x86_64 ;; |
75 |
+ *) die "unknown architecture: $(tc-arch)" ;; |
76 |
+ esac |
77 |
+ |
78 |
+ # Now Gentooize it. |
79 |
+ sed -i \ |
80 |
+ -e '1s:/bin/sh:/bin/bash:' \ |
81 |
+ -e "s:##VERSION##:${PV}:" \ |
82 |
+ -e 's:Debian GNU/:Gentoo :g' \ |
83 |
+ -e 's:Debian:Gentoo:g' \ |
84 |
+ -e 's:debian:gentoo:g' \ |
85 |
+ -e "s:dpkg --print-architecture:echo ${iarch}:" \ |
86 |
+ debian/elilo.sh || die |
87 |
+} |
88 |
+ |
89 |
+src_compile() { |
90 |
+ # "prefix" on the next line specifies where to find gcc, as, ld, |
91 |
+ # etc. It's not the usual meaning of "prefix". By blanking it we |
92 |
+ # allow PATH to be searched. |
93 |
+ local libdir="${SYSROOT}${EPREFIX}/usr/$(get_libdir)" |
94 |
+ emake -j1 \ |
95 |
+ prefix= \ |
96 |
+ AS="$(tc-getAS)" \ |
97 |
+ CC="$(tc-getCC)" \ |
98 |
+ LD="$(tc-getLD)" \ |
99 |
+ HOSTARCH=${iarch} \ |
100 |
+ ARCH=${iarch} \ |
101 |
+ EFIINC="${SYSROOT}${EPREFIX}/usr/include/efi" \ |
102 |
+ GNUEFILIB="${libdir}" \ |
103 |
+ EFILIB="${libdir}" \ |
104 |
+ EFICRT0="${libdir}" |
105 |
+} |
106 |
+ |
107 |
+src_install() { |
108 |
+ exeinto /usr/lib/elilo |
109 |
+ doexe elilo.efi |
110 |
+ |
111 |
+ newsbin debian/elilo.sh elilo |
112 |
+ dosbin tools/eliloalt |
113 |
+ |
114 |
+ insinto /etc |
115 |
+ newins "${FILESDIR}"/elilo.conf.sample elilo.conf |
116 |
+ |
117 |
+ dodoc docs/* "${FILESDIR}"/elilo.conf.sample |
118 |
+ doman debian/*.[0-9] |
119 |
+} |
120 |
|
121 |
diff --git a/sys-boot/elilo/files/elilo-3.16-strncpy-clash.patch b/sys-boot/elilo/files/elilo-3.16-strncpy-clash.patch |
122 |
new file mode 100644 |
123 |
index 00000000000..fb2f6878be0 |
124 |
--- /dev/null |
125 |
+++ b/sys-boot/elilo/files/elilo-3.16-strncpy-clash.patch |
126 |
@@ -0,0 +1,23 @@ |
127 |
+gnu-efi-3.0.8 added StrnCpy. This caused conflict with elilo's definition: |
128 |
+ ./../fs/../strops.h:30:16: error: conflicting types for 'StrnCpy' |
129 |
+ extern CHAR16 *StrnCpy(OUT CHAR16 *dst, IN const CHAR16 *src, UINTN count); |
130 |
+ ^~~~~~~ |
131 |
+ |
132 |
+Work it around by always using private copy. |
133 |
+ |
134 |
+Reported-by: Bill Glessner |
135 |
+--- a/strops.h |
136 |
++++ b/strops.h |
137 |
+@@ -29,3 +29,4 @@ |
138 |
+ extern CHAR16 *StrChr(IN const CHAR16 *s, const CHAR16 c); |
139 |
++#define StrnCpy elilo_StrnCpy |
140 |
+ extern CHAR16 *StrnCpy(OUT CHAR16 *dst, IN const CHAR16 *src, UINTN count); |
141 |
+ extern CHAR8 *StrnXCpy(OUT CHAR8 *dst, IN const CHAR16 *src, UINTN count); |
142 |
+--- a/strops.c |
143 |
++++ b/strops.c |
144 |
+@@ -27,4 +27,6 @@ |
145 |
+ #include <efilib.h> |
146 |
+ |
147 |
++#include "strops.h" |
148 |
++ |
149 |
+ //#define CHAR_NULL (CHAR16)'\0' |