Github messages for voidlinux
 help / color / mirror / Atom feed
From: leahneukirchen <leahneukirchen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] emacs: enable support for native-compilation.
Date: Sat, 16 Apr 2022 14:06:31 +0200	[thread overview]
Message-ID: <20220416120631.LRGj92v2300wXROSmoxzpGlfs4pahibIy9eT2hWSGHQ@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-36690@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

There is an updated pull request by leahneukirchen against master on the void-packages repository

https://github.com/leahneukirchen/void-packages emacs-native-comp
https://github.com/void-linux/void-packages/pull/36690

emacs: enable support for native-compilation.
**Needs #28785 to be merged first, then rebased!**

Closes #36543.

This enables native-compilation and provides precompiled elisp files
for emacs-x11 and emacs-gtk3.  The plain console emacs stays without
support for native compilation to keep it lean, as native-compilation
pulls in libgccjit (27MB) and gcc (172MB + deps)
as well as emacs-common-eln (15MB).

On slow machines, native compilation can be disabled by setting
```(setq comp-deferred-compilation nil)```
in your .emacs.

#### Testing the changes
- I tested the changes in this PR: **briefly**


A patch file from https://github.com/void-linux/void-packages/pull/36690.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-emacs-native-comp-36690.patch --]
[-- Type: text/x-diff, Size: 5301 bytes --]

From 1f6f76f69016090bba0d4c36a28e5faa21b82053 Mon Sep 17 00:00:00 2001
From: Leah Neukirchen <leah@vuxu.org>
Date: Thu, 14 Apr 2022 15:54:16 +0200
Subject: [PATCH] emacs: enable support for native-compilation.

This enables native-compilation and provides precompiled elisp files
for emacs-x11 and emacs-gtk3.  The plain console emacs stays without
support for native compilation to keep it lean, as native-compilation
pulls in libgccjit (27MB) and gcc (172MB + deps)
as well as emacs-common-eln (15MB).

On slow machines, native compilation can be disabled by setting
(setq comp-deferred-compilation nil)
in your .emacs.
---
 srcpkgs/emacs-common-eln |  1 +
 srcpkgs/emacs/template   | 46 +++++++++++++++++++++++++++++++---------
 2 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/emacs-common-eln

diff --git a/srcpkgs/emacs-common-eln b/srcpkgs/emacs-common-eln
new file mode 120000
index 000000000000..a7642dd168d6
--- /dev/null
+++ b/srcpkgs/emacs-common-eln
@@ -0,0 +1 @@
+emacs
\ No newline at end of file
diff --git a/srcpkgs/emacs/template b/srcpkgs/emacs/template
index 644e44cf4d06..aae0e3f6d225 100644
--- a/srcpkgs/emacs/template
+++ b/srcpkgs/emacs/template
@@ -1,13 +1,14 @@
 # Template file for 'emacs'
 pkgname=emacs
 version=28.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-file-notification=inotify --with-modules
  $(vopt_with jpeg) $(vopt_with tiff) $(vopt_with gif) $(vopt_with png)
  $(vopt_with xpm) $(vopt_with svg rsvg) $(vopt_with imagemagick)
  $(vopt_with xml xml2) $(vopt_with gnutls) $(vopt_with sound) $(vopt_with m17n m17n-flt)
- $(vopt_with json) $(vopt_with harfbuzz) $(vopt_with cairo) $(vopt_with gmp libgmp)"
+ $(vopt_with json) $(vopt_with harfbuzz) $(vopt_with cairo) $(vopt_with gmp libgmp)
+ $(vopt_with nativecomp native-compilation)"
 hostmakedepends="pkg-config tar"
 makedepends="ncurses-devel libXaw-devel gtk+3-devel webkit2gtk-devel
  dbus-devel acl-devel
@@ -17,7 +18,8 @@ makedepends="ncurses-devel libXaw-devel gtk+3-devel webkit2gtk-devel
  $(vopt_if xml libxml2-devel) $(vopt_if gnutls gnutls-devel)
  $(vopt_if sound alsa-lib-devel) $(vopt_if m17n m17n-lib-devel)
  $(vopt_if json jansson-devel) $(vopt_if harfbuzz harfbuzz-devel)
- $(vopt_if cairo cairo-devel) $(vopt_if gmp gmp-devel)"
+ $(vopt_if cairo cairo-devel) $(vopt_if gmp gmp-devel)
+ $(vopt_if nativecomp libgccjit-devel)"
 depends="emacs-common-${version}_${revision}"
 short_desc="GNU Emacs editor"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -29,12 +31,16 @@ nocross=yes
 nopie=yes
 
 # Package build options
