Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/mlterm mlterm: pull an upstream patch for 3.9.0.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bd3eba470452
branches:  trunk
changeset: 434786:bd3eba470452
user:      tsutsui <tsutsui%pkgsrc.org@localhost>
date:      Sun Jun 21 17:53:01 2020 +0000

description:
mlterm: pull an upstream patch for 3.9.0.

Also put misc pkgsrc tweaks:
- Disable SPECIAL_PERMS for mlterm.  It was required for utmp support
  only on ancient systems that have none of pututxline(3), setutent(3),
  or addToUtmp(3) but have to use logwtmp(3) or open system's _PATH_UTMP
  or _PATH_WTMP file directly to update utmp entries, but no easy way
  to statically identify them per OS and version basis.
- Add hacks.mk to avoid gcc SIGSEGV on NetBSD/sh3 9.0 (PR/55265)
- Appease several pkglint warnings/errors.

Bump PKGREVISION.

diffstat:

 x11/mlterm/Makefile                                    |   16 +-
 x11/mlterm/distinfo                                    |    5 +-
 x11/mlterm/hacks.mk                                    |   17 ++
 x11/mlterm/options.mk                                  |    5 +-
 x11/mlterm/patches/patch-etc_font-fb                   |   20 +-
 x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c |  136 +++++++++++++++++
 6 files changed, 179 insertions(+), 20 deletions(-)

diffs (275 lines):

diff -r 0fc0668d3e8f -r bd3eba470452 x11/mlterm/Makefile
--- a/x11/mlterm/Makefile       Sun Jun 21 16:49:06 2020 +0000
+++ b/x11/mlterm/Makefile       Sun Jun 21 17:53:01 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.160 2020/06/02 08:25:02 adam Exp $
+# $NetBSD: Makefile,v 1.161 2020/06/21 17:53:01 tsutsui Exp $
 
 DISTNAME=      mlterm-3.9.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    x11
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=mlterm/}
 
@@ -52,12 +52,18 @@
 SUBST_MESSAGE.conf=    Fixing hardcoded paths in config files.
 SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      etc/font-fb
-SUBST_SED.conf=                -e 's|/usr/X11R7/|${X11BASE}/|g'
-SUBST_SED.conf+=       -e 's|/usr/pkg/|${PREFIX}/|g'
+SUBST_VARS.conf=       PREFIX X11BASE
 
 BUILDLINK_DEPMETHOD.libXt?=    build
 
-SPECIAL_PERMS+=                bin/mlterm ${REAL_ROOT_USER} utmp 2755
+# XXX
+# setgid is required only on ancient systems that have
+# none of pututxline(3), setutent(3), or addToUtmp(3)
+# but have to use logwtmp(3) or open system's _PATH_UTMP
+# or _PATH_WTMP file directly to handle utmp entries.
+# configure script checks these functions automatically, but
+# no easy way to statically identify them per OS and version.
+#SPECIAL_PERMS+=               bin/mlterm ${REAL_ROOT_USER} utmp 2755
 
 INSTALLATION_DIRS=     share/doc/mlterm share/doc/mlterm/en share/doc/mlterm/ja
 
diff -r 0fc0668d3e8f -r bd3eba470452 x11/mlterm/distinfo
--- a/x11/mlterm/distinfo       Sun Jun 21 16:49:06 2020 +0000
+++ b/x11/mlterm/distinfo       Sun Jun 21 17:53:01 2020 +0000
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.84 2020/04/27 15:45:43 tsutsui Exp $
+$NetBSD: distinfo,v 1.85 2020/06/21 17:53:01 tsutsui Exp $
 
 SHA1 (mlterm-3.9.0.tar.gz) = be37059caab99219be79b14cfabfb26d34bb8954
 RMD160 (mlterm-3.9.0.tar.gz) = d5fec228b86918fe8dec05a6957869520dc8e5d4
 SHA512 (mlterm-3.9.0.tar.gz) = d89340eb460904ca36c6ed063b356625d9c9b4ad129dc51640d50a04e166f8239124d0003db778376c47daa6311c869f9fe7e337c90937fed5ae4151f5af57c4
 Size (mlterm-3.9.0.tar.gz) = 4143644 bytes
 SHA1 (patch-configure) = ce9fe3642258c5ab01d4e371e067c5f1501d5c22
