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.diff -r1.160 -r1.161 pkgsrc/x11/mlterm/Makefile
(tsutsui)
@@ -1,17 +1,17 @@ | @@ -1,17 +1,17 @@ | |||
1 | # $NetBSD: Makefile,v 1.160 2020/06/02 08:25:02 adam Exp $ | 1 | # $NetBSD: Makefile,v 1.161 2020/06/21 17:53:01 tsutsui Exp $ | |
2 | 2 | |||
3 | DISTNAME= mlterm-3.9.0 | 3 | DISTNAME= mlterm-3.9.0 | |
4 | PKGREVISION= 1 | 4 | PKGREVISION= 2 | |
5 | CATEGORIES= x11 | 5 | CATEGORIES= x11 | |
6 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mlterm/} | 6 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mlterm/} | |
7 | 7 | |||
8 | MAINTAINER= tsutsui@NetBSD.org | 8 | MAINTAINER= tsutsui@NetBSD.org | |
9 | HOMEPAGE= http://mlterm.sourceforge.net/ | 9 | HOMEPAGE= http://mlterm.sourceforge.net/ | |
10 | COMMENT= Multilingual terminal emulator | 10 | COMMENT= Multilingual terminal emulator | |
11 | LICENSE= modified-bsd | 11 | LICENSE= modified-bsd | |
12 | 12 | |||
13 | # CODESET is only supported on NetBSD in 1.5T and later - see <langinfo.h> | 13 | # CODESET is only supported on NetBSD in 1.5T and later - see <langinfo.h> | |
14 | NOT_FOR_PLATFORM= NetBSD-1.[0-4]*-* NetBSD-1.5[A-S]-* | 14 | NOT_FOR_PLATFORM= NetBSD-1.[0-4]*-* NetBSD-1.5[A-S]-* | |
15 | 15 | |||
16 | USE_TOOLS+= pkg-config msgfmt | 16 | USE_TOOLS+= pkg-config msgfmt | |
17 | USE_LIBTOOL= yes | 17 | USE_LIBTOOL= yes | |
@@ -42,32 +42,38 @@ SUBST_SED.link+= -e 's|/usr/local/|${PRE | @@ -42,32 +42,38 @@ SUBST_SED.link+= -e 's|/usr/local/|${PRE | |||
42 | SUBST_SED.link+= -e 's|/usr/X11R7/|${X11BASE}/|g' | 42 | SUBST_SED.link+= -e 's|/usr/X11R7/|${X11BASE}/|g' | |
43 | 43 | |||
44 | SUBST_CLASSES+= man | 44 | SUBST_CLASSES+= man | |
45 | SUBST_MESSAGE.man= Fixing hardcoded paths in man pages. | 45 | SUBST_MESSAGE.man= Fixing hardcoded paths in man pages. | |
46 | SUBST_STAGE.man= pre-configure | 46 | SUBST_STAGE.man= pre-configure | |
47 | SUBST_FILES.man= man/mlterm.1 | 47 | SUBST_FILES.man= man/mlterm.1 | |
48 | SUBST_SED.man= -e 's|/usr/X11R6/lib/X11/mlterm/|${PKG_SYSCONFDIR}/|g' | 48 | SUBST_SED.man= -e 's|/usr/X11R6/lib/X11/mlterm/|${PKG_SYSCONFDIR}/|g' | |
49 | SUBST_SED.man+= -e 's|/usr/X11R6/include/|${X11BASE}/include/|g' | 49 | SUBST_SED.man+= -e 's|/usr/X11R6/include/|${X11BASE}/include/|g' | |
50 | 50 | |||
51 | SUBST_CLASSES+= conf | 51 | SUBST_CLASSES+= conf | |
52 | SUBST_MESSAGE.conf= Fixing hardcoded paths in config files. | 52 | SUBST_MESSAGE.conf= Fixing hardcoded paths in config files. | |
53 | SUBST_STAGE.conf= pre-configure | 53 | SUBST_STAGE.conf= pre-configure | |
54 | SUBST_FILES.conf= etc/font-fb | 54 | SUBST_FILES.conf= etc/font-fb | |
55 | SUBST_SED.conf= -e 's|/usr/X11R7/|${X11BASE}/|g' | 55 | SUBST_VARS.conf= PREFIX X11BASE | |
56 | SUBST_SED.conf+= -e 's|/usr/pkg/|${PREFIX}/|g' | |||
57 | 56 | |||
58 | BUILDLINK_DEPMETHOD.libXt?= build | 57 | BUILDLINK_DEPMETHOD.libXt?= build | |
59 | 58 | |||
60 | SPECIAL_PERMS+= bin/mlterm ${REAL_ROOT_USER} utmp 2755 | 59 | # XXX | |
60 | # setgid is required only on ancient systems that have | |||
61 | # none of pututxline(3), setutent(3), or addToUtmp(3) | |||
62 | # but have to use logwtmp(3) or open system's _PATH_UTMP | |||
63 | # or _PATH_WTMP file directly to handle utmp entries. | |||
64 | # configure script checks these functions automatically, but | |||
65 | # no easy way to statically identify them per OS and version. | |||
66 | #SPECIAL_PERMS+= bin/mlterm ${REAL_ROOT_USER} utmp 2755 | |||
61 | 67 | |||
62 | INSTALLATION_DIRS= share/doc/mlterm share/doc/mlterm/en share/doc/mlterm/ja | 68 | INSTALLATION_DIRS= share/doc/mlterm share/doc/mlterm/en share/doc/mlterm/ja | |
63 | 69 | |||
64 | post-install: | 70 | post-install: | |
65 | .for f in FAQ PROTOCOL README.bidi README.fb README.indic README.xim | 71 | .for f in FAQ PROTOCOL README.bidi README.fb README.indic README.xim | |
66 | ${INSTALL_DATA} ${WRKSRC}/doc/en/${f} \ | 72 | ${INSTALL_DATA} ${WRKSRC}/doc/en/${f} \ | |
67 | ${DESTDIR}${PREFIX}/share/doc/mlterm/en | 73 | ${DESTDIR}${PREFIX}/share/doc/mlterm/en | |
68 | .endfor | 74 | .endfor | |
69 | .for f in BUGS FAQ README.aafont README.comb README.confapp README.fb \ | 75 | .for f in BUGS FAQ README.aafont README.comb README.confapp README.fb \ | |
70 | README.fontproto README.ja README.pty README.server \ | 76 | README.fontproto README.ja README.pty README.server \ | |
71 | README.tate README.utf8 README.xim | 77 | README.tate README.utf8 README.xim | |
72 | ${INSTALL_DATA} ${WRKSRC}/doc/ja/${f} \ | 78 | ${INSTALL_DATA} ${WRKSRC}/doc/ja/${f} \ | |
73 | ${DESTDIR}${PREFIX}/share/doc/mlterm/ja | 79 | ${DESTDIR}${PREFIX}/share/doc/mlterm/ja |
@@ -1,9 +1,10 @@ | @@ -1,9 +1,10 @@ | |||
1 | $NetBSD: distinfo,v 1.84 2020/04/27 15:45:43 tsutsui Exp $ | 1 | $NetBSD: distinfo,v 1.85 2020/06/21 17:53:01 tsutsui Exp $ | |
2 | 2 | |||
3 | SHA1 (mlterm-3.9.0.tar.gz) = be37059caab99219be79b14cfabfb26d34bb8954 | 3 | SHA1 (mlterm-3.9.0.tar.gz) = be37059caab99219be79b14cfabfb26d34bb8954 | |
4 | RMD160 (mlterm-3.9.0.tar.gz) = d5fec228b86918fe8dec05a6957869520dc8e5d4 | 4 | RMD160 (mlterm-3.9.0.tar.gz) = d5fec228b86918fe8dec05a6957869520dc8e5d4 | |
5 | SHA512 (mlterm-3.9.0.tar.gz) = d89340eb460904ca36c6ed063b356625d9c9b4ad129dc51640d50a04e166f8239124d0003db778376c47daa6311c869f9fe7e337c90937fed5ae4151f5af57c4 | 5 | SHA512 (mlterm-3.9.0.tar.gz) = d89340eb460904ca36c6ed063b356625d9c9b4ad129dc51640d50a04e166f8239124d0003db778376c47daa6311c869f9fe7e337c90937fed5ae4151f5af57c4 | |
6 | Size (mlterm-3.9.0.tar.gz) = 4143644 bytes | 6 | Size (mlterm-3.9.0.tar.gz) = 4143644 bytes | |
7 | SHA1 (patch-configure) = ce9fe3642258c5ab01d4e371e067c5f1501d5c22 | 7 | SHA1 (patch-configure) = ce9fe3642258c5ab01d4e371e067c5f1501d5c22 | |
8 | SHA1 (patch-etc_font-fb) = 03f0b2ecee20ef3201c8e4ce17f03ac90f657b00 | 8 | SHA1 (patch-etc_font-fb) = 52c18f512c67ff530c0c326394fdf43956d71cb0 | |
9 | SHA1 (patch-uitoolkit_xlib_ui__imagelib.c) = 787e38dc9505850151d58177ea1cbadbecb96075 | |||
9 | SHA1 (patch-vtemu_Makefile.in) = 172f12f73408489f782d63c8b0b7915af441d368 | 10 | SHA1 (patch-vtemu_Makefile.in) = 172f12f73408489f782d63c8b0b7915af441d368 |
# $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
@@ -1,30 +1,29 @@ | @@ -1,30 +1,29 @@ | |||
1 | # $NetBSD: options.mk,v 1.19 2020/06/20 07:50:45 rillig Exp $ | 1 | # $NetBSD: options.mk,v 1.20 2020/06/21 17:53:01 tsutsui Exp $ | |
2 | 2 | |||
3 | PKG_OPTIONS_VAR= PKG_OPTIONS.mlterm | 3 | PKG_OPTIONS_VAR= PKG_OPTIONS.mlterm | |
4 | PKG_SUPPORTED_OPTIONS= cairo canna fcitx fribidi gdk_pixbuf2 ibus libind m17nlib mlterm-fb mlterm-x68kgrf otl scim skk uim wnn4 xft2 | 4 | PKG_SUPPORTED_OPTIONS= cairo canna fcitx fribidi gdk_pixbuf2 ibus libind m17nlib mlterm-fb otl scim skk uim wnn4 xft2 | |
5 | PKG_SUGGESTED_OPTIONS= cairo fribidi gdk_pixbuf2 m17nlib otl xft2 | 5 | PKG_SUGGESTED_OPTIONS= cairo fribidi gdk_pixbuf2 m17nlib otl xft2 | |
6 | .if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" | 6 | .if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" | |
7 | PKG_SUGGESTED_OPTIONS+= mlterm-fb | 7 | PKG_SUGGESTED_OPTIONS+= mlterm-fb | |
8 | .endif | 8 | .endif | |
9 | 9 | |||
10 | .include "../../mk/bsd.options.mk" | 10 | .include "../../mk/bsd.options.mk" | |
11 | 11 | |||
12 | PLIST_VARS+= bidi cairo canna fb fbfiles fcitx ibus ind m17nlib otl scim skk uim wscons wnn x68kgrf xft2 | 12 | PLIST_VARS+= bidi cairo canna fb fbfiles fcitx ibus ind m17nlib otl scim skk uim wscons wnn x68kgrf xft2 | |
13 | 13 | |||
14 | .if !empty(PKG_OPTIONS:Mmlterm-fb) | 14 | .if !empty(PKG_OPTIONS:Mmlterm-fb) | |
15 | . if ${OPSYS} == "NetBSD" | 15 | . if ${OPSYS} == "NetBSD" | |
16 | . if ${MACHINE_ARCH} == "m68k" | 16 | . if ${MACHINE_ARCH} == "m68k" | |
17 | PKG_SUGGESTED_OPTIONS+= mlterm-x68kgrf | |||
18 | CONFIGURE_ARGS+= --with-gui=xlib,wscons,x68kgrf | 17 | CONFIGURE_ARGS+= --with-gui=xlib,wscons,x68kgrf | |
19 | SPECIAL_PERMS+= ${PREFIX:Q}/bin/mlterm-x68kgrf ${SETUID_ROOT_PERMS} | 18 | SPECIAL_PERMS+= ${PREFIX:Q}/bin/mlterm-x68kgrf ${SETUID_ROOT_PERMS} | |
20 | PLIST.x68kgrf= yes | 19 | PLIST.x68kgrf= yes | |
21 | . else # NetBSD && !m68k | 20 | . else # NetBSD && !m68k | |
22 | CONFIGURE_ARGS+= --with-gui=xlib,wscons | 21 | CONFIGURE_ARGS+= --with-gui=xlib,wscons | |
23 | . endif | 22 | . endif | |
24 | SPECIAL_PERMS+= ${PREFIX:Q}/bin/mlterm-wscons ${SETUID_ROOT_PERMS} | 23 | SPECIAL_PERMS+= ${PREFIX:Q}/bin/mlterm-wscons ${SETUID_ROOT_PERMS} | |
25 | PLIST.wscons= yes | 24 | PLIST.wscons= yes | |
26 | . else # !NetBSD (i.e. FreeBSD or Linux) | 25 | . else # !NetBSD (i.e. FreeBSD or Linux) | |
27 | CONFIGURE_ARGS+= --with-gui=xlib,fb | 26 | CONFIGURE_ARGS+= --with-gui=xlib,fb | |
28 | SPECIAL_PERMS+= ${PREFIX:Q}/bin/mlterm-fb ${SETUID_ROOT_PERMS} | 27 | SPECIAL_PERMS+= ${PREFIX:Q}/bin/mlterm-fb ${SETUID_ROOT_PERMS} | |
29 | PLIST.fb= yes | 28 | PLIST.fb= yes | |
30 | . endif | 29 | . endif |
@@ -1,28 +1,28 @@ | @@ -1,28 +1,28 @@ | |||
1 | $NetBSD: patch-etc_font-fb,v 1.9 2015/10/30 15:29:20 tsutsui Exp $ | 1 | $NetBSD: patch-etc_font-fb,v 1.10 2020/06/21 17:53:01 tsutsui Exp $ | |
2 | 2 | |||
3 | add more examples for typical NetBSD and pkgsrc installation | 3 | add more examples for typical NetBSD and pkgsrc installation | |
4 | 4 | |||
5 | --- etc/font-fb.orig 2015-10-24 16:18:15.000000000 +0000 | 5 | --- etc/font-fb.orig 2015-10-24 16:18:15.000000000 +0000 | |
6 | +++ etc/font-fb | 6 | +++ etc/font-fb | |
7 | @@ -1,12 +1,19 @@ | 7 | @@ -1,12 +1,19 @@ | |
8 | -#DEFAULT = /usr/share/fonts/X11/misc/unifont.pcf.gz:100 | 8 | -#DEFAULT = /usr/share/fonts/X11/misc/unifont.pcf.gz:100 | |
9 | +#DEFAULT = /usr/pkg/share/fonts/X11/misc/unifont.pcf.gz:100 | 9 | +#DEFAULT = @PREFIX@/share/fonts/X11/misc/unifont.pcf.gz:100 | |
10 | +#DEFAULT = /usr/pkg/share/fonts/X11/efont/b16.pcf.gz | 10 | +#DEFAULT = @PREFIX@/share/fonts/X11/efont/b16.pcf.gz | |
11 | 11 | |||
12 | #ISO8859_1 = /usr/share/fonts/X11/misc/mplus_f12r.pcf.gz | 12 | #ISO8859_1 = /usr/share/fonts/X11/misc/mplus_f12r.pcf.gz | |
13 | +#ISO8859_1 = /usr/X11R7/lib/X11/fonts/misc/8x16.pcf.gz | 13 | +#ISO8859_1 = @X11BASE@/lib/X11/fonts/misc/8x16.pcf.gz | |
14 | +#JISX0201_KATA = /usr/X11R7/lib/X11/fonts/misc/8x16rk.pcf.gz | 14 | +#JISX0201_KATA = @X11BASE@/lib/X11/fonts/misc/8x16rk.pcf.gz | |
15 | #JISX0208_1983 = /usr/share/fonts/X11/misc/mplus_j12r.pcf.gz | 15 | #JISX0208_1983 = /usr/share/fonts/X11/misc/mplus_j12r.pcf.gz | |
16 | +#JISX0208_1983 = /usr/X11R7/lib/X11/fonts/misc/jiskan16.pcf.gz | 16 | +#JISX0208_1983 = @X11BASE@/lib/X11/fonts/misc/jiskan16.pcf.gz | |
17 | JISC6226_1978 = &JISX0208_1983 | 17 | JISC6226_1978 = &JISX0208_1983 | |
18 | JISX0208_1990 = &JISX0208_1983 | 18 | JISX0208_1990 = &JISX0208_1983 | |
19 | JISX0213_2000_1 = &JISX0208_1983 | 19 | JISX0213_2000_1 = &JISX0208_1983 | |
20 | +#JISX0213_2000_1=/usr/pkg/share/fonts/X11/local/jiskan16-2000-1.pcf.gz | 20 | +#JISX0213_2000_1 = @PREFIX@/share/fonts/X11/local/jiskan16-2000-1.pcf.gz | |
21 | +#JISX0213_2000_2=/usr/pkg/share/fonts/X11/local/jiskan16-2000-2.pcf.gz | 21 | +#JISX0213_2000_2 = @PREFIX@/share/fonts/X11/local/jiskan16-2000-2.pcf.gz | |
22 | 22 | |||
23 | -#ISO10646_UCS4_1 = /usr/share/fonts/X11/misc/unifont.pcf.gz:100 | 23 | -#ISO10646_UCS4_1 = /usr/share/fonts/X11/misc/unifont.pcf.gz:100 | |
24 | +#ISO10646_UCS4_1 = /usr/pkg/share/fonts/X11/misc/unifont.pcf.gz:100 | 24 | +#ISO10646_UCS4_1 = @PREFIX@/share/fonts/X11/misc/unifont.pcf.gz:100 | |
25 | +#ISO10646_UCS4_1 = /usr/pkg/share/fonts/X11/efont/b16.pcf.gz | 25 | +#ISO10646_UCS4_1 = @PREFIX@/share/fonts/X11/efont/b16.pcf.gz | |
26 | ISO10646_UCS4_1_FULLWIDTH = &ISO10646_UCS4_1 | 26 | ISO10646_UCS4_1_FULLWIDTH = &ISO10646_UCS4_1 | |
27 | 27 | |||
28 | #ISCII_ASSAMESE = /usr/share/fonts/truetype/Asdr0ntt.ttf:120 | 28 | #ISCII_ASSAMESE = /usr/share/fonts/truetype/Asdr0ntt.ttf:120 |
$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);