Page MenuHomeFreeBSD

editors/emacs: Update to 29.1
ClosedPublic

Authored by yasu on Aug 14 2023, 6:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 18 2024, 9:55 AM
Unknown Object (File)
Oct 13 2024, 12:26 AM
Unknown Object (File)
Oct 13 2024, 12:26 AM
Unknown Object (File)
Oct 7 2024, 2:39 PM
Unknown Object (File)
Oct 4 2024, 1:48 PM
Unknown Object (File)
Oct 4 2024, 12:30 PM
Unknown Object (File)
Oct 4 2024, 7:58 AM
Unknown Object (File)
Oct 1 2024, 10:17 PM
Subscribers

Details

Summary

I believe we are ready to update to 29.1. But please check it just in case.

  • Update Canna patch to the one for Emacs 29.
  • Add new options PGTK, SQLITE3, TREESITTER and WEBP. SQLITE3 and TREESITTER are ON by default. PGTK and WEBP options are excluded from nox flavor.
  • CARGO option doesn't imply XFT but prevents it. It is caused as a result of adding pure GTK support (PGTK option).
  • OTK options doesn't imply XTF any more. It is also caused as a result of adding pure GTK support.
  • Update NATIVECOMP option so it specifies ahead-of-time compilation via the configure argument.
  • Remove "experimental" from NATIVECOMP_DESC.
  • Add print/freetype2 and x11-fonts/fontconfig to CAIRO_LIB_DEPENDS and GTK3_LIB_DEPENDS. Necessary to link emacs binary with shared libraries.
  • When PGTK option is ON and SCROLLBARS is OFF, configure fails as following

    ---------------------------------------------------------------------- checking for gnutls >= 2.12.2... yes checking for jansson >= 2.7... yes checking for tree-sitter >= 0.20.2... yes checking for libkqueue... no checking for library containing kqueue... none required configure: error: Non-toolkit scroll bars are not implemented for your system ----------------------------------------------------------------------

    So add SCROLLBARS to PGTK_IMPLIES to avoid such options setting.
  • When MODULES option is OFF and TREESITTER is ON, link error happens as following.

    ---------------------------------------------------------------------- cc -o temacs.tmp \ -Demacs -I. -I. -I../lib -I../lib -I/usr/local/include -I/usr/local/include/librsvg-2.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/gdk-pixbuf-2.0 -pthread -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -D_THREAD_SAFE -I/usr/local/include/libpng16 -I/usr/local/include/libxml2 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/webp -I/usr/local/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -pthread -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -MMD -MF deps/.d -MP -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include/p11-kit-1 -I/usr/local/include/cairo -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -D_THREAD_SAFE -Wno-switch -Wno-pointer-sign -Wno-string-plus-int -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-initializer-overrides -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -fstack-protector-strong -L/usr/local/lib -L/usr/local/lib \ dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o dbusbind.o emacs.o keyboard.o macros.o keymap.o sysdep.o bignum.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex-emacs.o undo.o alloc.o pdumper.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o sort.o font.o print.o lread.o syntax.o bytecode.o comp.o process.o gnutls.o callproc.o region-cache.o sound.o timefns.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o lcms.o kqueue.o profiler.o decompress.o thread.o systhread.o sqlite.o treesit.o itree.o xfont.o ftfont.o ftcrfont.o hbfont.o fontset.o fringe.o image.o xgselect.o json.o terminfo.o lastfile.o ../lib/libgnu.a ../oldXMenu/libXMenu11.a -ltiff -ljpeg -L/usr/local/lib -lpng16 -lgif -L/usr/local/lib -lwebpdemux -lwebpdecoder -lSM -lICE -lX11 -lXrender -L/usr/local/lib -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lrt -L/usr/local/lib -ldbus-1 -lexecinfo -L/usr/local/lib -lXrandr -L/usr/local/lib -lXinerama -L/usr/local/lib -lXfixes -lXext -lXext -L/usr/local/lib -lxml2 -lutil -L/usr/local/lib -lcairo -lncurses -L/usr/local/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -L/usr/local/lib -lfreetype -L/usr/local/lib -lfontconfig -lfreetype -L/usr/local/lib -lharfbuzz -L/usr/local/lib -lgnutls -lpthread -L/usr/local/lib -llcms2 -llcms2_fast_float -llcms2_threaded -lm -lz -L/usr/local/lib -ljansson -lgmp -L/usr/local/lib -lXi -L/usr/local/lib -ltree-sitter -lsqlite3 -lXcomposite -lXext ld: error: undefined symbol: dynlib_error >>> referenced by treesit.c >>> treesit.o:(treesit_load_language) >>> referenced by treesit.c >>> treesit.o:(treesit_load_language) >>> referenced by treesit.c >>> treesit.o:(treesit_load_language) >>> referenced 1 more times

    ld: error: undefined symbol: dynlib_sym >>> referenced by treesit.c >>> treesit.o:(treesit_load_language)

    ld: error: undefined symbol: dynlib_open >>> referenced by treesit.c >>> treesit.o:(treesit_load_language) cc: error: linker command failed with exit code 1 (use -v to see invocation) ----------------------------------------------------------------------

    So add MODULES to TREESITTER_IMPLIES to avoid such options setting.
    • Bump PORTREVISION of ports that use "USES=emacs".

ChangeLog: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29.1

Test Plan

Build of all flavors succeeds with poudriere and 13.2-RELEASE amd64 jail.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 53148
Build 50039: arc lint + arc unit

