Hi folks,
On Mon, Jul 31 2023, Timo Myyrä <timo.myyra@bittivirhe.fi> wrote:
> On Mon, Jul 31 2023, Sebastien Marie wrote:
>
>> On Mon, Jul 31, 2023 at 11:14:38AM +0300, Timo Myyrä wrote:
>>> On Mon, Jul 31 2023, Renato Aguiar wrote:
>>>
>>> > On Mon, Jul 31 2023, lux wrote:
>>> >
>>> >> Hi, Emacs 29.1 was released yesterday, I update to 29.1.
>>> >>
>>> >
>>> > Maybe add textproc/tree-sitter to LIB_DEPENDS to enable the new
>>> > built-in tree-sitter integration?
>>>
>>> Hi,
>>>
>>> Here is a bit more fleshed out version for emacs-29 update.
>>>
>>> - adds sqlite, tree-sitter and libwebp dependencies
>>
>> webp ?
>>
>> anyway, the diff doesn't seems consistent:
>>
>> - CONFIGURE_ARGS += --without-webp
>> - LIB_DEPENDS += graphics/libwebp
>> - no WANTLIB change for webp
>>
>> Thanks.
>
> The new emacs version adds support for the WebP image format. The port
> should only use it when building graphics support, same way as other
> image formats.
I have already spent time on this yesterday. While I can understand
that you love your emacs being up to date, I'm maintaining this port
and I would have three proposals to compare with my own wip diff.
So let's hope that said diff addresses all the points mentioned in this
thread...
The two main points open to discussion IMO:
1. sqlite3: it doesn't seem to add any feature besides being able to
access sqlite databases from emacs. So I'm not sure it's worth adding
another explicit dep...
2. tree-sitter: I won't add it right now, since it uses rust at build
time and I want emacs to stay available on as many architectures as
possible. I have a wip diff to make rust optional in
textproc/tree-sitter, but that can wait until emacs-29.1 is properly
tested and committed.
All flavors build-tested on amd64, no_x11 flavor build-tested on sparc64
and running on amd64.
Test reports & oks welcome, especially for graphical flavors.
Index: Makefile
===================================================================
RCS file: /cvs/ports/editors/emacs/Makefile,v
retrieving revision 1.111
diff -u -p -r1.111 Makefile
--- Makefile 24 Apr 2023 11:40:37 -0000 1.111
+++ Makefile 31 Jul 2023 11:30:59 -0000
@@ -1,7 +1,6 @@
COMMENT= GNU editor: extensible, customizable, self-documenting
-VERSION= 28.2
-REVISION= 4
+VERSION= 29.1
DISTNAME= emacs-${VERSION}
CATEGORIES= editors
@@ -13,7 +12,8 @@ MAINTAINER= Jeremie Courreges-Anglas <j
# GPLv3+
PERMIT_PACKAGE= Yes
-WANTLIB = c curses execinfo jansson gmp gnutls m pthread xml2 z
+WANTLIB += c curses execinfo gmp gnutls jansson m pthread sqlite3
+WANTLIB += xml2 z
MASTER_SITES= ${MASTER_SITE_GNU:=emacs/}
EXTRACT_SUFX= .tar.xz
@@ -29,6 +29,8 @@ CONFIGURE_STYLE= gnu
MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/build-aux
CONFIGURE_ARGS= --build="${GCCARCH}" \
--without-sound
+# Uses rust, not supported on all archs
+CONFIGURE_ARGS+= --without-tree-sitter
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib ${LDFLAGS}"
@@ -39,7 +41,8 @@ MAKE_ENV= INSTALL_EMACS="${INSTALL_SCRI
SUBST_VARS= GCCARCH VERSION
USE_GMAKE= Yes
-LIB_DEPENDS= devel/jansson \
+LIB_DEPENDS= databases/sqlite3 \
+ devel/jansson \
devel/gmp \
security/gnutls \
textproc/libxml
@@ -61,6 +64,7 @@ LIB_DEPENDS+= devel/harfbuzz \
graphics/tiff \
graphics/giflib \
graphics/lcms2 \
+ graphics/libwebp \
misc/m17n/lib \
x11/dbus \
x11/gnome/librsvg
@@ -70,11 +74,11 @@ RUN_DEPENDS+= devel/desktop-file-utils
. if ${FLAVOR} == "athena"
CONFIGURE_ARGS+= --with-x-toolkit=athena
LIB_DEPENDS+= x11/Xaw3d
-WANTLIB += ICE SM X11 X11-xcb Xaw3d Xext Xfixes Xinerama Xmu
-WANTLIB += Xpm Xrandr Xrender Xt cairo dbus-1 fontconfig freetype
-WANTLIB += gdk_pixbuf-2.0 gif gio-2.0 glib-2.0 gobject-2.0 harfbuzz
-WANTLIB += intl jpeg lcms2 m17n-core m17n-flt otf png rsvg-2 tiff
-WANTLIB += xcb
+WANTLIB += ICE SM X11 X11-xcb Xaw3d Xcomposite Xext Xfixes Xi
+WANTLIB += Xinerama Xmu Xpm Xrandr Xrender Xt cairo dbus-1 fontconfig
+WANTLIB += freetype gdk_pixbuf-2.0 gif gio-2.0 glib-2.0 gobject-2.0
+WANTLIB += harfbuzz intl jpeg lcms2 m17n-core m17n-flt otf png
+WANTLIB += rsvg-2 sharpyuv tiff webp webpdemux xcb xcb-shape xcb-util
. elif ${FLAVOR} == "gtk2"
CONFIGURE_ARGS+= --with-x-toolkit=gtk2
LIB_DEPENDS+= x11/gtk+2
@@ -83,16 +87,17 @@ WANTLIB += Xfixes Xi Xinerama Xpm Xrandr
WANTLIB += dbus-1 fontconfig freetype gdk-x11-2.0 gdk_pixbuf-2.0
WANTLIB += gif gio-2.0 glib-2.0 gobject-2.0 gtk-x11-2.0 harfbuzz
WANTLIB += intl jpeg lcms2 m17n-core m17n-flt otf pango-1.0 pangocairo-1.0
-WANTLIB += pangoft2-1.0 png rsvg-2 tiff xcb
+WANTLIB += pangoft2-1.0 png rsvg-2 sharpyuv tiff webp webpdemux
+WANTLIB += xcb xcb-shape xcb-util
. elif ${FLAVOR} == "gtk3"
CONFIGURE_ARGS+= --with-x-toolkit=gtk3
LIB_DEPENDS+= x11/gtk+3
-WANTLIB += ICE SM X11 X11-xcb Xext Xfixes Xinerama Xpm Xrandr
-WANTLIB += Xrender atk-1.0 cairo cairo-gobject dbus-1 fontconfig
-WANTLIB += freetype gdk-3 gdk_pixbuf-2.0 gif gio-2.0 glib-2.0
-WANTLIB += gobject-2.0 gtk-3 harfbuzz intl jpeg lcms2 m17n-core
-WANTLIB += m17n-flt otf pango-1.0 pangocairo-1.0 png rsvg-2 tiff
-WANTLIB += xcb
+WANTLIB += ICE SM X11 X11-xcb Xcomposite Xext Xfixes Xi Xinerama
+WANTLIB += Xpm Xrandr Xrender atk-1.0 cairo cairo-gobject dbus-1
+WANTLIB += fontconfig freetype gdk-3 gdk_pixbuf-2.0 gif gio-2.0
+WANTLIB += glib-2.0 gobject-2.0 gtk-3 harfbuzz intl jpeg lcms2
+WANTLIB += m17n-core m17n-flt otf pango-1.0 pangocairo-1.0 png
+WANTLIB += rsvg-2 sharpyuv tiff webp webpdemux xcb xcb-shape xcb-util
. else
ERRORS+= "Fatal: Conflicting flavor: ${FLAVOR}"
. endif
@@ -100,6 +105,8 @@ ERRORS+= "Fatal: Conflicting flavor: ${
post-install:
chmod -t ${PREFIX}/bin/emacs-${VERSION}
+ mv ${PREFIX}/libexec/emacs/${VERSION}/${GCCARCH}/emacs-*.pdmp \
+ ${PREFIX}/libexec/emacs/${VERSION}/${GCCARCH}/emacs.pdmp
.if ${FLAVOR:Mno_x11}
rm -Rf ${PREFIX}/share/applications/ ${PREFIX}/share/icons/
.endif
Index: distinfo
===================================================================
RCS file: /cvs/ports/editors/emacs/distinfo,v
retrieving revision 1.17
diff -u -p -r1.17 distinfo
--- distinfo 22 Sep 2022 07:16:16 -0000 1.17
+++ distinfo 31 Jul 2023 11:30:59 -0000
@@ -1,2 +1,2 @@
-SHA256 (emacs-28.2.tar.xz) = 7iEYIjPvMjLcl7SGry2G4UBC27ZbvFNd9WLDqFgjJIg=
-SIZE (emacs-28.2.tar.xz) = 47722600
+SHA256 (emacs-29.1.tar.xz) = 0viBpcwjHi9aA+hvRYSwQ4+D7ddZignSSiG9jQA+LgE=
+SIZE (emacs-29.1.tar.xz) = 52081008
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/editors/emacs/patches/patch-Makefile_in,v
retrieving revision 1.8
diff -u -p -r1.8 patch-Makefile_in
--- patches/patch-Makefile_in 19 Apr 2022 11:54:34 -0000 1.8
+++ patches/patch-Makefile_in 31 Jul 2023 11:30:59 -0000
@@ -3,7 +3,7 @@
Index: Makefile.in
--- Makefile.in.orig
+++ Makefile.in
-@@ -693,7 +693,7 @@ install-info: info
+@@ -792,7 +792,7 @@ install-info: info
for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
(cd "$${thisdir}"; \
${INSTALL_DATA} ${srcdir}/info/$$f "$(DESTDIR)${infodir}/$$f"); \
@@ -12,7 +12,7 @@ Index: Makefile.in
rm -f "$(DESTDIR)${infodir}/$$f.gz"; \
${GZIP_PROG} -9n "$(DESTDIR)${infodir}/$$f"; \
done; \
-@@ -717,7 +717,7 @@ install-man:
+@@ -816,7 +816,7 @@ install-man:
dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \
(cd "$${thisdir}"; \
${INSTALL_DATA} ${mansrcdir}/$${page} "$(DESTDIR)${man1dir}/$${dest}"); \
Index: patches/patch-etc_emacsclient-mail_desktop
===================================================================
RCS file: patches/patch-etc_emacsclient-mail_desktop
diff -N patches/patch-etc_emacsclient-mail_desktop
--- patches/patch-etc_emacsclient-mail_desktop 16 Apr 2023 20:46:36 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-"Fix emacsclient-mail.desktop code injection vulnerability" (CVE-2023-27985, CVE-2023-27986)
-https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=3c1693d08b0a71d40a77e7b40c0ebc42dca2d2cc
-https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=c8ec0017cb96d4ac98be21e1fe9a95e1aa723e99
-
-Index: etc/emacsclient-mail.desktop
---- etc/emacsclient-mail.desktop.orig
-+++ etc/emacsclient-mail.desktop
-@@ -1,7 +1,10 @@
- [Desktop Entry]
- Categories=Network;Email;
- Comment=GNU Emacs is an extensible, customizable text editor - and more
--Exec=sh -c "exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\\\(message-mailto\\\\ \\\\\\"%u\\\\\\"\\\\)"
-+# We want to pass the following commands to the shell wrapper:
-+# u=$(echo "$1" | sed 's/[\"]/\\&/g'); exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"$u\")"
-+# Special chars '"', '$', and '\' must be escaped as '\\"', '\\$', and '\\\\'.
-+Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u
- Icon=emacs
- Name=Emacs (Mail, Client)
- MimeType=x-scheme-handler/mailto;
-@@ -13,7 +16,7 @@ Actions=new-window;new-instance;
-
- [Desktop Action new-window]
- Name=New Window
--Exec=emacsclient --alternate-editor= --create-frame --eval "(message-mailto \\"%u\\")"
-+Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --create-frame --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u
-
- [Desktop Action new-instance]
- Name=New Instance
Index: patches/patch-lib-src_etags_c
===================================================================
RCS file: patches/patch-lib-src_etags_c
diff -N patches/patch-lib-src_etags_c
--- patches/patch-lib-src_etags_c 14 Mar 2023 13:09:48 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,329 +0,0 @@
-"Fixed ctags local command execute vulnerability" (CVE-2022-45939)
-https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-28&id=5d05ea803e9996c4c1edbe0fa0f6f5b05d2ffc87
-https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d48bb4874bc6cd3e69c7a15fc3c91cc141025c51
-
-"Fix etags local command injection vulnerability" (CVE-2022-48337)
-https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-28&id=e339926272a598bd9ee7e02989c1662b89e64cf0
-https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=01a4035c869b91c153af9a9132c87adb7669ea1c
-
-Index: lib-src/etags.c
---- lib-src/etags.c.orig
-+++ lib-src/etags.c
-@@ -382,7 +382,7 @@ static void just_read_file (FILE *);
-
- static language *get_language_from_langname (const char *);
- static void readline (linebuffer *, FILE *);
--static ptrdiff_t readline_internal (linebuffer *, FILE *, char const *);
-+static ptrdiff_t readline_internal (linebuffer *, FILE *, char const *, const bool);
- static bool nocase_tail (const char *);
- static void get_tag (char *, char **);
- static void get_lispy_tag (char *);
-@@ -406,7 +406,10 @@ static void free_fdesc (fdesc *);
- static void pfnote (char *, bool, char *, ptrdiff_t, intmax_t, intmax_t);
- static void invalidate_nodes (fdesc *, node **);
- static void put_entries (node *);
-+static void clean_matched_file_tag (char const * const, char const * const);
-
-+static char *escape_shell_arg_string (char *);
-+static void do_move_file (const char *, const char *);
- static char *concat (const char *, const char *, const char *);
- static char *skip_spaces (char *);
- static char *skip_non_spaces (char *);
-@@ -1339,7 +1342,7 @@ main (int argc, char **argv)
- if (parsing_stdin)
- fatal ("cannot parse standard input "
- "AND read file names from it");
-- while (readline_internal (&filename_lb, stdin, "-") > 0)
-+ while (readline_internal (&filename_lb, stdin, "-", false) > 0)
- process_file_name (filename_lb.buffer, lang);
- }
- else
-@@ -1387,9 +1390,6 @@ main (int argc, char **argv)
- /* From here on, we are in (CTAGS && !cxref_style) */
- if (update)
- {
-- char *cmd =
-- xmalloc (strlen (tagfile) + whatlen_max +
-- sizeof "mv..OTAGS;grep -Fv '\t\t' OTAGS >;rm OTAGS");
- for (i = 0; i < current_arg; ++i)
- {
- switch (argbuffer[i].arg_type)
-@@ -1400,17 +1400,8 @@ main (int argc, char **argv)
- default:
- continue; /* the for loop */
- }
-- char *z = stpcpy (cmd, "mv ");
-- z = stpcpy (z, tagfile);
-- z = stpcpy (z, " OTAGS;grep -Fv '\t");
-- z = stpcpy (z, argbuffer[i].what);
-- z = stpcpy (z, "\t' OTAGS >");
-- z = stpcpy (z, tagfile);
-- strcpy (z, ";rm OTAGS");
-- if (system (cmd) != EXIT_SUCCESS)
-- fatal ("failed to execute shell command");
-+ clean_matched_file_tag (tagfile, argbuffer[i].what);
- }
-- free (cmd);
- append_to_tagfile = true;
- }
-
-@@ -1439,7 +1430,52 @@ main (int argc, char **argv)
- return EXIT_SUCCESS;
- }
-
-+/*
-+ * Equivalent to: mv tags OTAGS;grep -Fv ' filename ' OTAGS >tags;rm OTAGS
-+ */
-+static void
-+clean_matched_file_tag (const char* tagfile, const char* match_file_name)
-+{
-+ FILE *otags_f = fopen ("OTAGS", "wb");
-+ FILE *tag_f = fopen (tagfile, "rb");
-
-+ if (otags_f == NULL)
-+ pfatal ("OTAGS");
-+
-+ if (tag_f == NULL)
-+ pfatal (tagfile);
-+
-+ int buf_len = strlen (match_file_name) + sizeof ("\t\t ") + 1;
-+ char *buf = xmalloc (buf_len);
-+ snprintf (buf, buf_len, "\t%s\t", match_file_name);
-+
-+ linebuffer line;
-+ linebuffer_init (&line);
-+ while (readline_internal (&line, tag_f, tagfile, true) > 0)
-+ {
-+ if (ferror (tag_f))
-+ pfatal (tagfile);
-+
-+ if (strstr (line.buffer, buf) == NULL)
-+ {
-+ fprintf (otags_f, "%s\n", line.buffer);
-+ if (ferror (tag_f))
-+ pfatal (tagfile);
-+ }
-+ }
-+ free (buf);
-+ free (line.buffer);
-+
-+ if (fclose (otags_f) == EOF)
-+ pfatal ("OTAGS");
-+
-+ if (fclose (tag_f) == EOF)
-+ pfatal (tagfile);
-+
-+ do_move_file ("OTAGS", tagfile);
-+ return;
-+}
-+
- /*
- * Return a compressor given the file name. If EXTPTR is non-zero,
- * return a pointer into FILE where the compressor-specific
-@@ -1669,13 +1705,18 @@ process_file_name (char *file, language *lang)
- else
- {
- #if MSDOS || defined (DOS_NT)
-- char *cmd1 = concat (compr->command, " \"", real_name);
-- char *cmd = concat (cmd1, "\" > ", tmp_name);
-+ int buf_len = strlen (compr->command) + strlen (" \"\" > \"\"") + strlen (real_name) + strlen (tmp_name) + 1;
-+ char *cmd = xmalloc (buf_len);
-+ snprintf (cmd, buf_len, "%s \"%s\" > \"%s\"", compr->command, real_name, tmp_name);
- #else
-- char *cmd1 = concat (compr->command, " '", real_name);
-- char *cmd = concat (cmd1, "' > ", tmp_name);
-+ char *new_real_name = escape_shell_arg_string (real_name);
-+ char *new_tmp_name = escape_shell_arg_string (tmp_name);
-+ int buf_len = strlen (compr->command) + strlen (" > ") + strlen (new_real_name) + strlen (new_tmp_name) + 1;
-+ char *cmd = xmalloc (buf_len);
-+ snprintf (cmd, buf_len, "%s %s > %s", compr->command, new_real_name, new_tmp_name);
-+ free (new_real_name);
-+ free (new_tmp_name);
-
No comments:
Post a Comment