-SHA1 (patch-etc_font-fb) = 03f0b2ecee20ef3201c8e4ce17f03ac90f657b00
+SHA1 (patch-etc_font-fb) = 52c18f512c67ff530c0c326394fdf43956d71cb0
+SHA1 (patch-uitoolkit_xlib_ui__imagelib.c) = 787e38dc9505850151d58177ea1cbadbecb96075
 SHA1 (patch-vtemu_Makefile.in) = 172f12f73408489f782d63c8b0b7915af441d368
diff -r 0fc0668d3e8f -r bd3eba470452 x11/mlterm/hacks.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/mlterm/hacks.mk       Sun Jun 21 17:53:01 2020 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: hacks.mk,v 1.1 2020/06/21 17:53:01 tsutsui Exp $
+
+.if !defined(MLTERM_HACKS_MK)
+MLTERM_HACKS_MK=       defined
+
+.include "../../mk/compiler.mk"
+
+# On NetBSD/sh3el 9.0, the default -Os causes an error on compiling
+# vt_line_bidi.c and -fno-dce works around. (PR/55265)
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-sh3*) && !empty(CC_VERSION:Mgcc-7.4.*)
+PKG_HACKS+=            optimisation
+# XXX: is there any good way to replace the default -Os with multiple args?
+#BUILDLINK_TRANSFORM+=
+CFLAGS+=               -fno-dce
+.endif
+
+.endif # MLTERM_HACKS_MK
diff -r 0fc0668d3e8f -r bd3eba470452 x11/mlterm/options.mk
--- a/x11/mlterm/options.mk     Sun Jun 21 16:49:06 2020 +0000
+++ b/x11/mlterm/options.mk     Sun Jun 21 17:53:01 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: options.mk,v 1.19 2020/06/20 07:50:45 rillig Exp $
+# $NetBSD: options.mk,v 1.20 2020/06/21 17:53:01 tsutsui Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.mlterm
-PKG_SUPPORTED_OPTIONS= cairo canna fcitx fribidi gdk_pixbuf2 ibus libind m17nlib mlterm-fb mlterm-x68kgrf otl scim skk uim wnn4 xft2
+PKG_SUPPORTED_OPTIONS= cairo canna fcitx fribidi gdk_pixbuf2 ibus libind m17nlib mlterm-fb otl scim skk uim wnn4 xft2
 PKG_SUGGESTED_OPTIONS= cairo fribidi gdk_pixbuf2 m17nlib otl xft2
 .if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux"
 PKG_SUGGESTED_OPTIONS+=        mlterm-fb
@@ -14,7 +14,6 @@
 .if !empty(PKG_OPTIONS:Mmlterm-fb)
 .  if ${OPSYS} == "NetBSD"
 .    if ${MACHINE_ARCH} == "m68k"
-PKG_SUGGESTED_OPTIONS+=        mlterm-x68kgrf
 CONFIGURE_ARGS+=       --with-gui=xlib,wscons,x68kgrf
 SPECIAL_PERMS+=                ${PREFIX:Q}/bin/mlterm-x68kgrf ${SETUID_ROOT_PERMS}
 PLIST.x68kgrf=         yes
diff -r 0fc0668d3e8f -r bd3eba470452 x11/mlterm/patches/patch-etc_font-fb
--- a/x11/mlterm/patches/patch-etc_font-fb      Sun Jun 21 16:49:06 2020 +0000
+++ b/x11/mlterm/patches/patch-etc_font-fb      Sun Jun 21 17:53:01 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-etc_font-fb,v 1.9 2015/10/30 15:29:20 tsutsui Exp $
+$NetBSD: patch-etc_font-fb,v 1.10 2020/06/21 17:53:01 tsutsui Exp $
 
 add more examples for typical NetBSD and pkgsrc installation
 
@@ -6,23 +6,23 @@
 +++ etc/font-fb
 @@ -1,12 +1,19 @@
 -#DEFAULT = /usr/share/fonts/X11/misc/unifont.pcf.gz:100
