Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/emacs/
Date: Sat, 28 Nov 2020 12:19:37
Message-Id: 1606565962.42fbfc55f945efef8291022f02051373df7a4cc5.ulm@gentoo
1 commit: 42fbfc55f945efef8291022f02051373df7a4cc5
2 Author: David Michael <fedora.dm0 <AT> gmail <DOT> com>
3 AuthorDate: Thu Nov 26 22:25:57 2020 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 28 12:19:22 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42fbfc55
7
8 app-editors/emacs: Support cross-compiling since Emacs 27
9
10 Closes: https://bugs.gentoo.org/718760
11 Package-Manager: Portage-3.0.9, Repoman-3.0.2
12 Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
13 [Revision bump, minor formatting tweaks]
14 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
15
16 ...cs-27.1.9999-r1.ebuild => emacs-27.1-r3.ebuild} | 40 ++++++++++++++++++----
17 app-editors/emacs/emacs-27.1.9999-r1.ebuild | 37 ++++++++++++++++----
18 app-editors/emacs/emacs-28.0.9999.ebuild | 37 ++++++++++++++++----
19 3 files changed, 95 insertions(+), 19 deletions(-)
20
21 diff --git a/app-editors/emacs/emacs-27.1.9999-r1.ebuild b/app-editors/emacs/emacs-27.1-r3.ebuild
22 similarity index 91%
23 copy from app-editors/emacs/emacs-27.1.9999-r1.ebuild
24 copy to app-editors/emacs/emacs-27.1-r3.ebuild
25 index 8995971a50a..f97171f9c25 100644
26 --- a/app-editors/emacs/emacs-27.1.9999-r1.ebuild
27 +++ b/app-editors/emacs/emacs-27.1-r3.ebuild
28 @@ -3,7 +3,7 @@
29
30 EAPI=7
31
32 -inherit autotools elisp-common flag-o-matic readme.gentoo-r1
33 +inherit autotools elisp-common flag-o-matic readme.gentoo-r1 toolchain-funcs
34
35 if [[ ${PV##*.} = 9999 ]]; then
36 inherit git-r3
37 @@ -134,6 +134,7 @@ BDEPEND="app-eselect/eselect-emacs
38 gzip-el? ( app-arch/gzip )"
39
40 RDEPEND="${RDEPEND}
41 + !<=app-editors/emacs-27.1.9999-r0:27-vcs
42 !app-editors/emacs-vcs:27
43 app-eselect/eselect-emacs"
44
45 @@ -157,7 +158,7 @@ src_prepare() {
46 # Fix filename reference in redirected man page
47 sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 || die
48
49 - AT_M4DIR=m4 eautoreconf
50 + #AT_M4DIR=m4 eautoreconf
51 }
52
53 src_configure() {
54 @@ -261,6 +262,17 @@ src_configure() {
55 fi
56 fi
57
58 + if tc-is-cross-compiler; then
59 + # Configure a CBUILD directory when cross-compiling to make tools
60 + mkdir "${S}-build" && pushd "${S}-build" >/dev/null || die
61 + ECONF_SOURCE="${S}" econf_build --without-all --without-x-toolkit
62 + popd >/dev/null || die
63 + # Don't try to execute the binary for dumping during the build
64 + myconf+=" --with-dumping=none"
65 + else
66 + myconf+=" --with-dumping=pdumper"
67 + fi
68 +
69 econf \
70 --program-suffix="-${EMACS_SUFFIX}" \
71 --includedir="${EPREFIX}"/usr/include/${EMACS_SUFFIX} \
72 @@ -270,8 +282,8 @@ src_configure() {
73 --without-compress-install \
74 --without-hesiod \
75 --without-pop \
76 - --with-dumping=pdumper \
77 --with-file-notification=$(usev inotify || usev gfile || echo no) \
78 + --with-pdumper \
79 $(use_enable acl) \
80 $(use_with dbus) \
81 $(use_with dynamic-loading modules) \
82 @@ -292,10 +304,19 @@ src_configure() {
83 ${myconf}
84 }
85
86 -#src_compile() {
87 -# # Disable sandbox when dumping. For the unbelievers, see bug #131505
88 -# emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
89 -#}
90 +src_compile() {
91 + if tc-is-cross-compiler; then
92 + # Build native tools for compiling lisp etc.
93 + emake -C "${S}-build" src
94 + emake lib # Cross-compile dependencies first for timestamps
95 + # Save native build tools in the cross-directory
96 + cp "${S}-build"/lib-src/make-{docfile,fingerprint} lib-src || die
97 + # Specify the native Emacs to compile lisp
98 + emake -C lisp all EMACS="${S}-build/src/emacs"
99 + fi
100 +
101 + emake
102 +}
103
104 src_install() {
105 emake DESTDIR="${D}" NO_BIN_LINK=t BLESSMAIL_TARGET= install
106 @@ -401,6 +422,11 @@ src_install() {
107 \"${EPREFIX}/Applications/Gentoo\". You may want to copy or
108 symlink it into /Applications by yourself."
109 fi
110 + tc-is-cross-compiler && DOC_CONTENTS+="\\n\\nEmacs did not write
111 + a portable dump file due to being cross-compiled.
112 + To create this file at run time, execute the following command:
113 + \\n${EMACS_SUFFIX} --batch --eval='(dump-emacs-portable
114 + \"/usr/libexec/emacs/${FULL_VERSION}/${CHOST}/emacs.pdmp\")'"
115 readme.gentoo_create_doc
116 }
117
118
119 diff --git a/app-editors/emacs/emacs-27.1.9999-r1.ebuild b/app-editors/emacs/emacs-27.1.9999-r1.ebuild
120 index 8995971a50a..3b09fd2768c 100644
121 --- a/app-editors/emacs/emacs-27.1.9999-r1.ebuild
122 +++ b/app-editors/emacs/emacs-27.1.9999-r1.ebuild
123 @@ -3,7 +3,7 @@
124
125 EAPI=7
126
127 -inherit autotools elisp-common flag-o-matic readme.gentoo-r1
128 +inherit autotools elisp-common flag-o-matic readme.gentoo-r1 toolchain-funcs
129
130 if [[ ${PV##*.} = 9999 ]]; then
131 inherit git-r3
132 @@ -261,6 +261,17 @@ src_configure() {
133 fi
134 fi
135
136 + if tc-is-cross-compiler; then
137 + # Configure a CBUILD directory when cross-compiling to make tools
138 + mkdir "${S}-build" && pushd "${S}-build" >/dev/null || die
139 + ECONF_SOURCE="${S}" econf_build --without-all --without-x-toolkit
140 + popd >/dev/null || die
141 + # Don't try to execute the binary for dumping during the build
142 + myconf+=" --with-dumping=none"
143 + else
144 + myconf+=" --with-dumping=pdumper"
145 + fi
146 +
147 econf \
148 --program-suffix="-${EMACS_SUFFIX}" \
149 --includedir="${EPREFIX}"/usr/include/${EMACS_SUFFIX} \
150 @@ -270,8 +281,8 @@ src_configure() {
151 --without-compress-install \
152 --without-hesiod \
153 --without-pop \
154 - --with-dumping=pdumper \
155 --with-file-notification=$(usev inotify || usev gfile || echo no) \
156 + --with-pdumper \
157 $(use_enable acl) \
158 $(use_with dbus) \
159 $(use_with dynamic-loading modules) \
160 @@ -292,10 +303,19 @@ src_configure() {
161 ${myconf}
162 }
163
164 -#src_compile() {
165 -# # Disable sandbox when dumping. For the unbelievers, see bug #131505
166 -# emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
167 -#}
168 +src_compile() {
169 + if tc-is-cross-compiler; then
170 + # Build native tools for compiling lisp etc.
171 + emake -C "${S}-build" src
172 + emake lib # Cross-compile dependencies first for timestamps
173 + # Save native build tools in the cross-directory
174 + cp "${S}-build"/lib-src/make-{docfile,fingerprint} lib-src || die
175 + # Specify the native Emacs to compile lisp
176 + emake -C lisp all EMACS="${S}-build/src/emacs"
177 + fi
178 +
179 + emake
180 +}
181
182 src_install() {
183 emake DESTDIR="${D}" NO_BIN_LINK=t BLESSMAIL_TARGET= install
184 @@ -401,6 +421,11 @@ src_install() {
185 \"${EPREFIX}/Applications/Gentoo\". You may want to copy or
186 symlink it into /Applications by yourself."
187 fi
188 + tc-is-cross-compiler && DOC_CONTENTS+="\\n\\nEmacs did not write
189 + a portable dump file due to being cross-compiled.
190 + To create this file at run time, execute the following command:
191 + \\n${EMACS_SUFFIX} --batch --eval='(dump-emacs-portable
192 + \"/usr/libexec/emacs/${FULL_VERSION}/${CHOST}/emacs.pdmp\")'"
193 readme.gentoo_create_doc
194 }
195
196
197 diff --git a/app-editors/emacs/emacs-28.0.9999.ebuild b/app-editors/emacs/emacs-28.0.9999.ebuild
198 index 39d49261783..e6f3ac9b344 100644
199 --- a/app-editors/emacs/emacs-28.0.9999.ebuild
200 +++ b/app-editors/emacs/emacs-28.0.9999.ebuild
201 @@ -3,7 +3,7 @@
202
203 EAPI=7
204
205 -inherit autotools elisp-common flag-o-matic readme.gentoo-r1
206 +inherit autotools elisp-common flag-o-matic readme.gentoo-r1 toolchain-funcs
207
208 if [[ ${PV##*.} = 9999 ]]; then
209 inherit git-r3
210 @@ -260,6 +260,17 @@ src_configure() {
211 fi
212 fi
213
214 + if tc-is-cross-compiler; then
215 + # Configure a CBUILD directory when cross-compiling to make tools
216 + mkdir "${S}-build" && pushd "${S}-build" >/dev/null || die
217 + ECONF_SOURCE="${S}" econf_build --without-all --without-x-toolkit
218 + popd >/dev/null || die
219 + # Don't try to execute the binary for dumping during the build
220 + myconf+=" --with-dumping=none"
221 + else
222 + myconf+=" --with-dumping=pdumper"
223 + fi
224 +
225 econf \
226 --program-suffix="-${EMACS_SUFFIX}" \
227 --includedir="${EPREFIX}"/usr/include/${EMACS_SUFFIX} \
228 @@ -269,8 +280,8 @@ src_configure() {
229 --without-compress-install \
230 --without-hesiod \
231 --without-pop \
232 - --with-dumping=pdumper \
233 --with-file-notification=$(usev inotify || usev gfile || echo no) \
234 + --with-pdumper \
235 $(use_enable acl) \
236 $(use_with dbus) \
237 $(use_with dynamic-loading modules) \
238 @@ -291,10 +302,19 @@ src_configure() {
239 ${myconf}
240 }
241
242 -#src_compile() {
243 -# # Disable sandbox when dumping. For the unbelievers, see bug #131505
244 -# emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
245 -#}
246 +src_compile() {
247 + if tc-is-cross-compiler; then
248 + # Build native tools for compiling lisp etc.
249 + emake -C "${S}-build" src
250 + emake lib # Cross-compile dependencies first for timestamps
251 + # Save native build tools in the cross-directory
252 + cp "${S}-build"/lib-src/make-{docfile,fingerprint} lib-src || die
253 + # Specify the native Emacs to compile lisp
254 + emake -C lisp all EMACS="${S}-build/src/emacs"
255 + fi
256 +
257 + emake
258 +}
259
260 src_install() {
261 emake DESTDIR="${D}" NO_BIN_LINK=t BLESSMAIL_TARGET= install
262 @@ -400,6 +420,11 @@ src_install() {
263 \"${EPREFIX}/Applications/Gentoo\". You may want to copy or
264 symlink it into /Applications by yourself."
265 fi
266 + tc-is-cross-compiler && DOC_CONTENTS+="\\n\\nEmacs did not write
267 + a portable dump file due to being cross-compiled.
268 + To create this file at run time, execute the following command:
269 + \\n${EMACS_SUFFIX} --batch --eval='(dump-emacs-portable
270 + \"/usr/libexec/emacs/${FULL_VERSION}/${CHOST}/emacs.pdmp\")'"
271 readme.gentoo_create_doc
272 }