Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mlterm for openSUSE:Factory checked in at 2023-02-27 12:55:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mlterm (Old) and /work/SRC/openSUSE:Factory/.mlterm.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mlterm" Mon Feb 27 12:55:51 2023 rev:51 rq:1067901 version:3.9.2 Changes: -------- --- /work/SRC/openSUSE:Factory/mlterm/mlterm.changes 2022-08-09 15:28:17.929616005 +0200 +++ /work/SRC/openSUSE:Factory/.mlterm.new.31432/mlterm.changes 2023-02-27 12:55:53.107613585 +0100 @@ -1,0 +2,13 @@ +Fri Feb 24 18:48:32 UTC 2023 - Michal Suchanek <msucha...@suse.com> + +- Build Wayland and SDL backends. +- Enable fcitx support +- Fix some crashes + + CVE-2022-24130-c_sixel.c-Fix-segmentation-fault-when-the-repeat-cou.patch + + mlterm-Fix-buffer-overflow-with-long-plugin-suffix.patch + + mlfc-Fix-crash-with-more-than-1024-font-faces-installed.patch +- Fix some build problems + + mlterm-SDL2-UI-also-needs-math-libs.patch + + mlterm-wayland-Detect-compiler-flags.patch + +------------------------------------------------------------------- New: ---- CVE-2022-24130-c_sixel.c-Fix-segmentation-fault-when-the-repeat-cou.patch mlfc-Fix-crash-with-more-than-1024-font-faces-installed.patch mlterm-Fix-buffer-overflow-with-long-plugin-suffix.patch mlterm-SDL2-UI-also-needs-math-libs.patch mlterm-wayland-Detect-compiler-flags.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mlterm.spec ++++++ --- /var/tmp/diff_new_pack.6rK9MM/_old 2023-02-27 12:55:53.951618788 +0100 +++ /var/tmp/diff_new_pack.6rK9MM/_new 2023-02-27 12:55:53.959618836 +0100 @@ -1,7 +1,7 @@ # # spec file for package mlterm # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,16 +16,24 @@ # +%global _configure ../configure +%global flavors with-gui=wayland with-gui=sdl2 with-gtk=3.0 Name: mlterm Version: 3.9.2 Release: 0 -Summary: Multilingual Terminal Emulator for X +Summary: Multilingual Terminal Emulator for X and Wayland License: BSD-3-Clause Group: System/X11/Terminals -URL: http://mlterm.sourceforge.net/ +URL: https://mlterm.sourceforge.net/ Source0: http://downloads.sourceforge.net/project/mlterm/01release/%{name}-%{version}/%{name}-%{version}.tar.gz Source10: %{name}.desktop Patch0: etc.patch +Patch1: CVE-2022-24130-c_sixel.c-Fix-segmentation-fault-when-the-repeat-cou.patch +Patch2: mlterm-Fix-buffer-overflow-with-long-plugin-suffix.patch +Patch3: mlfc-Fix-crash-with-more-than-1024-font-faces-installed.patch +Patch4: mlterm-SDL2-UI-also-needs-math-libs.patch +Patch5: mlterm-wayland-Detect-compiler-flags.patch +BuildRequires: ccache BuildRequires: coreutils BuildRequires: fwnn-devel BuildRequires: gcc-c++ @@ -33,8 +41,13 @@ BuildRequires: scim-devel BuildRequires: uim-devel BuildRequires: update-desktop-files -BuildRequires: pkgconfig(cairo) +%if 0%{?sle_version} && 0%{?sle_version} <= 150400 BuildRequires: pkgconfig(fcitx) +%else +BuildRequires: pkgconfig(Fcitx5Core) +BuildRequires: pkgconfig(Fcitx5GClient) +%endif +BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(fribidi) BuildRequires: pkgconfig(gail) @@ -44,17 +57,17 @@ BuildRequires: pkgconfig(ibus-1.0) BuildRequires: pkgconfig(libssh2) BuildRequires: pkgconfig(m17n-core) +BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(vte-2.91) +BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wordcut) BuildRequires: pkgconfig(x11) - +BuildRequires: pkgconfig(xkbcommon) +Requires: %{name}-common = %{version}-%{release} Provides: locale(xorg-x11:ja;ko;zh;ar;he) -%if 0%{?suse_version} >= 1330 -Requires: group(tty) -%endif %description -Mlterm is a multilingual terminal emulator for the X Window System. +Mlterm is a multilingual terminal emulator for the X Window System and Wayland. Multilingual features: @@ -69,8 +82,8 @@ character composition: TIS620, TCVN5712, JISX0213, UNICODE -Multiple xims are also supported and you can dynamically change various -xims. +Multiple IMs are also supported and you can dynamically change various +IMs. Other features: * scroll by wheel mouse @@ -81,6 +94,56 @@ * multiple pty windows * scrollbar plug-in API (unstable) +%package common +Summary: Multilingual Terminal Emulator common files +Group: System/Terminals +Conflicts: %{name} < %{version}-%{release} +%if 0%{?suse_version} >= 1330 +Requires: group(tty) +%endif + +%description common +Common files for Mlterm multilingual terminal emulator + +%package sdl2 +Summary: Multilingual Terminal Emulator using SDL rendering +Group: System/Terminals +Requires: %{name}-common = %{version}-%{release} +Provides: locale(ja;ko;zh;ar;he) + +%description sdl2 +Mlterm is a multilingual terminal emulator using SDL rendering + +Multilingual features: + +supported charsets: US_ASCII, ISO8859[1-11], ISO8859[13-16], TCVN5712, +VISCII, KOI8_R, KOI8_U, JISX0201, JISX0208, JISX0212, JISX0213, GB2312, +GBK, KSC5601, UHC, CNS11643-N, Big5, UCS2(4) + +supported encodings: ISO-8859-[1-11], ISO-8859- [13-16], TCVN5612, +VISCII, KOI8_R, KOI8_U, EUC-JP, EUC-JISX0213, ISO-2022-JP [1, 2, 3], +Shift_JIS, Shift_JISX0213, EUC-KR, UHC, JOHAB, ISO-2022-KR, +ISO-2022-CN, GB2312(EUC-CN), GBK, GB18030, EUC-TW, Big5, Hz, UTF-8 + +character composition: TIS620, TCVN5712, JISX0213, UNICODE + +Multiple IMs are also supported and you can dynamically change various +IMs. + +Other features: +* proportional font +* background image (requires Imlib) +* multiple pty windows +* scrollbar plug-in API (unstable) + +%package fcitx +Summary: A fcitx plugin for mlterm +Group: System/X11/Terminals +Provides: locale(fcitx:ja;ko;ar;he) + +%description fcitx +A plugin to use the fcitx input methods directly from mlterm. + %package ibus Summary: Ibus plugin for mlterm Group: System/X11/Terminals @@ -89,13 +152,13 @@ %description ibus A plugin to use the ibus input methods directly from mlterm. -%package wnn -Summary: Wnn plugin for mlterm +%package m17n +Summary: A m17n plugin for mlterm Group: System/X11/Terminals -Provides: locale(scim:ja;ko;ar;he) +Provides: locale(m17n:ja;ko;zh;ar;he) -%description wnn -A plugin to use the wnn input methods directly from mlterm. +%description m17n +A plugin to use the m17n input methods directly from mlterm. %package scim Summary: SCIM plugin for mlterm @@ -113,22 +176,26 @@ %description uim A plugin to use the uim input methods directly from mlterm. -%package m17n -Summary: A m17n plugin for mlterm +%package wnn +Summary: Wnn plugin for mlterm Group: System/X11/Terminals -Provides: locale(m17n:ja;ko;zh;ar;he) +Provides: locale(scim:ja;ko;ar;he) -%description m17n -A plugin to use the m17n input methods directly from mlterm. +%description wnn +A plugin to use the wnn input methods directly from mlterm. %prep %setup -q -%patch0 -p1 +%autopatch -p1 rm -rf doc/{en,ja}/*win32 %build export INSTALL_OPT='-m 755' + +for i in %{flavors} ; do +mkdir $i +pushd $i %configure \ --disable-static \ --libexecdir=%{_libdir}/mlterm \ @@ -141,20 +208,26 @@ --enable-ind \ --enable-m17nlib \ --enable-ibus \ - --disable-fcitx \ + --enable-fcitx \ --enable-wnn \ --enable-scim \ --enable-uim \ - --with-gtk=3.0 \ --with-tools=mlclient,mlcc,mlfc,mlmenu,mlterm-zoom,mlimgloader,mlconfig \ --with-scrollbars=sample,extra,pixmap_engine \ --with-type-engines=xcore,cairo \ --with-imagelib=gdk-pixbuf \ - --enable-optimize-redrawing -make %{?_smp_mflags} + --enable-optimize-redrawing \ + --$i +make -O %{?_smp_mflags} +popd +done %install +for i in %{flavors} ; do +pushd $i %make_install +popd +done mkdir -p %{buildroot}%{_datadir}/pixmaps/ install -m 644 contrib/tool/mlterm-menu/menu %{buildroot}%{_sysconfdir}/X11/mlterm/ install -D -m644 "contrib/icon/%{name}-icon.svg" \ @@ -162,23 +235,49 @@ install -D -m644 "contrib/icon/%{name}-icon-trans.svg" \ "%{buildroot}%{_datadir}/pixmaps/mlclient.svg" +ln -s %{_mandir}/man1/mlterm.1 %{buildroot}%{_mandir}/man1/mlterm-wl.1 +cp -a %{buildroot}%{_mandir}/man1/mlterm.1 %{buildroot}%{_mandir}/man1/mlterm-sdl2.1 + mv %{buildroot}%{_libdir}/mlterm/mlterm/mlterm-zoom \ %{buildroot}%{_bindir}/mlterm-zoom find %{buildroot} -type f -name "*.la" -delete -print %find_lang mlconfig %suse_update_desktop_file -i %{name} TerminalEmulator -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%post -n %{name}-common -p /sbin/ldconfig +%postun -n %{name}-common -p /sbin/ldconfig -%files -f mlconfig.lang -%doc LICENCE* README* doc/en doc/ja +%files %attr(555,root,tty) %{_bindir}/mlterm +%attr(555,root,tty) %{_bindir}/mlterm-wl +%{_bindir}/mlterm-zoom +%{_mandir}/man?/mlterm.?.gz +%{_mandir}/man?/mlterm-wl.?.gz %{_datadir}/applications/%{name}.desktop +%dir %{_sysconfdir}/X11/mlterm/ +%config %{_sysconfdir}/X11/mlterm/* +%{_libdir}/mlterm/libim-kbd.so +%{_libdir}/mlterm/libim-kbd-wl.so +%{_libdir}/mlterm/libim-skk.so +%{_libdir}/mlterm/libim-skk-wl.so +%{_libdir}/mlterm/libathena.so +%{_libdir}/mlterm/libmotif.so +%{_libdir}/mlterm/libmozmodern.so +%{_libdir}/mlterm/libnext.so +%{_libdir}/mlterm/libsample.so +%{_libdir}/mlterm/libpixmap_engine.so +%{_libdir}/mlterm/libtype_cairo.so +%dir %{_libdir}/mlterm/mlterm +%{_libdir}/mlterm/mlterm/mlimgloader +%{_libdir}/mlterm/mlterm/mlconfig +%{_libdir}/mlterm/mlterm/mlmenu + +%files common -f mlconfig.lang +%license LICENCE* +%doc README* doc/en doc/ja %{_bindir}/mlclient %{_bindir}/mlclientx %{_bindir}/mlcc -%{_bindir}/mlterm-zoom %{_bindir}/mlfc %{_libdir}/libpobl.* %{_libdir}/libmlterm_coreotl.so @@ -186,16 +285,8 @@ %dir %{_libdir}/mef %{_libdir}/mef/libmef_* %dir %{_libdir}/mlterm/ -%dir %{_libdir}/mlterm/mlterm -%{_libdir}/mlterm/libathena.so -%{_libdir}/mlterm/libim-kbd.so -%{_libdir}/mlterm/libmotif.so -%{_libdir}/mlterm/libmozmodern.so -%{_libdir}/mlterm/libnext.so -%{_libdir}/mlterm/libsample.so %{_libdir}/mlterm/libctl_bidi.so %{_libdir}/mlterm/libctl_iscii.so -%{_libdir}/mlterm/libim-skk.so %{_libdir}/mlterm/libind_assamese.so %{_libdir}/mlterm/libind_bengali.so %{_libdir}/mlterm/libind_gujarati.so @@ -208,35 +299,37 @@ %{_libdir}/mlterm/libind_punjabi.so %{_libdir}/mlterm/libind_telugu.so %{_libdir}/mlterm/libotl.so -%{_libdir}/mlterm/libpixmap_engine.so %{_libdir}/mlterm/libptyssh.so -%{_libdir}/mlterm/libtype_cairo.so %{_libdir}/mlterm/libzmodem.so -%{_libdir}/mlterm/mlterm/mlimgloader -%{_libdir}/mlterm/mlterm/mlconfig -%{_libdir}/mlterm/mlterm/mlmenu -%dir %{_sysconfdir}/X11/mlterm/ -%config %{_sysconfdir}/X11/mlterm/* -%{_mandir}/man?/* +%{_mandir}/man?/ml[^t]* %{_datadir}/pixmaps/* %dir %{_datadir}/mlterm/ %dir %{_datadir}/mlterm/scrollbars/ %dir %{_datadir}/mlterm/scrollbars/sample3/ %{_datadir}/mlterm/scrollbars/sample3/* +%files sdl2 +%attr(555,root,tty) %{_bindir}/mlterm-sdl2 +%{_mandir}/man?/mlterm-sdl2.?.gz +%{_libdir}/mlterm/libim-kbd-sdl2.so +%{_libdir}/mlterm/libim-skk-sdl2.so + +%files fcitx +%{_libdir}/mlterm/libim-fcitx*.so + %files ibus -%{_libdir}/mlterm/libim-ibus.so +%{_libdir}/mlterm/libim-ibus*.so -%files wnn -%{_libdir}/mlterm/libim-wnn.so +%files m17n +%{_libdir}/mlterm/libim-m17nlib*.so %files scim -%{_libdir}/mlterm/libim-scim.so +%{_libdir}/mlterm/libim-scim*.so %files uim -%{_libdir}/mlterm/libim-uim.so +%{_libdir}/mlterm/libim-uim*.so -%files m17n -%{_libdir}/mlterm/libim-m17nlib.so +%files wnn +%{_libdir}/mlterm/libim-wnn*.so %changelog ++++++ CVE-2022-24130-c_sixel.c-Fix-segmentation-fault-when-the-repeat-cou.patch ++++++ >From 2ee22f5eff111109e77d7c65d6ae80eec77c8c79 Mon Sep 17 00:00:00 2001 From: arakiken <araki...@users.sf.net> Date: Fri, 4 Feb 2022 01:20:01 +0900 Subject: [PATCH] * c_sixel.c: Fix segmentation fault when the repeat count in sixel sequence is over 512. (https://github.com/arakiken/mlterm/issues/35) --- ChangeLog | 6 ++++++ common/c_sixel.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) Index: mlterm-3.9.2/ChangeLog =================================================================== --- mlterm-3.9.2.orig/ChangeLog +++ mlterm-3.9.2/ChangeLog @@ -1,3 +1,9 @@ +2022-02-04 Araki Ken <araki...@users.sf.net> + + * c_sixel.c: Fix segmentation fault when the repeat count in sixel + sequence is over 512. + (https://github.com/arakiken/mlterm/issues/35) + 2022-01-16 Araki Ken <araki...@users.sf.net> * 3.9.2 released. Index: mlterm-3.9.2/common/c_sixel.c =================================================================== --- mlterm-3.9.2.orig/common/c_sixel.c +++ mlterm-3.9.2/common/c_sixel.c @@ -540,10 +540,11 @@ body: } if (width < pix_x + rep) { + u_int expand = BL_MAX(rep, 512); u_int h; - new_width = width + 512; - stride += (512 * PIXEL_SIZE); + new_width = width + expand; + stride += (expand * PIXEL_SIZE); h = width * height / new_width; /* * h=17, pix_y=6 ++++++ mlfc-Fix-crash-with-more-than-1024-font-faces-installed.patch ++++++ >From f14cc7562629ed0af118cfbbf28b985e8b1c4b3c Mon Sep 17 00:00:00 2001 From: Michal Suchanek <msucha...@suse.de> Date: Sun, 26 Feb 2023 13:31:45 +0100 Subject: [PATCH] mlfc: Fix crash with more than 1024 font faces installed Use realloc to allocate the font pointer array rather than a fixed size. Fixes: #58 Signed-off-by: Michal Suchanek <msucha...@suse.de> --- tool/mlfc/main.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/tool/mlfc/main.c b/tool/mlfc/main.c index f32a0ccc..25af3e8e 100644 --- a/tool/mlfc/main.c +++ b/tool/mlfc/main.c @@ -4,6 +4,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> /* alloca */ +#include <stdbool.h> #include <sys/stat.h> #ifdef __sunos #include <alloca.h> @@ -418,8 +419,9 @@ static int check_font_config(const char *default_family /* family name */ const char *path; const char *default_path; FcPattern *pattern; - FcPattern *matches[1024]; - u_int num_matches = 0; + FcPattern **matches = malloc(sizeof(*matches)); + u_int num_matches = 1; + bool did_search = false; int b_idx; struct { struct unicode_block *block; @@ -439,7 +441,7 @@ static int check_font_config(const char *default_family /* family name */ FcPatternPrint(pattern); #endif - matches[num_matches++] = search_next_font(pattern); + matches[0] = search_next_font(pattern); if (*default_family == '\0') { if (FcPatternGet(matches[0], FC_FAMILY, 0, &val) == FcResultMatch) { @@ -454,34 +456,36 @@ static int check_font_config(const char *default_family /* family name */ } for (b_idx = 0; b_idx < sizeof(blocks) / sizeof(blocks[0]); b_idx++) { - int m_idx; + u_int m_idx; for (m_idx = 0;; m_idx++) { FcCharSet *charset; if (m_idx == num_matches) { - if (num_matches == sizeof(matches) / sizeof(matches[0]) || - matches[num_matches - 1] == NULL) { + if (did_search) break; - } + matches = realloc(matches, sizeof(*matches) * (num_matches + 1)); if (!(matches[num_matches] = search_next_font(pattern))) { - int count; + u_int count; FcPattern *pat = FcPatternCreate(); FcObjectSet *objset = FcObjectSetBuild(FC_FAMILY, FC_FILE, FC_CHARSET, NULL); FcFontSet *fontset = FcFontList(NULL, pat, objset); + matches = realloc(matches, sizeof(*matches) * (num_matches + fontset->nfont)); for (count = 0; count < fontset->nfont; count++) { - matches[num_matches++] = fontset->fonts[count]; - FcPatternGet(matches[num_matches - 1], FC_FAMILY, 0, &val); + matches[num_matches + count] = fontset->fonts[count]; + FcPatternGet(matches[num_matches + count], FC_FAMILY, 0, &val); #if 0 - fprintf(stderr, "Add Font List %s\n", val.u.s); + fprintf(stderr, "%u Add Font List %s\n", num_matches + count, val.u.s); #endif } - matches[num_matches] = NULL; + did_search = true; + num_matches += fontset->nfont; + } else { + num_matches++; } - num_matches++; } if (!matches[m_idx]) { -- 2.39.2 ++++++ mlterm-Fix-buffer-overflow-with-long-plugin-suffix.patch ++++++ >From 90ced520f47ca46b00e889ecd9db81aa1426403d Mon Sep 17 00:00:00 2001 From: Michal Suchanek <msucha...@suse.de> Date: Fri, 24 Feb 2023 22:14:57 +0100 Subject: [PATCH] Fix buffer overflow with long plugin suffix The buffer length for appending suffix to module name is not correctly calculated. Fix the calculation to avoid memory corruption. Signed-off-by: Michal Suchanek <msucha...@suse.de> --- uitoolkit/ui_im.c | 2 +- uitoolkit/ui_sb_view_factory.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/uitoolkit/ui_im.c b/uitoolkit/ui_im.c index 18607291..754ddfe4 100644 --- a/uitoolkit/ui_im.c +++ b/uitoolkit/ui_im.c @@ -77,7 +77,7 @@ static int dlsym_im_new_func(char *im_name, ui_im_new_func_t *func, bl_dl_handle sprintf(symname, "im_%s_new", im_name); #ifdef PLUGIN_MODULE_SUFFIX - if ((im_name2 = alloca(strlen(im_name) + 3 + 1))) { + if ((im_name2 = alloca(strlen(im_name) + strlen(PLUGIN_MODULE_SUFFIX) + 2))) { sprintf(im_name2, "%s-" PLUGIN_MODULE_SUFFIX, im_name); if (!(*handle = im_dlopen(im_name2))) { diff --git a/uitoolkit/ui_sb_view_factory.c b/uitoolkit/ui_sb_view_factory.c index 66a9ebb6..16aeb5ae 100644 --- a/uitoolkit/ui_sb_view_factory.c +++ b/uitoolkit/ui_sb_view_factory.c @@ -48,7 +48,7 @@ static ui_sb_view_new_func_t dlsym_sb_view_new_func(const char *name, int is_tra #ifdef PLUGIN_MODULE_SUFFIX char *p; - if (!(p = alloca(strlen(name) + 3 + 1))) { + if (!(p = alloca(strlen(name) + strlen(PLUGIN_MODULE_SUFFIX) + 2))) { return NULL; } @@ -98,7 +98,7 @@ static ui_sb_engine_new_func_t dlsym_sb_engine_new_func(const char *name) { #ifdef PLUGIN_MODULE_SUFFIX char *p; - if (!(p = alloca(strlen(name) + 3 + 1))) { + if (!(p = alloca(strlen(name) + strlen(PLUGIN_MODULE_SUFFIX) + 2))) { return NULL; } -- 2.39.2 ++++++ mlterm-SDL2-UI-also-needs-math-libs.patch ++++++ >From 5350ebd0a23f4af93fa14e3fc93fa45e09e71a5e Mon Sep 17 00:00:00 2001 From: Michal Suchanek <msucha...@suse.de> Date: Sun, 26 Feb 2023 19:07:33 +0100 Subject: [PATCH 1/2] SDL2 UI also needs math libs Signed-off-by: Michal Suchanek <msucha...@suse.de> --- main/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/Makefile.in b/main/Makefile.in index e44d24a7b..6144de1f7 100644 --- a/main/Makefile.in +++ b/main/Makefile.in @@ -68,7 +68,7 @@ LIBS2_wayland = @FT_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @SOCK_LIBS@ \ LIBS2_sdl2_win32 = ../uitoolkit/winrs.o -LIBS2_sdl2 = @SDL2_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @FT_LIBS@ @SOCK_LIBS@ $(LIBS2_@GUI@_@SDL2GUI@) +LIBS2_sdl2 = @SDL2_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @FT_LIBS@ @SOCK_LIBS@ $(LIBS2_@GUI@_@SDL2GUI@) LIBS = $(LIBS1) $(LIBS2_@GUI@) -- 2.39.2 ++++++ mlterm-wayland-Detect-compiler-flags.patch ++++++ >From 0f89f902fc57ea66e724103ed13600b077db9f99 Mon Sep 17 00:00:00 2001 From: Michal Suchanek <msucha...@suse.de> Date: Sun, 26 Feb 2023 19:36:16 +0100 Subject: [PATCH 2/2] wayland: Detect compiler flags Use pkgconfig to detect include path required for building wayland backend. Do not hardcode wayland libraries, use pkgconfig to detect them. Signed-off-by: Michal Suchanek <msucha...@suse.de> --- configure | 103 +++++++++++++++++++++++++++++++- configure.in | 5 +- inputmethod/canna/Makefile.in | 1 + inputmethod/fcitx/Makefile.in | 1 + inputmethod/ibus/Makefile.in | 1 + inputmethod/iiimf/Makefile.in | 1 + inputmethod/kbd/Makefile.in | 1 + inputmethod/m17nlib/Makefile.in | 1 + inputmethod/scim/Makefile.in | 1 + inputmethod/skk/Makefile.in | 1 + inputmethod/uim/Makefile.in | 1 + inputmethod/wnn/Makefile.in | 1 + main/Makefile.in | 5 +- uitoolkit/Makefile.in | 2 +- 14 files changed, 119 insertions(+), 6 deletions(-) Index: mlterm-3.9.2/configure =================================================================== --- mlterm-3.9.2.orig/configure +++ mlterm-3.9.2/configure @@ -785,6 +785,8 @@ SDL2GUI sdl2_config SDL2_LIBS SDL2_CFLAGS +WAYLAND_LIBS +WAYLAND_CFLAGS SIXEL_LIBS SIXEL_CFLAGS VT_NORM_CFLAGS @@ -1008,6 +1010,8 @@ GIO_CFLAGS GIO_LIBS FT_CFLAGS FT_LIBS +WAYLAND_CFLAGS +WAYLAND_LIBS SDL2_CFLAGS SDL2_LIBS FRIBIDI_CFLAGS @@ -1769,6 +1773,10 @@ Some influential environment variables: GIO_LIBS linker flags for GIO, overriding pkg-config FT_CFLAGS C compiler flags for FT, overriding pkg-config FT_LIBS linker flags for FT, overriding pkg-config + WAYLAND_CFLAGS + C compiler flags for WAYLAND, overriding pkg-config + WAYLAND_LIBS + linker flags for WAYLAND, overriding pkg-config SDL2_CFLAGS C compiler flags for SDL2, overriding pkg-config SDL2_LIBS linker flags for SDL2, overriding pkg-config FRIBIDI_CFLAGS @@ -18057,8 +18065,101 @@ elif test "$gui" = "beos" ; then GUI="beos" GUI_CFLAGS="-DUSE_BEOS" elif test "$gui" = "wayland" ; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND" >&5 +$as_echo_n "checking for WAYLAND... " >&6; } + +if test -n "$WAYLAND_CFLAGS"; then + pkg_cv_WAYLAND_CFLAGS="$WAYLAND_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client wayland-cursor xkbcommon\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-client wayland-cursor xkbcommon") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_CFLAGS=`$PKG_CONFIG --cflags "wayland-client wayland-cursor xkbcommon" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WAYLAND_LIBS"; then + pkg_cv_WAYLAND_LIBS="$WAYLAND_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client wayland-cursor xkbcommon\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-client wayland-cursor xkbcommon") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_LIBS=`$PKG_CONFIG --libs "wayland-client wayland-cursor xkbcommon" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + WAYLAND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client wayland-cursor xkbcommon" 2>&1` + else + WAYLAND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client wayland-cursor xkbcommon" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WAYLAND_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (wayland-client wayland-cursor xkbcommon) were not met: + +$WAYLAND_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables WAYLAND_CFLAGS +and WAYLAND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables WAYLAND_CFLAGS +and WAYLAND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } +else + WAYLAND_CFLAGS=$pkg_cv_WAYLAND_CFLAGS + WAYLAND_LIBS=$pkg_cv_WAYLAND_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi GUI="wayland" GUI_CFLAGS="-DUSE_WAYLAND" + + elif test "$gui" = "sdl2" ; then pkg_failed=no @@ -18131,7 +18232,7 @@ else $as_echo "yes" >&6; } have_sdl2=yes fi - if test "$have_sdl2" != "yes" ; then + if test "$have_sdl2" != "yes" ; then # Extract the first word of "sdl2-config", so it can be a program name with args. set dummy sdl2-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 Index: mlterm-3.9.2/configure.in =================================================================== --- mlterm-3.9.2.orig/configure.in +++ mlterm-3.9.2/configure.in @@ -539,11 +539,14 @@ elif test "$gui" = "beos" ; then GUI="beos" GUI_CFLAGS="-DUSE_BEOS" elif test "$gui" = "wayland" ; then + PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-cursor xkbcommon]) GUI="wayland" GUI_CFLAGS="-DUSE_WAYLAND" + AC_SUBST(WAYLAND_CFLAGS) + AC_SUBST(WAYLAND_LIBS) elif test "$gui" = "sdl2" ; then PKG_CHECK_MODULES(SDL2, sdl2, have_sdl2=yes, have_sdl2=no) - if test "$have_sdl2" != "yes" ; then + if test "$have_sdl2" != "yes" ; then AC_CHECK_PROG(sdl2_config, sdl2-config, yes) if test "$sdl2_config" = "yes"; then SDL2_CFLAGS="`sdl2-config --cflags`" Index: mlterm-3.9.2/inputmethod/canna/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/canna/Makefile.in +++ mlterm-3.9.2/inputmethod/canna/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/fcitx/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/fcitx/Makefile.in +++ mlterm-3.9.2/inputmethod/fcitx/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/ibus/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/ibus/Makefile.in +++ mlterm-3.9.2/inputmethod/ibus/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/iiimf/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/iiimf/Makefile.in +++ mlterm-3.9.2/inputmethod/iiimf/Makefile.in @@ -18,6 +18,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TYPE_CFLAGS@ \ @CFLAGS@ \ Index: mlterm-3.9.2/inputmethod/kbd/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/kbd/Makefile.in +++ mlterm-3.9.2/inputmethod/kbd/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/m17nlib/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/m17nlib/Makefile.in +++ mlterm-3.9.2/inputmethod/m17nlib/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/scim/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/scim/Makefile.in +++ mlterm-3.9.2/inputmethod/scim/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @MEF_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/skk/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/skk/Makefile.in +++ mlterm-3.9.2/inputmethod/skk/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/uim/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/uim/Makefile.in +++ mlterm-3.9.2/inputmethod/uim/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/inputmethod/wnn/Makefile.in =================================================================== --- mlterm-3.9.2.orig/inputmethod/wnn/Makefile.in +++ mlterm-3.9.2/inputmethod/wnn/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @CFLAGS@ \ @CPPFLAGS@ \ Index: mlterm-3.9.2/main/Makefile.in =================================================================== --- mlterm-3.9.2.orig/main/Makefile.in +++ mlterm-3.9.2/main/Makefile.in @@ -38,7 +38,7 @@ LMEF_DEB = -lmef_deb # XDATADIR is to avoid conflicting with DATADIR structure in w32api/objidl.h. CFLAGS = $(CFLAGS_LOCAL) @POBL_CFLAGS@ @MEF_CFLAGS@ @DEB_CFLAGS@ @BRLAPI_CFLAGS@ \ - @X_CFLAGS@ @GUI_CFLAGS@ @SSH2_CFLAGS@ @TYPE_CFLAGS@ @FT_CFLAGS@ @SDL2_CFLAGS@ \ + @X_CFLAGS@ @GUI_CFLAGS@ @SSH2_CFLAGS@ @TYPE_CFLAGS@ @FT_CFLAGS@ @WAYLAND_CFLAGS@ @SDL2_CFLAGS@ \ @DAEMON_CFLAGS@ @SPLIT_CFLAGS@ @DND_CFLAGS@ @TRANSFER_CFLAGS@ @IMAGE_CFLAGS@ \ @CFLAGS@ @CPPFLAGS@ -DSYSCONFDIR=\"$(sysconfdir)\" -I$(top_srcdir)/vtemu \ -I${top_srcdir}/uitoolkit -I${top_builddir}/main -I/usr/local/include @@ -62,8 +62,7 @@ LIBS2_beos = -lbe -ltranslation -lsocket LIBS2_console = @SIXEL_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @SOCK_LIBS@ -LIBS2_wayland = @FT_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @SOCK_LIBS@ \ - -lwayland-client -lwayland-cursor -lxkbcommon +LIBS2_wayland = @WAYLAND_LIBS@ @FT_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @SOCK_LIBS@ LIBS2_sdl2_win32 = ../uitoolkit/winrs.o Index: mlterm-3.9.2/uitoolkit/Makefile.in =================================================================== --- mlterm-3.9.2.orig/uitoolkit/Makefile.in +++ mlterm-3.9.2/uitoolkit/Makefile.in @@ -59,7 +59,7 @@ CFLAGS = $(CFLAGS_LOCAL) @POBL_CFLAGS@ @ @IMAGELIB_CFLAGS@ @X_CFLAGS@ @GUI_CFLAGS@ @SSH2_CFLAGS@ @XUTF8_CFLAGS@ @DND_CFLAGS@ \ @IM_CFLAGS@ @SB_CFLAGS@ @REGEX_CFLAGS@ @CTL_CFLAGS@ @TYPE_CFLAGS@ @FT_CFLAGS@ \ @IMAGE_CFLAGS@ @TOOLS_CFLAGS@ @OT_LAYOUT_CFLAGS@ @SIXEL_CFLAGS@ @BRLAPI_CFLAGS@ \ - @SDL2_CFLAGS@ @SPLIT_CFLAGS@ @CFLAGS@ @CPPFLAGS@ \ + @WAYLAND_CFLAGS@ @SDL2_CFLAGS@ @SPLIT_CFLAGS@ @CFLAGS@ @CPPFLAGS@ \ -DBINDIR=\"$(bindir)\" -DLIBDIR=\"$(libdir)\" -DLIBEXECDIR=\"$(libexecdir)\" \ -DXDATADIR=\"$(datadir)\" \ -I$(top_srcdir)/vtemu -I$(top_srcdir)/uitoolkit/libotl -I/usr/local/include