From: Wei Tang Date: Thu, 6 Aug 2026 18:32:38 +0000 (+0000) Subject: patch 9.2.0916: configure: honor `--disable-hardcopy-pango` with GTK UI X-Git-Tag: v9.2.0916^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6350f0e28a0ca9b4afffb22d0cd88a363b7816c;p=thirdparty%2Fvim.git patch 9.2.0916: configure: honor `--disable-hardcopy-pango` with GTK UI Problem: The configure script enables Pango hardcopy automatically when the GTK GUI is selected, even when the user explicitly specified `--disable-hardcopy-pango` (after v9.2.0898). Solution: Only enable Pango hardcopy by default when the option was not explicitly specified, verify that pango library is at least v1.44 (Wei Tang, Hirohito Higashi) fixes: #20952 closes: #20945 Co-Authored-by: Hirohito Higashi Signed-off-by: Wei Tang Signed-off-by: Christian Brabandt --- diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index 4db123621e..330b552db9 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.2. Last change: 2026 Aug 02 +*version9.txt* For Vim version 9.2. Last change: 2026 Aug 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -52741,6 +52741,10 @@ Highlighting: ~ |hl-PopupBorder| Popup window border. |hl-PopupTitle| Popup window title. +Configure Switches: ~ + +--enable-hardcopy-pango Enable the pango |:hardcopy| backend |pango-printing| + ============================================================================== PATCHES *patches-9.3* *bug-fixes-9.3* *patches-after-9.2* diff --git a/src/auto/configure b/src/auto/configure index a47cb58d2a..312ab6f6c6 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -1553,7 +1553,7 @@ Optional Features: --disable-gtktest Do not try to compile and run a test GTK program --disable-icon-cache-update update disabled --disable-desktop-database-update update disabled - --enable-hardcopy-pango Use Pango and Cairo for improved hardcopy printing. default=yes when GTK GUI enabled + --enable-hardcopy-pango Use Pango 1.44 or later and Cairo for improved hardcopy printing. default=yes when GTK GUI enabled --disable-largefile omit support for large files --disable-canberra Do not use libcanberra. --disable-libsodium Do not use libsodium. @@ -9274,13 +9274,19 @@ fi printf %s "checking for pango... " >&6; } have_pango="no" if "$PKG_CONFIG" --exists 'pango' && "$PKG_CONFIG" --exists 'pangocairo'; then - have_pango="yes" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + if "$PKG_CONFIG" --exists 'pango >= 1.44'; then + have_pango="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - PANGO_CFLAGS=`$PKG_CONFIG --cflags-only-other pango pangocairo` - PANGO_CPPFLAGS=`$PKG_CONFIG --cflags-only-I pango pangocairo` - PANGO_LIBS=`$PKG_CONFIG --libs pango pangocairo` + PANGO_CFLAGS=`$PKG_CONFIG --cflags-only-other pango pangocairo` + PANGO_CPPFLAGS=`$PKG_CONFIG --cflags-only-I pango pangocairo` + PANGO_LIBS=`$PKG_CONFIG --libs pango pangocairo` + else + have_pango="old" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, version 1.44 or later is required" >&5 +printf "%s\n" "no, version 1.44 or later is required" >&6; } + fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } @@ -11545,25 +11551,41 @@ printf %s "checking --enable-hardcopy-pango argument... " >&6; } if test ${enable_hardcopy_pango+y} then : enableval=$enable_hardcopy_pango; +else case e in #( + e) enable_hardcopy_pango="auto" ;; +esac fi -if test "x$have_pango" = "xno" || test "x$have_cairo" = "xno"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, Pango or Cairo not found" >&5 +if test "x$have_pango" != "xyes" || test "x$have_cairo" = "xno"; then + if test "$fail_if_missing" = "yes" -a "$enable_hardcopy_pango" = "yes"; then + as_fn_error $? "could not configure hardcopy-pango" "$LINENO" 5 + fi + enable_hardcopy_pango="no" + if test "x$have_pango" = "xold"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, Pango is older than 1.44" >&5 +printf "%s\n" "no, Pango is older than 1.44" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, Pango or Cairo not found" >&5 printf "%s\n" "no, Pango or Cairo not found" >&6; } + fi else - if test "x$GUITYPE" = "xGTK" || test "x$GUITYPE" = "xGTK4"; then - enable_hardcopy_pango="yes" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, GTK GUI enabled" >&5 + if test "x$enable_hardcopy_pango" = "xauto"; then + if test "x$GUITYPE" = "xGTK" || test "x$GUITYPE" = "xGTK4"; then + enable_hardcopy_pango="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, GTK GUI enabled" >&5 printf "%s\n" "yes, GTK GUI enabled" >&6; } - else - if test "$enable_hardcopy_pango" = "yes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } else + enable_hardcopy_pango="no" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi + elif test "$enable_hardcopy_pango" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi diff --git a/src/configure.ac b/src/configure.ac index 2fdc516372..75035d754d 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -2493,12 +2493,18 @@ fi AC_MSG_CHECKING(for pango) have_pango="no" if "$PKG_CONFIG" --exists 'pango' && "$PKG_CONFIG" --exists 'pangocairo'; then - have_pango="yes" - AC_MSG_RESULT([yes]) +dnl pango_font_metrics_get_height() requires Pango 1.44. + if "$PKG_CONFIG" --exists 'pango >= 1.44'; then + have_pango="yes" + AC_MSG_RESULT([yes]) - PANGO_CFLAGS=`$PKG_CONFIG --cflags-only-other pango pangocairo` - PANGO_CPPFLAGS=`$PKG_CONFIG --cflags-only-I pango pangocairo` - PANGO_LIBS=`$PKG_CONFIG --libs pango pangocairo` + PANGO_CFLAGS=`$PKG_CONFIG --cflags-only-other pango pangocairo` + PANGO_CPPFLAGS=`$PKG_CONFIG --cflags-only-I pango pangocairo` + PANGO_LIBS=`$PKG_CONFIG --libs pango pangocairo` + else + have_pango="old" + AC_MSG_RESULT([no, version 1.44 or later is required]) + fi else AC_MSG_RESULT(no) fi @@ -3153,21 +3159,33 @@ AC_SUBST(UPDATE_DESKTOP_DATABASE) AC_MSG_CHECKING(--enable-hardcopy-pango argument) AC_ARG_ENABLE(hardcopy-pango, - [ --enable-hardcopy-pango Use Pango and Cairo for improved hardcopy printing. [default=yes when GTK GUI enabled]], - ,, enable_hardcopy_pango="no") + [ --enable-hardcopy-pango Use Pango 1.44 or later and Cairo for improved hardcopy printing. [default=yes when GTK GUI enabled]], + [], + [enable_hardcopy_pango="auto"]) -if test "x$have_pango" = "xno" || test "x$have_cairo" = "xno"; then - AC_MSG_RESULT([no, Pango or Cairo not found]) -else - if test "x$GUITYPE" = "xGTK" || test "x$GUITYPE" = "xGTK4"; then - enable_hardcopy_pango="yes" - AC_MSG_RESULT([yes, GTK GUI enabled]) +if test "x$have_pango" != "xyes" || test "x$have_cairo" = "xno"; then + if test "$fail_if_missing" = "yes" -a "$enable_hardcopy_pango" = "yes"; then + AC_MSG_ERROR([could not configure hardcopy-pango]) + fi + enable_hardcopy_pango="no" + if test "x$have_pango" = "xold"; then + AC_MSG_RESULT([no, Pango is older than 1.44]) else - if test "$enable_hardcopy_pango" = "yes"; then - AC_MSG_RESULT([yes]) + AC_MSG_RESULT([no, Pango or Cairo not found]) + fi +else + if test "x$enable_hardcopy_pango" = "xauto"; then + if test "x$GUITYPE" = "xGTK" || test "x$GUITYPE" = "xGTK4"; then + enable_hardcopy_pango="yes" + AC_MSG_RESULT([yes, GTK GUI enabled]) else + enable_hardcopy_pango="no" AC_MSG_RESULT([no]) fi + elif test "$enable_hardcopy_pango" = "yes"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) fi fi diff --git a/src/version.c b/src/version.c index cca2e3afa7..78b210fdbc 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 916, /**/ 915, /**/