From 3a680cf6b454aa6fbc297719c07933cbe534e0be Mon Sep 17 00:00:00 2001 From: deepend Date: Mon, 23 Feb 2026 19:09:09 -0700 Subject: [PATCH 1/2] Updated the Python scripting shim to expose EAT_HEXCHAT as an alias of EAT_ZOITECHAT, so scripts written for HexChat constants work without changes. Added a Python hexchat.py compatibility module and ensured it is installed alongside zoitechat.py/xchat.py, enabling import hexchat scripts to run. Updated the Perl API layer to support HexChat naming by aliasing HexChat:: to ZoiteChat::, adding EAT_HEXCHAT to exported constants, and adding an explicit Perl shim module HexChat.pm. Extended Perl XS constant registration to export EAT_HEXCHAT as a compatibility alias, and wired HexChat.pm into the embedded Perl module generation list so it ships with the plugin. --- plugins/perl/lib/HexChat.pm | 1 + plugins/perl/lib/ZoiteChat.pm | 4 +++- plugins/perl/meson.build | 1 + plugins/perl/perl.c | 1 + plugins/python/_zoitechat.py | 3 ++- plugins/python/hexchat.py | 1 + plugins/python/meson.build | 2 +- 7 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 plugins/perl/lib/HexChat.pm create mode 100644 plugins/python/hexchat.py diff --git a/plugins/perl/lib/HexChat.pm b/plugins/perl/lib/HexChat.pm new file mode 100644 index 00000000..e52903be --- /dev/null +++ b/plugins/perl/lib/HexChat.pm @@ -0,0 +1 @@ +require ZoiteChat; diff --git a/plugins/perl/lib/ZoiteChat.pm b/plugins/perl/lib/ZoiteChat.pm index 968487c7..25b0e06a 100644 --- a/plugins/perl/lib/ZoiteChat.pm +++ b/plugins/perl/lib/ZoiteChat.pm @@ -53,14 +53,16 @@ sub ZoiteChat::Internal::print; #keep compatibility with Xchat scripts sub EAT_XCHAT (); +sub EAT_HEXCHAT (); BEGIN { *Xchat:: = *ZoiteChat::; + *HexChat:: = *ZoiteChat::; } our %EXPORT_TAGS = ( constants => [ qw(PRI_HIGHEST PRI_HIGH PRI_NORM PRI_LOW PRI_LOWEST), # priorities - qw(EAT_NONE EAT_ZOITECHAT EAT_XCHAT EAT_PLUGIN EAT_ALL), # callback return values + qw(EAT_NONE EAT_ZOITECHAT EAT_XCHAT EAT_HEXCHAT EAT_PLUGIN EAT_ALL), # callback return values qw(FD_READ FD_WRITE FD_EXCEPTION FD_NOTSOCKET), # fd flags qw(KEEP REMOVE), # timers ], diff --git a/plugins/perl/meson.build b/plugins/perl/meson.build index 1e7b301e..3c1697f0 100644 --- a/plugins/perl/meson.build +++ b/plugins/perl/meson.build @@ -4,6 +4,7 @@ zoitechat_perl_module = custom_target('zoitechat-perl-header', input: [ 'lib/ZoiteChat.pm', 'lib/Xchat.pm', + 'lib/HexChat.pm', 'lib/ZoiteChat/Embed.pm', 'lib/ZoiteChat/List/Network.pm', 'lib/ZoiteChat/List/Network/Entry.pm', diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c index 2b533006..05ecf2f3 100644 --- a/plugins/perl/perl.c +++ b/plugins/perl/perl.c @@ -1365,6 +1365,7 @@ xs_init (pTHX) newCONSTSUB (stash, "EAT_NONE", newSViv (ZOITECHAT_EAT_NONE)); newCONSTSUB (stash, "EAT_ZOITECHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT)); newCONSTSUB (stash, "EAT_XCHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT)); /* for compatibility */ + newCONSTSUB (stash, "EAT_HEXCHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT)); /* for compatibility */ newCONSTSUB (stash, "EAT_PLUGIN", newSViv (ZOITECHAT_EAT_PLUGIN)); newCONSTSUB (stash, "EAT_ALL", newSViv (ZOITECHAT_EAT_ALL)); newCONSTSUB (stash, "FD_READ", newSViv (ZOITECHAT_FD_READ)); diff --git a/plugins/python/_zoitechat.py b/plugins/python/_zoitechat.py index a078517d..bd5df219 100644 --- a/plugins/python/_zoitechat.py +++ b/plugins/python/_zoitechat.py @@ -5,7 +5,7 @@ from contextlib import contextmanager from _zoitechat_embedded import ffi, lib __all__ = [ - 'EAT_ALL', 'EAT_ZOITECHAT', 'EAT_NONE', 'EAT_PLUGIN', 'EAT_XCHAT', + 'EAT_ALL', 'EAT_ZOITECHAT', 'EAT_NONE', 'EAT_PLUGIN', 'EAT_XCHAT', 'EAT_HEXCHAT', 'PRI_HIGH', 'PRI_HIGHEST', 'PRI_LOW', 'PRI_LOWEST', 'PRI_NORM', '__doc__', '__version__', 'command', 'del_pluginpref', 'emit_print', 'find_context', 'get_context', 'get_info', @@ -22,6 +22,7 @@ __license__ = 'GPL-2.0+' EAT_NONE = 0 EAT_ZOITECHAT = 1 EAT_XCHAT = EAT_ZOITECHAT +EAT_HEXCHAT = EAT_ZOITECHAT EAT_PLUGIN = 2 EAT_ALL = EAT_ZOITECHAT | EAT_PLUGIN diff --git a/plugins/python/hexchat.py b/plugins/python/hexchat.py new file mode 100644 index 00000000..e7ca36c8 --- /dev/null +++ b/plugins/python/hexchat.py @@ -0,0 +1 @@ +from _zoitechat import * diff --git a/plugins/python/meson.build b/plugins/python/meson.build index 0a2684a5..84eb5cb7 100644 --- a/plugins/python/meson.build +++ b/plugins/python/meson.build @@ -19,7 +19,7 @@ python3_source = custom_target('python-bindings', command: [find_program('generate_plugin.py'), '@INPUT@', '@OUTPUT@'] ) -install_data(['_zoitechat.py', 'zoitechat.py', 'xchat.py'], +install_data(['_zoitechat.py', 'zoitechat.py', 'xchat.py', 'hexchat.py'], install_dir: join_paths(get_option('libdir'), 'zoitechat/python') ) From 95e40bbe5e4cdf69a87b9590a70f1ae596f0c0f2 Mon Sep 17 00:00:00 2001 From: deepend Date: Mon, 23 Feb 2026 19:17:52 -0700 Subject: [PATCH 2/2] Added hexchat.py to Debian install manifest for zoitechat-python3 so the file is packaged instead of being left in debian/tmp (which triggers dh_missing failure). --- debian/zoitechat-python3.install | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/zoitechat-python3.install b/debian/zoitechat-python3.install index a82457d3..8aa97876 100644 --- a/debian/zoitechat-python3.install +++ b/debian/zoitechat-python3.install @@ -1,4 +1,5 @@ usr/lib/*/zoitechat/plugins/python.so usr/lib/*/zoitechat/python/_zoitechat.py +usr/lib/*/zoitechat/python/hexchat.py usr/lib/*/zoitechat/python/xchat.py usr/lib/*/zoitechat/python/zoitechat.py