Event Timeline

yasu requested review of this revision.Aug 14 2023, 6:58 AM
ashish requested changes to this revision.Aug 14 2023, 11:07 AM
ashish added inline comments.
editors/emacs/Makefile
272
This revision now requires changes to proceed.Aug 14 2023, 11:07 AM
editors/emacs/Makefile
102

For posterity, here is what I wrote in one of our email threads.

I looked at the patch and it looks good to me with one exception. I don't think the PGTK option should be on by default, at least for the default flavor. Upstream does not turn it on by default and I recall a mailing list post by the author of pgtk saying that it's not a good idea for X users. Unfortunately this mailing list post came after we turned PGTK on by default for editors/emacs-devel. Also, etc/NEWS.29 says,

We recommend that you use this [pgtk] configuration only if you are
running a window system other than X that's supported by GDK.
Running this configuration on X is known to have problems, such as
undesirable frame positioning and various issues with keyboard input
of sequences such as 'C-;' and 'C-S-u'.  Running this on WSL is also
known to have problems.

I would guess most users are still running X.

I have a working branch that adds two new flavors, nativecomp and wayland that I can incorporate here (once I clean it up and test it), or can commit later if you both think it's a good idea.

editors/emacs/Makefile
102

For posterity, here is what I wrote in one of our email threads.

I looked at the patch and it looks good to me with one exception. I don't think the PGTK option should be on by default, at least for the default flavor. Upstream does not turn it on by default and I recall a mailing list post by the author of pgtk saying that it's not a good idea for X users. Unfortunately this mailing list post came after we turned PGTK on by default for editors/emacs-devel. Also, etc/NEWS.29 says,

We recommend that you use this [pgtk] configuration only if you are
running a window system other than X that's supported by GDK.
Running this configuration on X is known to have problems, such as
undesirable frame positioning and various issues with keyboard input
of sequences such as 'C-;' and 'C-S-u'.  Running this on WSL is also
known to have problems.

I would guess most users are still running X.

I have a working branch that adds two new flavors, nativecomp and wayland that I can incorporate here (once I clean it up and test it), or can commit later if you both think it's a good idea.

This means we'll be have N x 2 more packages, where N is the number of dependent ports.

IIRC, I mentioned something similar in January 2023 on emacs@ but never come across to implementing it myself, because of the work involved and time commitment:

With regards to the situation in bug 268386[0], and as Emacs 29 will be out soon, and will get the PGTK option as default, which won't work for folks who want to stay on X11 platform. I'd this idea that we create N emacs meta-ports (for each major version of emacs we intend to support), e.g. as per current situation, we'll have following:

  • editors/emacs-metaport
  • editors/emacs-devel-metaport

Each of those meta-ports will offer some mutually exclusive options, say, e.g. NOX, X11, X11_CANNA, WAYLAND (default, in my example), and depending on the option user choses the emacs port with the corresponding flavour gets installed.

All Emacs user ports will have N versions to chose, e.g. "default", and "devel", which will add a dependency on those metaports. Since bytecode will be same for a major version of emacs irrespective of whether user chose NOX, or X11, or WAYLAND, instead of having 5 flavours of dependent ports, we'll only have two flavours. And if a user wants to install X11_CANNA version of emacs port, but default is WAYLAND, then they can install emacs-x11-canna package (flavour), and have editors/emacs-metaport port manually installed with X11_CANNA non-default option, since cost of manually re-installing meta-port is zero it'll satisfy all the dependencies without us (emacs@) causing the bloating with more flavours of USES=emacs, as jbeich clearly mentions in his replies.

What do you folks think of this idea ? Or if you have any better idea, then please do share.

This does not imply in anyway that I'm objecting to your work (which I don't even know how it looks), Joe. But, I just wanted to point out this approach.

Thanks!

editors/emacs/Makefile
102

My response from January is below. I agree that the situation with all these Emacs user ports far from optimal, but I couldn't think of any other way to give users the ability to pkg install <whatever_emacs_package> and be done. Maybe it would be less work to just implement provides/requires.

I certainly like the idea of reducing the total number of packages built for USES=emacs ports from something that depends on the number of Emacs flavors to two. However, I think it would be nice for users to continue to have official packages for each Emacs port flavor (currently emacs, emacs-nox, emacs-canna, emacs-devel, emacs-devel-nox and whatever new flavors we add like Wayland). I guess things wouldn't work if we continued to use flavors for editors/emacs and editors/emacs-devel, because the USES=emacs dependencies would be messed up. Alternatively, it's too bad we couldn't have all the metaport OPTIONS turned on, but I guess we would have problems with conflicting ports. It's the end of a long day here, so it's likely I'm not thinking clearly.

A minor issue that comes to mind is if a user chooses the NOX option of either Emacs metaport, then installs, say print/pdf-tools, they will have a broken pdf-tools installation, because it requires X11 (or perhaps WAYLAND).

Thanks for the proposal. Overall, I think it's a good idea.

Apply feedback from ashish.

jrm requested changes to this revision.Aug 17 2023, 2:32 PM
jrm added inline comments.
editors/emacs/Makefile
100–102
This revision now requires changes to proceed.Aug 17 2023, 2:32 PM
yasu marked an inline comment as done.

Remove PGTK from OPTIONS_DEFAULT.

@yasu, Thank you again for your hard work. I know very well how much time it can take to test all the different combinations of flavors and options.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 20 2023, 12:55 AM
This revision was automatically updated to reflect the committed changes.