]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0916: configure: honor `--disable-hardcopy-pango` with GTK UI v9.2.0916
authorWei Tang <gauchyler@uestc.edu.cn>
Thu, 6 Aug 2026 18:32:38 +0000 (18:32 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 6 Aug 2026 18:40:13 +0000 (18:40 +0000)
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 <h.east.727@gmail.com>
Signed-off-by: Wei Tang <gauchyler@uestc.edu.cn>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/version9.txt
src/auto/configure
src/configure.ac
src/version.c

index 4db123621e6473d3f9a09c89aa709f13bb135297..330b552db9e59151df0f876158c5a6ab9f8332fb 100644 (file)
@@ -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*
index a47cb58d2a44d96c1e63e5a1f7b40ad7b097e027..312ab6f6c6e5588f09cc4b1deb043f0a45c086b2 100755 (executable)
@@ -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
 
index 2fdc516372f6352fb272c269aeb9d63a51f4e5be..75035d754de47a6de68b683a2d41684e4e2f73aa 100644 (file)
@@ -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
 
index cca2e3afa7cdc1250261186672f8e6a54ee20e26..78b210fdbc08a37ae7fb521f1b77d65c471381fe 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    916,
 /**/
     915,
 /**/