-+#DEFAULT = /usr/pkg/share/fonts/X11/misc/unifont.pcf.gz:100
-+#DEFAULT = /usr/pkg/share/fonts/X11/efont/b16.pcf.gz
++#DEFAULT = @PREFIX@/share/fonts/X11/misc/unifont.pcf.gz:100
++#DEFAULT = @PREFIX@/share/fonts/X11/efont/b16.pcf.gz
  
  #ISO8859_1 = /usr/share/fonts/X11/misc/mplus_f12r.pcf.gz
-+#ISO8859_1 = /usr/X11R7/lib/X11/fonts/misc/8x16.pcf.gz
-+#JISX0201_KATA = /usr/X11R7/lib/X11/fonts/misc/8x16rk.pcf.gz
++#ISO8859_1 = @X11BASE@/lib/X11/fonts/misc/8x16.pcf.gz
++#JISX0201_KATA = @X11BASE@/lib/X11/fonts/misc/8x16rk.pcf.gz
  #JISX0208_1983 = /usr/share/fonts/X11/misc/mplus_j12r.pcf.gz
-+#JISX0208_1983 = /usr/X11R7/lib/X11/fonts/misc/jiskan16.pcf.gz
++#JISX0208_1983 = @X11BASE@/lib/X11/fonts/misc/jiskan16.pcf.gz
  JISC6226_1978 = &JISX0208_1983
  JISX0208_1990 = &JISX0208_1983
  JISX0213_2000_1 = &JISX0208_1983
-+#JISX0213_2000_1=/usr/pkg/share/fonts/X11/local/jiskan16-2000-1.pcf.gz
-+#JISX0213_2000_2=/usr/pkg/share/fonts/X11/local/jiskan16-2000-2.pcf.gz
++#JISX0213_2000_1 = @PREFIX@/share/fonts/X11/local/jiskan16-2000-1.pcf.gz
++#JISX0213_2000_2 = @PREFIX@/share/fonts/X11/local/jiskan16-2000-2.pcf.gz
  
 -#ISO10646_UCS4_1 = /usr/share/fonts/X11/misc/unifont.pcf.gz:100
-+#ISO10646_UCS4_1 = /usr/pkg/share/fonts/X11/misc/unifont.pcf.gz:100
-+#ISO10646_UCS4_1 = /usr/pkg/share/fonts/X11/efont/b16.pcf.gz
++#ISO10646_UCS4_1 = @PREFIX@/share/fonts/X11/misc/unifont.pcf.gz:100
++#ISO10646_UCS4_1 = @PREFIX@/share/fonts/X11/efont/b16.pcf.gz
  ISO10646_UCS4_1_FULLWIDTH = &ISO10646_UCS4_1
  
  #ISCII_ASSAMESE = /usr/share/fonts/truetype/Asdr0ntt.ttf:120
