hexchat: lua fix compile and fix font height

This commit is contained in:
Danny Rawlins 2021-04-11 01:07:35 +10:00
parent 8d423c41e3
commit ba35b07af1
6 changed files with 4287 additions and 4 deletions

View File

@ -1,5 +1,9 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/SSEViDGzwTcNKrlgAUbcat9KErKyd2EuLXR31nXVwmEsusIwWhFH9Q+q4lfk6xkKnW0qCQZofBFFGyaEWGhLgA=
SHA256 (Pkgfile) = 9b4340d4a94abbb873d92edd20711fe5b4bc75ad7062d4f0f19a4c08a75502ce
RWSE3ohX2g5d/Wm4zjW1uczdblLrQpa6pzE6d7ciX+ACK1ku+iPepb0PdgmLT0iKwdGf2WSrJ5ROIeKmJKwBkmKQtDNiAHvHIwA=
SHA256 (Pkgfile) = dd4468441be2ac002c08c1f45eccb1da13e98b26b7435eb67f1dd65931b9b2a8
SHA256 (.footprint) = 890fbae8258fa479df98a709305dec29ce2e972446df597faf3fc2013476308b
SHA256 (hexchat-2.14.3.tar.xz) = 901a9d13db5a4da69b827f6093306bbd16863dc49016f7668bd3e4506512e882
SHA256 (0001-python-cffi.patch) = 92af0d106627c9b9716036ce81f697de35f37b4ba2e7bd34244824520e485bba
SHA256 (0002-python-3-8.patch) = 8d17ce657e744272815b5fb33d8ad959f79ece3294349637eaadcf86d90496fa
SHA256 (0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch) = 691f344479a8b1186008516f0ebe7e3d482059cd297f58573634fa5a58f3d0ca
SHA256 (0004-fix_segfault_on_lua_pop_with_Lua_5.4.3.patch) = a8d6917deec758b3a822471316f0bd7819d3661ef6f657c52953711227a2cbe6

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
diff --git a/meson_options.txt b/meson_options.txt
index 100a5ee7..c2a2f53c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -48,7 +48,7 @@ option('with-lua', type: 'string', value: 'luajit',
option('with-perl', type: 'string', value: 'perl',
description: 'Perl scripting plugin, value is path to perl executable or "false"'
)
-option('with-python', type: 'string', value: 'python3',
+option('with-python', type: 'string', value: 'python3-embed',
description: 'Python scripting plugin. value is pkg-config name to use or "false"'
)
option('with-sysinfo', type: 'boolean',

View File

@ -0,0 +1,44 @@
commit 163608d7fd861c2c4911a38f45be484c88626bdc
Author: John Levon <levon@movementarian.org>
Date: Mon Sep 7 17:53:31 2020 +0100
Use pango_font_metrics_get_height() to calculate font height (#2500)
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index fac0c4e6..418bb4da 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -283,8 +283,24 @@ backend_font_open (GtkXText *xtext, char *name)
metrics = pango_context_get_metrics (context, xtext->font->font, lang);
xtext->font->ascent = pango_font_metrics_get_ascent (metrics) / PANGO_SCALE;
xtext->font->descent = pango_font_metrics_get_descent (metrics) / PANGO_SCALE;
+
+ /*
+ * In later versions of pango, a font's height should be calculated like
+ * this to account for line gap; a typical symptom of not doing so is
+ * cutting off the underscore on some fonts.
+ */
+#if PANGO_VERSION_CHECK(1, 44, 0)
+ xtext->fontsize = pango_font_metrics_get_height (metrics) / PANGO_SCALE + 1;
+
+ if (xtext->fontsize == 0)
+ xtext->fontsize = xtext->font->ascent + xtext->font->descent;
+#else
+ xtext->fontsize = xtext->font->ascent + xtext->font->descent;
+#endif
+
pango_font_metrics_unref (metrics);
}
+
static int
backend_get_text_width_emph (GtkXText *xtext, guchar *str, int len, int emphasis)
{
@@ -3479,8 +3495,6 @@ gtk_xtext_set_font (GtkXText *xtext, char *name)
if (xtext->font == NULL)
return FALSE;
- xtext->fontsize = xtext->font->ascent + xtext->font->descent;
-
{
char *time_str;
int stamp_size = xtext_get_stamp_str (time(0), &time_str);

View File

@ -0,0 +1,30 @@
From d6319bd8f21042db62f6c7094066052d894416ef Mon Sep 17 00:00:00 2001
From: Mateusz Gozdek <mgozdekof@gmail.com>
Date: Sun, 4 Apr 2021 21:07:30 +0200
Subject: [PATCH] plugins/lua/lua.c: fix segfault on lua_pop with Lua 5.4.3
Closes #2558
Co-authored-by: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
---
plugins/lua/lua.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c
index d73fbb230..d1370eafb 100644
--- a/plugins/lua/lua.c
+++ b/plugins/lua/lua.c
@@ -1189,11 +1189,11 @@ static void patch_clibs(lua_State *L)
if(lua_type(L, -2) == LUA_TLIGHTUSERDATA && lua_type(L, -1) == LUA_TTABLE)
{
lua_setfield(L, LUA_REGISTRYINDEX, "_CLIBS");
+ lua_pop(L, 1);
break;
}
lua_pop(L, 1);
}
- lua_pop(L, 1);
}
static GPtrArray *scripts;

View File

@ -6,12 +6,21 @@
name=hexchat
version=2.14.3
release=1
source=(https://dl.hexchat.net/hexchat/$name-$version.tar.xz)
release=2
source=(https://dl.hexchat.net/hexchat/$name-$version.tar.xz
0001-python-cffi.patch
0002-python-3-8.patch
0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch
0004-fix_segfault_on_lua_pop_with_Lua_5.4.3.patch)
build() {
cd $name-$version
patch -p1 -i $SRC/0001-python-cffi.patch
patch -p1 -i $SRC/0002-python-3-8.patch
patch -p1 -i $SRC/0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch
patch -p1 -i $SRC/0004-fix_segfault_on_lua_pop_with_Lua_5.4.3.patch
# Lua scripting plugin, value is pkg-config name
prt-get isinst lua && PKGMK_HEXCHAT+=' -Dwith-lua=lua' || PKGMK_HEXCHAT+=' -Dwith-lua=false'