-build_options="jpeg tiff gif png xpm svg xml imagemagick gnutls sound m17n dbus json harfbuzz cairo gmp"
-desc_option_xpm="Enable support for XPM images"
-desc_option_sound="Enable support for sound"
+build_options="jpeg tiff gif png xpm svg xml imagemagick gnutls sound m17n dbus json harfbuzz cairo gmp nativecomp"
+desc_option_cairo="Enable support for drawing with Cairo"
+desc_option_gmp="Enable support for big numbers using GMP"
+desc_option_json="Enable support for native JSON parsing"
 desc_option_m17n="Enable support for m17n multilingual text processing"
-build_options_default="cairo gif gmp gnutls harfbuzz jpeg json m17n png sound
- svg tiff xml xpm"
+desc_option_nativecomp="Enable support for native compilation"
+desc_option_sound="Enable support for sound"
+desc_option_xpm="Enable support for XPM images"
+build_options_default="cairo gif gmp gnutls harfbuzz jpeg json m17n nativecomp
+ png sound svg tiff xml xpm"
 
 pre_configure() {
 	# Just configuring in different directories results in
@@ -47,7 +53,8 @@ pre_configure() {
 
 do_configure() {
 	cd $wrksrc/nox
-	./configure --without-x $(vopt_with dbus) ${configure_args}
+	./configure --without-x $(vopt_with dbus) ${configure_args} \
+		--without-native-compilation
 
 	cd $wrksrc/x11
 	./configure --with-x-toolkit=athena --without-toolkit-scroll-bars \
@@ -60,12 +67,13 @@ do_configure() {
 
 do_build() {
 	make ${makejobs} -C nox
-	make ${makejobs} -C x11
+	make ${makejobs} -C x11 $(vopt_if nativecomp NATIVE_FULL_AOT=1)
 	make ${makejobs} -C gtk3
 }
 
 do_install() {
 	make DESTDIR=$DESTDIR -C ${wrksrc}/nox install
+	make DESTDIR=$DESTDIR -C ${wrksrc}/x11 install-eln
 	rm -f ${DESTDIR}/usr/bin/ctags
 	rm -f ${DESTDIR}/usr/lib/systemd/user/emacs.service
 	rm -f ${DESTDIR}/usr/share/man/man1/ctags.1*
@@ -84,8 +92,23 @@ emacs-common_package() {
 	}
 }
 
+emacs-common-eln_package() {
+	short_desc+=" - common precompiled elisp"
+	if [ -z "$build_option_nativecomp" ]; then
+		build_style=meta
+	fi
+	pkg_install() {
+		if [ "$build_option_nativecomp" ]; then
+			vmove usr/lib/emacs
+		fi
+	}
+}
+
 emacs-x11_package() {
 	depends="emacs-common-${version}_${revision}"
+	if [ "$build_option_nativecomp" ]; then
+		depends+=" emacs-common-eln-${version}_${revision}"
+	fi
 	provides="emacs-${version}_${revision}"
 	replaces="emacs>=0"
 	short_desc+=" - X11 version"
@@ -99,6 +122,9 @@ emacs-x11_package() {
 
 emacs-gtk3_package() {
 	depends="emacs-common-${version}_${revision} desktop-file-utils hicolor-icon-theme"
+	if [ "$build_option_nativecomp" ]; then
+		depends+=" emacs-common-eln-${version}_${revision}"
+	fi
 	provides="emacs-${version}_${revision}"
 	replaces="emacs>=0"
 	short_desc+=" - GTK+3 version"

  parent reply	other threads:[~2022-04-16 12:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 14:25 [PR PATCH] " leahneukirchen
2022-04-14 14:47 ` [PR PATCH] [Updated] " leahneukirchen
2022-04-14 20:10 ` KSPAtlas
2022-04-14 20:14 ` leahneukirchen
2022-04-16 12:06 ` leahneukirchen [this message]
2022-04-16 14:05 ` [PR PATCH] [Merged]: " leahneukirchen
2022-04-17 11:11 ` soanvig
2022-04-17 19:24 ` leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220416120631.LRGj92v2300wXROSmoxzpGlfs4pahibIy9eT2hWSGHQ@z \
    --to=leahneukirchen@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).