diff -r 0fc0668d3e8f -r bd3eba470452 x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c    Sun Jun 21 17:53:01 2020 +0000
@@ -0,0 +1,136 @@
+$NetBSD: patch-uitoolkit_xlib_ui__imagelib.c,v 1.1 2020/06/21 17:53:01 tsutsui Exp $
+
+Pull upstrem fixes from mlterm-3.9.0-fixes.patch:
+> This patch gets mlimgloader to exit correctly after loading a wall picture.
+
+--- uitoolkit/xlib/ui_imagelib.c.orig  2020-04-26 12:54:53.000000000 +0000
++++ uitoolkit/xlib/ui_imagelib.c
+@@ -1226,20 +1226,24 @@ static int modify_image(GdkPixbuf *pixbu
+ 
+ #else /* NO_TOOLS */
+ 
+-static pid_t exec_mlimgloader(int *read_fd, Window window,
+-                              u_int width, u_int height, char *path, char *dst, char *opt) {
+-  int fds[2];
++static pid_t exec_mlimgloader(int *read_fd,
++                              int *write_fd /* close(write_fd) makes mlimgloader exit */,
++                              Window window, u_int width, u_int height,
++                              char *path, char *dst, char *opt) {
++  int fds1[2];
++  int fds2[2];
+   pid_t pid;
+ 
+-  if (!path || !*path || pipe(fds) == -1) {
++  if (!path || !*path || pipe(fds1) == -1) {
+     return -1;
+   }
+ 
+-  if ((pid = fork()) == -1) {
+-    close(fds[0]);
+-    close(fds[1]);
++  if (pipe(fds2) == -1) {
++    goto error1;
++  }
+ 
+-    return -1;
++  if ((pid = fork()) == -1) {
++    goto error2;
+   }
+ 
+   if (pid == 0) {
+@@ -1262,9 +1266,10 @@ static pid_t exec_mlimgloader(int *read_
+     args[6] = opt;
+     args[7] = NULL;
+ 
+-    close(fds[0]);
++    close(fds1[1]);
++    close(fds2[0]);
+ 
+-    if (dup2(fds[1], STDOUT_FILENO) != -1) {
++    if (dup2(fds1[0], STDIN_FILENO) != -1 && dup2(fds2[1], STDOUT_FILENO) != -1) {
+       execv(args[0], args);
+     }
+ 
+@@ -1273,23 +1278,35 @@ static pid_t exec_mlimgloader(int *read_
+     exit(1);
+   }
+ 
+-  close(fds[1]);
++  close(fds1[0]);
++  close(fds2[1]);
+ 
+-  *read_fd = fds[0];
++  *write_fd = fds1[1];
++  *read_fd = fds2[0];
+ 
+   return pid;
++
++error2:
++  close(fds2[0]);
++  close(fds2[1]);
++error1:
++  close(fds1[0]);
++  close(fds1[1]);
++
++  return -1;
+ }
+ 
+ static int load_file(ui_display_t *disp, char *path, u_int *width, u_int *height, int keep_aspect,
+                      ui_picture_modifier_t *pic_mod, Pixmap *pixmap, Pixmap *mask /* Can be NULL */
+                      ) {
+   int read_fd;
++  int write_fd;
+   char pix_str[DIGIT_STR_LEN(Pixmap) + 1 + DIGIT_STR_LEN(Pixmap) + 1];
+   Pixmap pixmap_tmp;
+   Pixmap mask_tmp;
+   ssize_t size;
+ 
+-  if (exec_mlimgloader(&read_fd, ui_display_get_group_leader(disp), *width, *height,
++  if (exec_mlimgloader(&read_fd, &write_fd, ui_display_get_group_leader(disp), *width, *height,
+                        path, "pixmap", keep_aspect ? "-a" : NULL) == -1) {
+     return 0;
+   }
+@@ -1338,22 +1355,29 @@ static int load_file(ui_display_t *disp,
+ 
+   XSync(disp->display, False);
+ 
+-  close(read_fd); /* child process exited by this. pixmap_tmp is alive until here. */
++  close(read_fd);
++  /*
++   * child process exited by this. pixmap_tmp is alive until here.
++   * (See read(STDIN_FILENO) in mlimgloader/gdk-pixbuf.c)
++   */
++  close(write_fd);
+ 
+   return 1;
+ 
+ error:
+   close(read_fd);
++  close(write_fd);
+ 
+   return 0;
+ }
+ 
+ static u_int32_t *create_cardinals_from_file(char *path, u_int32_t width, u_int32_t height) {
+   int read_fd;
++  int write_fd;
+   u_int32_t *cardinal;
+   ssize_t size;
+ 
+-  if (exec_mlimgloader(&read_fd, None, width, height, path, "stdout", NULL) == -1) {
++  if (exec_mlimgloader(&read_fd, &write_fd, None, width, height, path, "stdout", NULL) == -1) {
+     return 0;
+   }
+ 
+@@ -1381,6 +1405,11 @@ static u_int32_t *create_cardinals_from_
+   }
+ 
+   close(read_fd);
++  /*
++   * child process exited by this. pixmap_tmp is alive until here.
++   * (See read(STDIN_FILENO) in mlimgloader/gdk-pixbuf.c)
++   */
++  close(write_fd);
+ 
+ #ifdef DEBUG
+   bl_debug_printf(BL_DEBUG_TAG " %s(w %d h %d) is loaded.\n", path, width, height);



Home | Main Index | Thread Index | Old Index