1 |
commit: d32794f6d9f1b9aafa7b89b9162eb1b7083252b6 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 27 08:31:35 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 27 08:31:52 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d32794f6 |
7 |
|
8 |
sys-boot/elilo: pass *FLAGS to eliloalt |
9 |
|
10 |
The primary build target is a PE-EFI target. |
11 |
But auxiliary binaries are native binaries. |
12 |
|
13 |
Provide NATIVE_* variables to pass native opt flags. |
14 |
|
15 |
Reported-by: Agostino Sarubbo |
16 |
Closes: https://bugs.gentoo.org/744931 |
17 |
Package-Manager: Portage-3.0.8, Repoman-3.0.1 |
18 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
19 |
|
20 |
sys-boot/elilo/elilo-3.16-r4.ebuild | 93 +++++++++++++++++++++++++++++ |
21 |
sys-boot/elilo/files/elilo-3.16-FLAGS.patch | 19 ++++++ |
22 |
2 files changed, 112 insertions(+) |
23 |
|
24 |
diff --git a/sys-boot/elilo/elilo-3.16-r4.ebuild b/sys-boot/elilo/elilo-3.16-r4.ebuild |
25 |
new file mode 100644 |
26 |
index 00000000000..c4cd5a90dd8 |
27 |
--- /dev/null |
28 |
+++ b/sys-boot/elilo/elilo-3.16-r4.ebuild |
29 |
@@ -0,0 +1,93 @@ |
30 |
+# Copyright 1999-2020 Gentoo Authors |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=6 |
34 |
+ |
35 |
+inherit toolchain-funcs eutils multilib |
36 |
+ |
37 |
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64" |
38 |
+HOMEPAGE="https://sourceforge.net/projects/elilo/" |
39 |
+SRC_URI="mirror://sourceforge/elilo/${P}-all.tar.gz |
40 |
+ mirror://debian/pool/main/e/elilo/elilo_3.14-3.debian.tar.gz" |
41 |
+ |
42 |
+LICENSE="GPL-2" |
43 |
+SLOT="0" |
44 |
+KEYWORDS="~amd64 ~ia64 ~x86" |
45 |
+IUSE="" |
46 |
+ |
47 |
+# gnu-efi contains only static libs, so there's no run-time dep on it |
48 |
+DEPEND=">=sys-boot/gnu-efi-3.0g |
49 |
+ dev-util/patchutils" |
50 |
+# dosfstools[compat] to enable 'dosfsck' symlink |
51 |
+RDEPEND="sys-boot/efibootmgr |
52 |
+ sys-fs/dosfstools[compat]" |
53 |
+ |
54 |
+S="${WORKDIR}/${P}-source" |
55 |
+ |
56 |
+PATCHES=( |
57 |
+ "${FILESDIR}"/${PN}-3.16-elilo-loop.patch #299665 |
58 |
+ "${FILESDIR}"/${PN}-3.16-gnu-efi-3.0.6-ia64.patch |
59 |
+ "${FILESDIR}"/${PN}-3.16-strncpy-clash.patch |
60 |
+ "${FILESDIR}"/${PN}-3.16-FLAGS.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 |
+ OBJCOPY="$(tc-getOBJCOPY)" \ |
100 |
+ HOSTARCH=${iarch} \ |
101 |
+ ARCH=${iarch} \ |
102 |
+ EFIINC="${SYSROOT}${EPREFIX}/usr/include/efi" \ |
103 |
+ GNUEFILIB="${libdir}" \ |
104 |
+ EFILIB="${libdir}" \ |
105 |
+ EFICRT0="${libdir}" \ |
106 |
+ NATIVE_CFLAGS="${CFLAGS}" \ |
107 |
+ NATIVE_LDFLAGS="${LDFLAGS}" |
108 |
+} |
109 |
+ |
110 |
+src_install() { |
111 |
+ exeinto /usr/lib/elilo |
112 |
+ doexe elilo.efi |
113 |
+ |
114 |
+ newsbin debian/elilo.sh elilo |
115 |
+ dosbin tools/eliloalt |
116 |
+ |
117 |
+ insinto /etc |
118 |
+ newins "${FILESDIR}"/elilo.conf.sample elilo.conf |
119 |
+ |
120 |
+ dodoc docs/* "${FILESDIR}"/elilo.conf.sample |
121 |
+ doman debian/*.[0-9] |
122 |
+} |
123 |
|
124 |
diff --git a/sys-boot/elilo/files/elilo-3.16-FLAGS.patch b/sys-boot/elilo/files/elilo-3.16-FLAGS.patch |
125 |
new file mode 100644 |
126 |
index 00000000000..a77e44d0b18 |
127 |
--- /dev/null |
128 |
+++ b/sys-boot/elilo/files/elilo-3.16-FLAGS.patch |
129 |
@@ -0,0 +1,19 @@ |
130 |
+eliloalt is a rare native tool. Allow user to explicitly pass |
131 |
+standart optimization flags via |
132 |
+ $ make NATIIVE_CFLAGS=${CFLAGS} NATIVE_LDFLAGS |
133 |
+https://bugs.gentoo.org/744931 |
134 |
+--- a/tools/Makefile |
135 |
++++ b/tools/Makefile |
136 |
+@@ -42,10 +42,10 @@ all: $(TARGET) |
137 |
+ # redefine local rule (we build a Linux/ia64 binary here) |
138 |
+ # |
139 |
+ %.o: %.c |
140 |
+- $(CC) $(OPTIMFLAGS) $(DEBUGFLAGS) -c $< -o $@ |
141 |
++ $(CC) $(OPTIMFLAGS) $(NATIVE_CFLAGS) $(DEBUGFLAGS) -c $< -o $@ |
142 |
+ |
143 |
+ $(TARGET): %:%.o |
144 |
+- $(CC) -o $@ $(OPTIMFLAGS) $(DEBUGFLAGS) $^ |
145 |
++ $(CC) -o $@ $(OPTIMFLAGS) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $(DEBUGFLAGS) $^ |
146 |
+ |
147 |
+ clean: |
148 |
+ $(RM) -f $(TARGET) $(FILES) |