diff --git a/x11/rxvt-unicode/Makefile b/x11/rxvt-unicode/Makefile index 3d82c83bf462..209e0b4deeab 100644 --- a/x11/rxvt-unicode/Makefile +++ b/x11/rxvt-unicode/Makefile @@ -1,171 +1,171 @@ PORTNAME= rxvt-unicode PORTVERSION= 9.31 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11 MASTER_SITES= http://dist.schmorp.de/rxvt-unicode/%SUBDIR%/ MASTER_SITE_SUBDIR= . Attic MAINTAINER= thierry@FreeBSD.org COMMENT= Clone of the terminal emulator rxvt modified to support Unicode WWW= http://software.schmorp.de/pkg/rxvt-unicode.html LICENSE= GPLv2 BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/fontconfig.pc:x11-fonts/fontconfig LIB_DEPENDS= libfreetype.so:print/freetype2 \ libptytty.so:sysutils/libptytty RUN_DEPENDS= ${LOCALBASE}/bin/fc-cache:x11-fonts/fontconfig USES= cpe perl5 pkgconfig shebangfix tar:bzip2 xorg USE_XORG= x11 xext xft xmu xpm xrender xt GNU_CONFIGURE= yes GNU_CONFIGURE_MANPREFIX=${PREFIX}/share CPPFLAGS+= -I${LOCALBASE}/include LIBS+= -lutil CONFIGURE_ARGS= --enable-everything --with-term=rxvt CPE_VENDOR= marc_lehmann OPTIONS_DEFINE= PERL XIM UNICODE3 ISO14755 COMBINING RXVT_SCROLLBAR \ NEXT_SCROLLBAR XTERM_SCROLLBAR BACKSPACE_KEY DELETE_KEY \ MOUSEWHEEL SMART_RESIZE IMLOCALE_FIX GDK_PIXBUF \ NOTIFY 256_COLOR DOCS SHEBANG_FILES= ${WRKSRC}/src/perl/* perl_OLD_CMD= perl perl_CMD= ${SETENV} perl PERL_DESC= Embedded Perl interpreter XIM_DESC= Support for XIM (X Input Method) protocol UNICODE3_DESC= Support Unicode codepoints above 65535 ISO14755_DESC= Support for extended ISO 14755 modes COMBINING_DESC= Automatic composition of combining chars RXVT_SCROLLBAR_DESC= Support for the original rxvt scrollbar NEXT_SCROLLBAR_DESC= Support for a NeXT-like scrollbar XTERM_SCROLLBAR_DESC= Support for an Xterm-like scrollbar BACKSPACE_KEY_DESC= Handling of the backspace key by rxvt DELETE_KEY_DESC= Handling of the delete key by rxvt MOUSEWHEEL_DESC= Support for scrolling via mouse wheel SMART_RESIZE_DESC= Smart growth/shrink behaviour IMLOCALE_FIX_DESC= imlocale encoding conversion fix GDK_PIXBUF_DESC= Use gdk-pixbuf for background images NOTIFY_DESC= Freedesktop startup notification support 256_COLOR_DESC= Support for 256 colors OPTIONS_DEFAULT= PERL XIM UNICODE3 ISO14755 COMBINING RXVT_SCROLLBAR \ NEXT_SCROLLBAR XTERM_SCROLLBAR BACKSPACE_KEY DELETE_KEY \ MOUSEWHEEL SMART_RESIZE IMLOCALE_FIX GDK_PIXBUF \ 256_COLOR OPTIONS_EXCLUDE_armv6= IMLOCALE_FIX OPTIONS_EXCLUDE_armv7= IMLOCALE_FIX OPTIONS_SUB= yes PORTDOCS1= Changes README.FAQ README.configure PORTDOCS= README.xvt ${PORTDOCS1} IMLOCALE_FIX_PATCH_DEPENDS= p5-Encode-HanExtra>=0:chinese/p5-Encode-HanExtra \ p5-Encode-JIS2K>=0:converters/p5-Encode-JIS2K # disable the embedded perl interpreter PERL_CONFIGURE_ENABLE= perl PERL_USE_OFF= PERL5=build # disable XIM (X Input Method) protocol support XIM_CONFIGURE_ENABLE= xim # disable support for Unicode codepoints above 65535 UNICODE3_CONFIGURE_ENABLE= unicode3 # disable support for extended ISO 14755 modes ISO14755_CONFIGURE_ENABLE= iso14755 # disable automatic composition of combining characters # into composite characters COMBINING_CONFIGURE_ENABLE= combining # disable support for the original rxvt scrollbar RXVT_SCROLLBAR_CONFIGURE_ENABLE= rxvt-scroll # disable support for a NeXT-like scrollbar NEXT_SCROLLBAR_CONFIGURE_ENABLE= next-scroll # disable support for an Xterm-like scrollbar XTERM_SCROLLBAR_CONFIGURE_ENABLE= xterm-scroll # disable any handling of the backspace key by rxvt # let the X server do it BACKSPACE_KEY_CONFIGURE_ENABLE= backspace-key # disable any handling of the delete key by rxvt DELETE_KEY_CONFIGURE_ENABLE= delete-key # enable scrolling via mouse wheel or buttons 4 & 5 MOUSEWHEEL_CONFIGURE_ENABLE= mousewheel # enable smart resize SMART_RESIZE_CONFIGURE_ENABLE= smart-resize # enable integration with gdk-pixbuf for background images GDK_PIXBUF_USES= gnome GDK_PIXBUF_USE= GNOME=gdkpixbuf GDK_PIXBUF_CONFIGURE_ENABLE= pixbuf # enable startup notification NOTIFY_CONFIGURE_ENABLE= startup-notification NOTIFY_LIB_DEPENDS= libstartup-notification-1.so:x11/startup-notification NOTIFY_USE= XORG=xcb # enable support for 256 colors 256_COLOR_CONFIGURE_ON= --enable-256-color .include # compile in support for additional codeset groups .if ${PORT_OPTIONS:MENCODING} AVAIL_ENC= jp jp_ext kr zh zh_ext all . for ENC in ${AVAIL_ENC} . if (${WITH_ENCODING} == ${ENC}) _ENC= ${ENC} . endif . endfor . if !defined(_ENC) . error Invalid encoding for WITH_ENCODING . endif .else . if defined(PACKAGE_BUILDING) WITH_ENCODING= all . endif .endif .if ${PORT_OPTIONS:MENCODING} CONFIGURE_ARGS+= --with-codesets=${WITH_ENCODING} .endif # WITH_ENCODING pre-everything:: .ifndef(WITH_ENCODING) @${ECHO_MSG} "==> You can compile in support for additional codeset groups by setting the WITH_ENCODING variable" @${ECHO_MSG} '==> Options are: "jp" common japanese encodings;' @${ECHO_MSG} ' "jp_ext" rarely used but big japanese encodings;' @${ECHO_MSG} ' "kr" korean encodings;' @${ECHO_MSG} ' "zh" common chinese encodings;' @${ECHO_MSG} ' "zh_ext" rarely used but very big chinese encodigs;' @${ECHO_MSG} ' "all" all of the above;' @${ECHO_MSG} '==> For example, "WITH_ENCODING=kr" for korean encodings.' @${ECHO_MSG} .endif post-patch-IMLOCALE_FIX-on: ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-imlocale cd ${WRKSRC}/src && ./gentables pre-configure: ${REINPLACE_CMD} -e "/rxvt-unicode.terminfo/d" ${WRKSRC}/doc/Makefile.in ${RM} ${WRKSRC}/src/perl/kuake.orig post-build-DOCS-on: ${CP} ${PORTDOCS1:S|^|${WRKSRC}/|} ${WRKSRC}/doc post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/doc/|} ${STAGEDIR}${DOCSDIR} @${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}." .include diff --git a/x11/rxvt-unicode/files/patch-src__command.C b/x11/rxvt-unicode/files/patch-src__command.C index 25c7d46e46c5..745b72161791 100644 --- a/x11/rxvt-unicode/files/patch-src__command.C +++ b/x11/rxvt-unicode/files/patch-src__command.C @@ -1,20 +1,238 @@ --- src/command.C.orig 2021-05-13 19:40:55 UTC +++ src/command.C @@ -57,6 +57,7 @@ #endif #include +#include #if LINUX_YIELD_HACK # include @@ -2368,7 +2369,9 @@ rxvt_term::next_char () noexcept if (len == (size_t)-2) { // the mbstate stores incomplete sequences. didn't know this :/ +#if __FreeBSD_version>502110 cmdbuf_ptr = cmdbuf_endp; +#endif break; } + +@@ -3044,8 +3044,13 @@ rxvt_term::process_csi_seq () + tt_printf ("%-.250s\012", rs[Rs_display_name]); + break; + case 8: /* unofficial extension */ +- process_xterm_seq (XTerm_title, (char *)RESNAME "-" VERSION, CHAR_ST); // char * cast verified +- break; ++ { ++ string_term st; ++ st.v[0] = CHAR_ST; ++ st.v[1] = '\0'; ++ process_xterm_seq (XTerm_title, (char *)RESNAME "-" VERSION, st); // char * cast verified ++ break; ++ } + } + break; + +@@ -3240,7 +3245,7 @@ char * + * ends_how is terminator used. returned input must be free()'d + */ + char * +-rxvt_term::get_to_st (unicode_t &ends_how) ++rxvt_term::get_to_st (string_term &st) + { + unicode_t ch; + bool seen_esc = false; +@@ -3279,7 +3284,11 @@ rxvt_term::get_to_st (unicode_t &ends_how) + + string[n++] = '\0'; + +- ends_how = (ch == 0x5c ? C0_ESC : ch); ++ n = 0; ++ if (ch == 0x5c) ++ st.v[n++] = C0_ESC; ++ st.v[n++] = ch; ++ st.v[n] = '\0'; + + return rxvt_wcstombs (string); + } +@@ -3295,8 +3304,8 @@ rxvt_term::process_dcs_seq () + * Not handled yet + */ + +- unicode_t eh; +- char *s = get_to_st (eh); ++ string_term st; ++ char *s = get_to_st (st); + if (s) + free (s); + +@@ -3318,12 +3327,12 @@ rxvt_term::process_osc_seq () + + if (ch == ';') + { +- unicode_t eh; +- char *s = get_to_st (eh); ++ string_term st; ++ char *s = get_to_st (st); + + if (s) + { +- process_xterm_seq (arg, s, eh); ++ process_xterm_seq (arg, s, st); + free (s); + } + } +@@ -3433,7 +3442,7 @@ void + } + + void +-rxvt_term::process_color_seq (int report, int color, const char *str, char resp) ++rxvt_term::process_color_seq (int report, int color, const char *str, string_term &st) + { + if (str[0] == '?' && !str[1]) + { +@@ -3449,9 +3458,9 @@ rxvt_term::process_color_seq (int report, int color, c + snprintf (rgba_str, sizeof (rgba_str), "rgb:%04x/%04x/%04x", c.r, c.g, c.b); + + if (IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) +- tt_printf ("\033]%d;%d;%s%c", report, color - minCOLOR, rgba_str, resp); ++ tt_printf ("\033]%d;%d;%s%s", report, color - minCOLOR, rgba_str, st.v); + else +- tt_printf ("\033]%d;%s%c", report, rgba_str, resp); ++ tt_printf ("\033]%d;%s%s", report, rgba_str, st.v); + } + else + set_window_color (color, str); +@@ -3461,7 +3470,7 @@ void + * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) + */ + void +-rxvt_term::process_xterm_seq (int op, char *str, char resp) ++rxvt_term::process_xterm_seq (int op, char *str, string_term &st) + { + int color; + char *buf, *name; +@@ -3506,7 +3515,7 @@ rxvt_term::process_xterm_seq (int op, char *str, char + && actual_format == 8) + str = (const char *)(value); + +- tt_printf ("\033]%d;%s%c", op, option (Opt_insecure) ? str : "", resp); ++ tt_printf ("\033]%d;%s%s", op, option (Opt_insecure) ? str : "", st.v); + + XFree (value); + } +@@ -3540,49 +3549,49 @@ rxvt_term::process_xterm_seq (int op, char *str, char + if ((buf = strchr (name, ';')) != NULL) + *buf++ = '\0'; + +- process_color_seq (op, color, name, resp); ++ process_color_seq (op, color, name, st); + } + break; + case Rxvt_restoreFG: + case XTerm_Color00: +- process_color_seq (op, Color_fg, str, resp); ++ process_color_seq (op, Color_fg, str, st); + break; + case Rxvt_restoreBG: + case XTerm_Color01: +- process_color_seq (op, Color_bg, str, resp); ++ process_color_seq (op, Color_bg, str, st); + break; + #ifndef NO_CURSORCOLOR + case XTerm_Color_cursor: +- process_color_seq (op, Color_cursor, str, resp); ++ process_color_seq (op, Color_cursor, str, st); + break; + #endif + case XTerm_Color_pointer_fg: +- process_color_seq (op, Color_pointer_fg, str, resp); ++ process_color_seq (op, Color_pointer_fg, str, st); + break; + case XTerm_Color_pointer_bg: +- process_color_seq (op, Color_pointer_bg, str, resp); ++ process_color_seq (op, Color_pointer_bg, str, st); + break; + #ifdef OPTION_HC + case XTerm_Color_HC: +- process_color_seq (op, Color_HC, str, resp); ++ process_color_seq (op, Color_HC, str, st); + break; + case XTerm_Color_HTC: +- process_color_seq (op, Color_HTC, str, resp); ++ process_color_seq (op, Color_HTC, str, st); + break; + #endif + #ifndef NO_BOLD_UNDERLINE_REVERSE + case URxvt_Color_BD: +- process_color_seq (op, Color_BD, str, resp); ++ process_color_seq (op, Color_BD, str, st); + break; + case URxvt_Color_UL: +- process_color_seq (op, Color_UL, str, resp); ++ process_color_seq (op, Color_UL, str, st); + break; + case URxvt_Color_IT: +- process_color_seq (op, Color_IT, str, resp); ++ process_color_seq (op, Color_IT, str, st); + break; + #endif + case URxvt_Color_border: +- process_color_seq (op, Color_border, str, resp); ++ process_color_seq (op, Color_border, str, st); + break; + + case XTerm_logfile: +@@ -3610,10 +3619,10 @@ rxvt_term::process_xterm_seq (int op, char *str, char + case URxvt_boldItalicFont: + #endif + if (query) +- tt_printf ("\33]%d;%-.250s%c", saveop, ++ tt_printf ("\33]%d;%-.250s%s", saveop, + option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc + ? fontset[op - URxvt_font]->fontdesc : "", +- resp); ++ st.v); + else + { + const char *&res = rs[Rs_font + (op - URxvt_font)]; +@@ -3626,23 +3635,23 @@ rxvt_term::process_xterm_seq (int op, char *str, char + + case URxvt_version: + if (query) +- tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%c", ++ tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%s", + op, + rs[Rs_name], VERSION[0], VERSION[2], +- resp); ++ st.v); + break; + + #if !ENABLE_MINIMAL + case URxvt_cellinfo: + if (query) +- tt_printf ("\33]%d;%d;%d;%d%c", saveop, ++ tt_printf ("\33]%d;%d;%d;%d%s", saveop, + fwidth, fheight, fbase, +- resp); ++ st.v); + break; + + case URxvt_locale: + if (query) +- tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp); ++ tt_printf ("\33]%d;%-.250s%s", op, option (Opt_insecure) ? locale : "", st.v); + else + { + set_locale (str); +@@ -3667,7 +3676,7 @@ rxvt_term::process_xterm_seq (int op, char *str, char + + #if ENABLE_PERL + case URxvt_perl: +- HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_STR_LEN, &resp, 1, DT_END)); ++ HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_STR, st.v, DT_END)); + break; + #endif + } diff --git a/x11/rxvt-unicode/files/patch-src__rxvt.h b/x11/rxvt-unicode/files/patch-src__rxvt.h new file mode 100644 index 000000000000..12a3b61316cf --- /dev/null +++ b/x11/rxvt-unicode/files/patch-src__rxvt.h @@ -0,0 +1,30 @@ +--- src/rxvt.h.orig 2021-11-21 23:29:22 UTC ++++ src/rxvt.h +@@ -399,6 +399,12 @@ enum { + C0_DLE, C0_DC1, C0_DC2, D0_DC3, C0_DC4, C0_NAK, C0_SYN, C0_ETB, + C0_CAN, C0_EM , C0_SUB, C0_ESC, C0_IS4, C0_IS3, C0_IS2, C0_IS1, + }; ++ ++struct string_term ++{ ++ unsigned char v[3]; ++}; ++ + #define CHAR_ST 0x9c /* 0234 */ + + /* +@@ -1366,11 +1372,11 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_s + void process_escape_seq (); + void process_csi_seq (); + void process_window_ops (const int *args, unsigned int nargs); +- char *get_to_st (unicode_t &ends_how); ++ char *get_to_st (string_term &st); + void process_dcs_seq (); + void process_osc_seq (); +- void process_color_seq (int report, int color, const char *str, char resp); +- void process_xterm_seq (int op, char *str, char resp); ++ void process_color_seq (int report, int color, const char *str, string_term &st); ++ void process_xterm_seq (int op, char *str, string_term &st); + unsigned int map_rgb24_color (unsigned int r, unsigned int g, unsigned int b, unsigned int a); + int privcases (int mode, unsigned long bit); + void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg);