Compare commits

..

61 Commits

Author SHA1 Message Date
Patrick Griffis
5e5e3fe43b fixup! Use glib WIN32 defines 2017-06-26 19:28:19 -04:00
Patrick Griffis
98ee2eeeb8 fixup! Use glib WIN32 defines 2017-06-26 19:24:18 -04:00
Patrick Griffis
4d5e2874da fixup! Use glib WIN32 defines 2017-06-26 19:21:31 -04:00
Patrick Griffis
8a6570862f Use glib WIN32 defines 2017-06-26 19:14:52 -04:00
Patrick Griffis
8f2429a2d2 Fix crash when notification backend fails
Most notably on Win7
2017-06-26 17:49:03 -04:00
Patrick Griffis
de157fcffd build: Fix building plugins in cygwin 2017-06-26 16:41:10 -04:00
Patrick Griffis
e68976ab39 build: More robust compiler flag checks
Don't hardcode platforms but check if things actually link.

This should fix cygwin.
2017-06-26 16:38:03 -04:00
Patrick Griffis
806a0da258 Fix skipping autoconnect when passed 1 URL 2017-06-22 13:19:43 -04:00
Patrick Griffis
99e16110bc sysinfo: Simplify finding pci.ids file on Unix
There is probably no reason to make this user configurable just
get the correct one at build time...
2017-06-20 16:26:28 -04:00
Patrick Griffis
2d184c0967 Fix crash on coloring NULL nicks
Fixes #2014
2017-06-18 06:31:34 -04:00
Patrick Griffis
ce91bebc39 Fix OpenSSL 1.1 deprecations 2017-06-15 00:26:43 -04:00
Patrick Griffis
27fd9b3fd6 Hide false-positive deprecated warning 2017-06-15 00:14:30 -04:00
Patrick Griffis
f8467473dd build: Validate desktop/appstream files 2017-06-15 00:10:55 -04:00
Patrick Griffis
2dfe5357a9 build: Fix setting the *installed* rpath for perl too... 2017-06-14 23:55:40 -04:00
Patrick Griffis
67adfa6f54 build: Fix rpath not getting set for perl plugin
Some distros of perl pass an rpath so we shouldn't ignore it.
Other junk comes with it but oh well.
2017-06-14 23:31:01 -04:00
Patrick Griffis
0e5eda7de8 readme: Update badges 2017-06-14 02:47:26 -04:00
Patrick Griffis
628100c19f build: Replace Autotools with Meson
Quick rundown of benefits:

- Much faster:
  - Autotools (with autogen): 22 seconds
  - Meson: 7 seconds
  - Meson (with ccache): 2 seconds

- Simpler:
  - ~1000 lines smaller
  - Single simple language

- Potentially better Windows (Visual Studio) support

What is not done:

- Complete Windows support
- OSX support (easy)

Closes #2013
Closes #1937
Closes #1803
2017-06-13 23:54:51 -04:00
Patrick Griffis
2edf50d4dd Actually respect away_omit_alerts for custom sounds...
Probably should think before merging things.
2017-06-10 16:28:48 -04:00
YuGiOhJCJ
2dd5f8788c Disable custom sounds when away_omit_alerts enabled
Closes #2012
2017-06-10 16:18:55 -04:00
Patrick Griffis
76430228e1 Fix input theming with Adwaita-dark also 2017-05-12 00:49:45 -04:00
culb
fc2fe7fd28 lua: Prevent loading a script if it's already loaded
Closes #1959
2017-04-28 07:55:14 -04:00
culb
5d72755027 lua: Prevent from loading if it's already loaded
Closes #1958
2017-04-28 07:50:43 -04:00
Lance Poore
92496b183e sysinfo: Lower priority of make.conf for distro name
This is used elsewhere other than Gentoo so it is a rather
unreliable check compared to lsb-release.
2017-04-28 07:44:55 -04:00
Patrick Griffis
88cb0c9d20 Fix signature of other notification backends
Why isn't this a compiler error in the first place..
2017-04-28 07:38:47 -04:00
Mark Jansen
ec94565cb9 winrt: Show some exceptions 2017-04-28 07:33:36 -04:00
Mark Jansen
552b2b1315 thememan: Check for portable-mode file in the application directory.
Fixes #1902
2017-04-04 13:22:45 -04:00
Mark Jansen
a524adc698 Add editorconfig, describing what indenting style to use.
See http://editorconfig.org/ for more info.
2017-04-04 13:22:03 -04:00
Mark Jansen
eccd0d05b5 python: Use HEXCHAT_EAT_XXX where appropriate. 2017-03-30 16:58:49 -04:00
eimmot
be6473227b Fix key exchange
Clients will receive the proper shared secret.

Eliminates error message:
SSL_read: error:05066064:Diffie-Hellman routines:compute_key:no private value

Fixes #1974
2017-03-30 16:32:40 -04:00
Pierre Pronchery
2f0239eb18 Fix bashism
From tnn@ of NetBSD.
2017-03-23 17:25:36 -04:00
Shengyu Zhang
99bdc4f251 Fix email address pattern, it can starts with digit 2017-03-10 12:28:03 -05:00
Poke
30a223a6cb Removed ctrl+w keybinding from close menu. Closes #397. 2017-02-27 04:22:59 -05:00
Patrick Griffis
7d78c6bca0 Better handle mode numerics starting with :
These are still awful but until we have a real parser..

Fixes inspircd/inspircd#1295
2017-02-18 21:45:38 -05:00
Patrick Griffis
b1e963f563 servlist: Use SSL with OFTC by default
They now use Lets Encrypt which should be trusted.
2017-01-07 20:50:09 -05:00
Patrick Griffis
525a3bcc02 Increase default scrollback size to 5k
This is totally reasonable for a modern computer.
2017-01-05 17:58:06 -05:00
Patrick Griffis
2376b7fb6a fishlim: Fix not including config.h 2017-01-05 13:07:51 -05:00
Patrick Griffis
eddaf8c396 build: Fix checking for OpenSSL 1.1 functions
Fixes #1920
2017-01-05 12:52:04 -05:00
Patrick Griffis
dfaf0e31c7 Tweak shadow in preferences 2016-12-27 10:12:05 -05:00
tomek
63e9c72114 win32: Update Python to 3.6 2016-12-23 14:04:32 +01:00
Patrick Griffis
2c80cb7efd Use a scrolled window for large preference pages
Closes #1722
2016-12-22 07:32:44 -05:00
Patrick Griffis
4c178782a7 Don't combine compression with pixdata option for icon resources
This made minimal difference and is not recommended by upstream.
It also is affected by a regression in the latest gdk-pixbuf release.

https://bugzilla.gnome.org/show_bug.cgi?id=776105
2016-12-17 20:00:46 -05:00
Patrick Griffis
aa7080f8fe Fix building fishlim against libressl also
Also part of #1898
2016-12-13 17:37:15 -05:00
Florian Stinglmayr
d583ca7d92 Use AC_CHECK_FUNCS to find functions not in LibreSSL
LibreSSL might not have all functions of OpenSSL 1.1.0 so use
AC_CHECK_FUNCS to find them first before using them.

Closes #1899
Fixes #1898
2016-12-13 17:12:04 -05:00
tomek
1b760dd22b Bump version to 2.12.4 2016-12-10 15:45:38 +01:00
Patrick Griffis
02c92599fa Bump version to 2.12.4 2016-12-10 09:30:51 -05:00
Patrick Griffis
26acd02e9f Enable input_filter_beep by default
This just allows for spam.
2016-12-04 05:02:15 -05:00
Patrick Griffis
e7da3a052d Avoid mixed declaration 2016-12-04 04:44:10 -05:00
Patrick Griffis
b6426a1e9f Fix printing invalid utf8 from /exec output
This could possibly cause a crash.

On a related note exec_data() and exec_handle_colors() could probably
use a pass cleaning up to ensure they "do the right thing".
2016-12-04 04:39:06 -05:00
Mattia Rizzolo
f2d93f5abe properly clean the autogenerated org.hexchat.service.service 2016-12-01 18:20:48 -05:00
Patrick Griffis
9ab03c5d23 Update appdata 2016-12-01 06:06:53 -05:00
Patrick Griffis
3118df2042 Fix timers being incorrectly removed
Possibly fixing #1866
2016-11-30 00:52:48 -05:00
Mattia Rizzolo
c7849a8921 Fix typos s/Recieved/Received/ 2016-11-28 15:17:36 -05:00
Patrick Griffis
13f6d9265a Respect plugin hook changing tab color
Fixup to 241dd69b08
2016-11-11 20:02:24 -05:00
Patrick Griffis
241dd69b08 Further tab color improvements
- Combine the three properties into a single one
- Finally fully fix the handling with plugins handling events

TODO: Look into lastact handling of these, seems wrong
2016-11-11 19:27:57 -05:00
Patrick Griffis
539949973c More fixes for tab color handling with plugins
Part 2 of 03767ee0f9

So how the colors work should be pretty straight forward:

- A message comes in and is handled, this sets the state flags:
    nick_said, msg_said, new_data. These map to tab colors.
- This state is reset under one of these conditions:
  - It is commited to the UI when actually printed on unfocused tab
  - Event is interupted by a plugin hook
  - The tab focus is changed
2016-11-11 01:25:12 -05:00
Patrick Griffis
e7c88e0f83 Fix private highlights not setting tab color
Caused by 03767ee0f9

Fixes #1871
2016-11-11 00:45:00 -05:00
Patrick Griffis
85bdb06cad Convert doat to an internal command
- Trivial plugin
- Useful for many users
- Was under a dumb license
2016-11-09 17:29:23 +01:00
Patrick Griffis
a0e80ebda2 Final fixup of OpenSSL 1.1.0 changes 2016-10-23 03:34:15 -04:00
Patrick Griffis
1186236ac1 ssl: Fix building with older OpenSSL too 2016-10-23 01:09:27 -04:00
Patrick Griffis
217fa9d0f9 ssl: More OpenSSL 1.1.0 fixes 2016-10-23 00:58:28 -04:00
tomek
6c8b6ce23f Bump version to 2.12.3 2016-10-22 16:12:05 +02:00
157 changed files with 1699 additions and 2796 deletions

19
.editorconfig Normal file
View File

@@ -0,0 +1,19 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*.{c,cpp,h,hpp,m}]
indent_style = tab
indent_size = 4
end_of_line = lf
[*.cs]
indent_style = space
indent_size = 4
end_of_line = lf
[{meson.build,meson_options.txt}]
indent_size = 2
indent_style = space
insert_final_newline = true

65
.gitignore vendored
View File

@@ -1,68 +1,8 @@
# git ignore file
# Unix generated files
.deps/
.libs/
.dirstamp
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
/build-aux/
confdefs.h
conftest
conftest.c
conftest.err
config.*
config-win32.h
configure
configure.tmp
/build
doxygen*.tmp
html/
libtool
m4/
plugins/perl/irc.pm.h
plugins/perl/xchat.pm.h
plugins/perl/hexchat.pm.h
po/Makefile.in.in
po/POTFILES
po/remove-potcdate.sed
po/stamp-*
osx/Info.plist
data/man/hexchat.1
data/pkgconfig/hexchat-plugin.pc
data/misc/hexchat.appdata.xml
data/misc/hexchat.desktop
data/misc/hexchat.desktop.in
data/misc/htm.desktop
src/common/dbus/example
src/common/dbus/org.hexchat.service.service
src/common/dbus/remote-object-glue.h
src/common/make-te
src/common/marshal.*
src/common/textenums.h
src/common/textevents.h
src/fe-gtk/hexchat
src/fe-gtk/hexchat.rc
src/fe-gtk/resources.c
src/fe-gtk/resources.h
src/fe-text/hexchat-text
src/htm/Main.resources
src/htm/thememan.exe
src/htm/thememan.exe.config
src/htm/thememan.exe.mdb
src/htm/thememan
stamp-h1
*.a
*.o
*.la
*.lo
*.gmo
*.mo
*.po~
*.pot
*.patch
tags
src/**/*.plist
# Win32 generated files
plugins/wmpa/wmpa_h.h
plugins/wmpa/wmpa_i.c
@@ -79,10 +19,9 @@ resource.h
*.suo
*.user
*.exe
#OSX
# OSX
osx/HexChat.app
osx/.HexChat.app
po/.intltool-merge-cache
*.zip
*.dmg
*.VC.db

View File

@@ -1,11 +1,16 @@
sudo: required
dist: trusty
language: c
cache: apt
compiler: clang
services: docker
before_install:
- docker pull ubuntu:16.04
- docker run --privileged --cidfile=/tmp/cid ubuntu:16.04 /bin/sh -c 'apt-get update && apt-get install -y meson/xenial-backports libcanberra-dev libdbus-glib-1-dev libglib2.0-dev libgtk2.0-dev libluajit-5.1-dev libnotify-dev libpci-dev libperl-dev libproxy-dev libssl-dev python3-dev mono-devel desktop-file-utils'
- docker commit `cat /tmp/cid` hexchat/ubuntu-ci
- rm -f /tmp/cid
install:
- docker run -d --privileged --cidfile=/tmp/cid --volume=${PWD}:/opt/hexchat hexchat/ubuntu-ci /bin/systemd --system
script:
- ./autogen.sh --enable-textfe --with-theme-manager --enable-static-analysis
- make V=1 -j$(nproc)
- docker exec `cat /tmp/cid` /bin/sh -c 'meson /opt/hexchat /opt/hexchat-build -Dwith-text=true -Dwith-theme-manager=true && ninja -C /opt/hexchat-build install'
after_script:
- docker kill `cat /tmp/cid`
notifications:
irc:
channels: "chat.freenode.net#hexchat-devel"
@@ -13,24 +18,3 @@ notifications:
on_success: change
matrix:
fast_finish: true
addons:
apt:
packages:
- automake
- autoconf-archive
- imagemagick
- intltool
- libcanberra-dev
- libdbus-glib-1-dev
- libglib2.0-dev
- libgtk2.0-dev
- libluajit-5.1-dev
- libnotify-dev
- libpci-dev
- libperl-dev
- libproxy-dev
- libssl-dev
- libtool
- monodevelop
- mono-devel
- python-dev

View File

@@ -1,7 +0,0 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = po src plugins data
EXTRA_DIST = autogen.sh Doxyfile readme.md

View File

@@ -1,32 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
(test -f $srcdir/src/common/hexchat.c) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the top-level directory"
exit 1
}
if [ "$1" = "--copy" ]; then
shift
aclocal --force --install || exit 1
intltoolize --force --copy --automake || exit 1
autoreconf --force --install --include=m4 -Wno-portability || exit 1
else
intltoolize --automake || exit 1
autoreconf --install --symlink --include=m4 -Wno-portability || exit 1
fi
if [ "$NOCONFIGURE" = "" ]; then
$srcdir/configure "$@" || exit 1
if [ "$1" = "--help" ]; then exit 0 else
echo "Now type \`make\' to compile" || exit 1
fi
else
echo "Skipping configure process."
fi
set +x

View File

@@ -1,812 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([HexChat],[2.12.3])
AC_PREREQ([2.64])
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11.1 dist-xz no-dist-gzip subdir-objects no-define foreign])
AM_SILENT_RULES([yes])
AC_DEFUN([HEX_CHECK_MACRO], [m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined. Is ]$2[ installed?])])])
HEX_CHECK_MACRO([AX_APPEND_COMPILE_FLAGS], [autoconf-archive])
HEX_CHECK_MACRO([PKG_PROG_PKG_CONFIG], [pkg-config])
AX_IS_RELEASE([minor-version])
AX_CHECK_ENABLE_DEBUG([yes])
AC_USE_SYSTEM_EXTENSIONS
AM_MAINTAINER_MODE([enable])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_OBJC
AM_PROG_AS
AM_PROG_AR
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
AC_PATH_PROG(MDTOOL, mdtool, no)
PKG_PROG_PKG_CONFIG
dnl -----------------------------------------------------------
dnl Language Support
dnl -----------------------------------------------------------
GETTEXT_PACKAGE=hexchat
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
IT_PROG_INTLTOOL([0.40.0])
AM_GLIB_GNU_GETTEXT
dnl displaced from acconfig.h
AH_VERBATIM([OLD_PERL],[#undef OLD_PERL])
AH_VERBATIM([PREFIX],[#undef PREFIX])
AH_VERBATIM([HEXCHATLIBDIR],[#undef HEXCHATLIBDIR])
AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
AH_VERBATIM([HAVE_LIBPCI],[#undef HAVE_LIBPCI])
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
AH_VERBATIM([HAVE_GTK_MAC],[#undef HAVE_GTK_MAC])
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
AH_VERBATIM([USING_FREEBSD],[#undef USING_FREEBSD])
AH_VERBATIM([USING_LINUX],[#undef USING_LINUX])
AH_VERBATIM([socklen_t],[#undef socklen_t])
AH_VERBATIM([USE_DBUS],[#undef USE_DBUS])
AC_PATH_PROG(sedpath, sed)
AS_IF([test "_$sedpath" = _], [
AC_MSG_ERROR(Cannot find sed: I need it!)
])
AC_PATH_PROG(unamepath, uname)
AS_IF([test "_$unamepath" = _], [
system="unknown"
], [
AC_MSG_CHECKING(system type)
system=`$unamepath -s`
AC_MSG_RESULT($system)
AS_IF([test "$system" = "Linux"], [
AC_DEFINE(USING_LINUX)
], [test "$system" = "FreeBSD"], [
AC_DEFINE(USING_FREEBSD)
])
])
platform_win32=no
platform_osx=no
AS_CASE([$host_os],
[*mingw*|*cygwin*|*msys*], [
platform_win32=yes
],
[darwin*], [
platform_osx=yes
]
)
dnl *********************************************************************
dnl ** configure switches ***********************************************
dnl *********************************************************************
AC_ARG_ENABLE(openssl,
[AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
openssl=$enableval, openssl=yes)
AC_ARG_ENABLE(gtkfe,
[AS_HELP_STRING([--disable-gtkfe],[disable building gtk frontend])],
gtkfe=$enableval, gtkfe=yes)
AC_ARG_ENABLE(textfe,
[AS_HELP_STRING([--enable-textfe],[build the text frontend (default: no)])],
textfe=$enableval, textfe=no)
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin; possible values: "python2", "python3" or specific such as "python3.3" (default on, python2)])],
python=$enableval, python=python2)
AS_IF([test "x$python" = "xyes"], [python=python2])
AC_ARG_ENABLE(perl,
[AS_HELP_STRING([--disable-perl],[don\'t build the perl plugin])],
perl=$enableval, perl=yes)
AC_ARG_ENABLE(lua,
[AS_HELP_STRING([--disable-lua],[don\'t build the lua plugin])],
lua=$enableval, lua=yes)
AC_ARG_ENABLE(perl_old,
[AS_HELP_STRING([--disable-perl_old],[no backwards compatibility for perl plugin])],
perl_old=$enableval, perl_old=yes)
AC_ARG_ENABLE(plugin,
[AS_HELP_STRING([--disable-plugin],[disable plugin support])],
plugin=$enableval, plugin=yes)
AC_ARG_ENABLE(checksum,
[AS_HELP_STRING([--disable-checksum],[disable the Checksum plugin])],
checksum=$enableval, checksum=yes)
AC_ARG_ENABLE(doat,
[AS_HELP_STRING([--disable-doat],[disable the Do At plugin])],
doat=$enableval, doat=yes)
AC_ARG_ENABLE(fishlim,
[AS_HELP_STRING([--disable-fishlim],[disable the FiSHLiM plugin])],
fishlim=$enableval, fishlim=yes)
AC_ARG_ENABLE(sysinfo,
[AS_HELP_STRING([--disable-sysinfo],[disable the SysInfo plugin])],
sysinfo=$enableval, sysinfo=yes)
AC_ARG_ENABLE(dbus,
[AS_HELP_STRING([--disable-dbus],[disable DBUS support])],
dbus=$enableval, dbus=yes)
AC_ARG_ENABLE(libnotify,
[AS_HELP_STRING([--disable-libnotify],[disable libnotify support])],
libnotify=$enableval, libnotify=yes)
AC_ARG_ENABLE(libcanberra,
[AS_HELP_STRING([--disable-libcanberra],[disable libcanberra support])],
libcanberra=$enableval, libcanberra=yes)
AC_ARG_ENABLE(libproxy,
[AS_HELP_STRING([--disable-libproxy],[disable libproxy support (default: auto)])],
libproxy=$enableval, libproxy=auto)
AC_ARG_ENABLE(isocodes,
[AS_HELP_STRING([--disable-isocodes],[disable iso-codes with spell-check])],
isocodes=$enableval, isocodes=yes)
AC_ARG_ENABLE(static-analysis,
[AS_HELP_STRING([--enable-static-analysis],[if using clang run static analysis during build (default: no)])],
analyze=$enableval, analyze=no)
AC_ARG_WITH(theme-manager,
[AS_HELP_STRING([--with-theme-manager],[compile theme manager (needs monodevelop, default: off)])],
theme_manager=$withval, theme_manager=no)
AC_ARG_ENABLE(stack-protector,
[AS_HELP_STRING([--disable-stack-protector],[disable building with stack-protector])],
stack_protector=$enableval, stack_protector=yes)
dnl *********************************************************************
dnl ** THEME-MANAGER ****************************************************
dnl *********************************************************************
AS_IF([test "x$theme_manager" != "xno"], [
AS_IF([test "x$MDTOOL" = "xno"], [
AC_MSG_ERROR([No "mdtool" found, you need to install monodevelop!])
])
])
dnl *********************************************************************
dnl ** GLIB *************************************************************
dnl *********************************************************************
AM_PATH_GLIB_2_0([2.34.0], [], [AC_MSG_ERROR([Glib not found!])], [gmodule gobject gio])
COMMON_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
COMMON_LIBS="$GLIB_LIBS"
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_34], [Dont warn using older APIs])
AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_34], [Prevents using newer APIs])
dnl *********************************************************************
dnl ** GTK **************************************************************
dnl *********************************************************************
AS_IF([test "$gtkfe" = yes], [
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.24.0], [
GUI_LIBS="$GUI_LIBS $GTK_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED"
], [
gtkfe=no
])
])
dnl *********************************************************************
dnl ** MAC_INTEGRATION **************************************************
dnl *********************************************************************
_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
AS_IF([test "x$_gdk_tgt" = xquartz], [
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration-gtk2, [
GUI_LIBS="$GUI_LIBS $GTK_MAC_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_MAC_CFLAGS"
AC_DEFINE(HAVE_GTK_MAC)
])
])
dnl *********************************************************************
dnl ** Lua **************************************************************
dnl *********************************************************************
AS_IF([test "$lua" = yes], [
AC_MSG_CHECKING(for plugin interface used by lua)
AS_IF([test "$plugin" = yes], [
AC_MSG_RESULT([yes])
m4_define_default([_LUA_LIST], [luajit lua lua5.3 lua53 lua5.2 lua52 lua5.1 lua51])
AC_ARG_VAR([LUA], [The Lua pkgconfig name, e.g. luajit or lua5.2])
AS_IF([test "x$LUA" = 'x'], [
for lua_var in _LUA_LIST; do
$PKG_CONFIG --exists $lua_var || continue
LUA=$lua_var
break
done
AS_IF([test "x$LUA" = 'x'], [
AC_MSG_ERROR([Failed to find lua])
])
])
PKG_CHECK_MODULES([LUA], $LUA, [
AC_SUBST([LUA_CFLAGS])
AC_SUBST([LUA_LIBS])
])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for lua])
lua=no
])
])
dnl *********************************************************************
dnl ** PERL *************************************************************
dnl *********************************************************************
AS_IF([test "$perl" = yes], [
AC_MSG_CHECKING(for plugin interface used by Perl)
AS_IF([test "$plugin" = yes], [
AC_MSG_RESULT([yes])
AX_PERL_EXT_FLAGS([PERL_CFLAGS], [PERL_LDFLAGS])
original_cflags="$CFLAGS"
original_ldflags="$LDFLAGS"
CFLAGS="$PERL_CFLAGS"
LDFLAGS="$PERL_LDFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#define PERL_NO_INLINE_FUNCTIONS
#include <EXTERN.h>
#include <perl.h>
]], [[]])],[perl_is_usable=yes],[perl_is_usable=no])
CFLAGS="$original_cflags"
LDFLAGS="$original_ldflags"
AS_IF([test "$perl_is_usable" = "no"], [
AC_MSG_WARN([perl test failed to compile, disabling])
perl=no
], [
AC_MSG_CHECKING([if perl plugin will be backward compatible])
AS_IF([test "$perl_old" = "yes"], [
AC_MSG_RESULT([yes])
AC_DEFINE(OLD_PERL)
], [
AC_MSG_RESULT([no])
])
])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Perl])
perl=no
])
])
dnl *********************************************************************
dnl ** PYTHON ***********************************************************
dnl *********************************************************************
AS_IF([test "x$python" != xno], [
AC_MSG_CHECKING(for plugin interface used by Python)
AS_IF([test "$plugin" = yes], [
AC_MSG_RESULT([yes])
AS_CASE([$python],
dnl set python2 default here
[python2], [
PYTHON_VERSION=2
AX_PYTHON_DEVEL([>= '2.7'])
],
dnl set python3 default here
[python3], [
PYTHON_VERSION=3
AX_PYTHON_DEVEL([>= '3.3'])
],
dnl add broken versions here
[python2.5|python2.6|python3.1|python3.2], [
AC_MSG_WARN(Unsupported Python version ${python}!)
],
dnl user supplied version
[python*], [
PYTHON_VERSION="${python#python}"
AX_PYTHON_DEVEL()
],[
AC_MSG_WARN(Unsupported Python ${python}!)
]
)
AC_MSG_CHECKING(Python version)
AS_IF([test "$ac_python_version" != ""], [
AC_MSG_RESULT($ac_python_version)
python="python-${ac_python_version}"
], [
AC_MSG_RESULT(Not found)
python=no
])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Python])
python=no
])
])
dnl *********************************************************************
dnl ** IPv6 *************************************************************
dnl *********************************************************************
dnl purely for Solaris
AC_CHECK_FUNC(select, ,
AC_CHECK_LIB(socket, select, ,
AC_CHECK_LIB(nsl, select, ,
AC_CHECK_LIB(inet, select, ,
AC_CHECK_LIB(cposix, select, ,
AC_CHECK_LIB(net, select, ,
AC_MSG_WARN(i can not find select. you might need to help me)))))))
AC_CHECK_LIB(socket, select)
AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
AC_MSG_CHECKING(whether IPv6 is supported)
AS_IF([test "$have_getaddrinfo" = yes], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
AC_MSG_ERROR(ipv6 support not found!)
])
dnl *********************************************************************
dnl ** OPENSSL **********************************************************
dnl *********************************************************************
AS_IF([test "$openssl" != no], [
PKG_CHECK_MODULES(OPENSSL, [openssl >= 0.9.8], [
AC_DEFINE(USE_OPENSSL)
openssl=yes
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
], [
unset openssl_path ac_cv_lib_ssl_SSL_new ac_cv_header_openssl_ssl_h
AS_IF([test "$openssl" != yes], [
openssl_path=$openssl
])
openssl=no
OPENSSL_LIBS="-lcrypto"
AS_IF([test -n "$openssl_path"], [
OPENSSL_LIBS="-L$openssl_path/lib $OPENSSL_LIBS"
])
SAVED_LIBS=$LIBS
LIBS="$LIBS $OPENSSL_LIBS"
AC_CHECK_LIB(ssl, SSL_new, [
AS_IF([test -n "$openssl_path"], [
OPENSSL_CFLAGS="-I$openssl_path/include"
])
SAVED_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
AC_CHECK_HEADERS(openssl/ssl.h, [
openssl=yes
AC_DEFINE(USE_OPENSSL)
OPENSSL_LIBS="$OPENSSL_LIBS -lssl"
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
])
CFLAGS=$SAVED_CFLAGS
])
LIBS=$SAVED_LIBS
])
])
dnl *********************************************************************
dnl ** LIBPROXY *********************************************************
dnl *********************************************************************
AS_IF([test "x$libproxy" = "xyes" -o "x$libproxy" = "xauto"], [
PKG_CHECK_MODULES([LIBPROXY], [libproxy-1.0], [
COMMON_LIBS="$COMMON_LIBS $LIBPROXY_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $LIBPROXY_CFLAGS"
AC_DEFINE(USE_LIBPROXY)
libproxy=yes
], [
AS_IF([test "x$libproxy" = "xyes"], [
AC_MSG_ERROR(Cannot find libproxy!)
])
libproxy=no
])
], [
libproxy=no
])
dnl *********************************************************************
dnl ** PLUGIN ***********************************************************
dnl *********************************************************************
AS_IF([test "$plugin" = yes], [
AC_DEFINE(USE_PLUGIN)
PLUGIN_LDFLAGS="-avoid-version"
AS_IF([test "$platform_win32" = yes], [
PLUGIN_LDFLAGS="$PLUGIN_LDFLAGS -no-undefined"
])
])
dnl *********************************************************************
dnl ** Checksum *********************************************************
dnl *********************************************************************
AS_IF([test "$checksum" != "no"], [
checksum=no
AC_MSG_CHECKING(for plugin interface used by Checksum)
AS_IF([test "$plugin" = yes], [
checksum=yes
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
])
])
dnl *********************************************************************
dnl ** DO AT ************************************************************
dnl *********************************************************************
AS_IF([test "$doat" != "no"], [
AC_MSG_CHECKING(for plugin interface used by Do At)
doat=no
AS_IF([test "$plugin" = yes], [
doat=yes
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Do At])
])
])
dnl *********************************************************************
dnl ** FiSHLiM **********************************************************
dnl *********************************************************************
AS_IF([test "$fishlim" != "no"], [
fishlim=no
AC_MSG_CHECKING(for plugin interface used by FiSHLiM)
AS_IF([test "$plugin" = yes], [
AC_MSG_RESULT([yes])
AC_MSG_CHECKING(for OpenSSL used by FiSHLiM)
AS_IF([test "$openssl" = yes], [
fishlim=yes
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
])
])
dnl *********************************************************************
dnl ** SYSINFO **********************************************************
dnl *********************************************************************
AS_IF([test "$sysinfo" != "no"], [
AC_MSG_CHECKING(for plugin interface used by SysInfo)
AS_IF([test "$plugin" = yes], [
AC_MSG_RESULT([yes])
AS_IF([test "$platform_osx" = yes], [
sysinfo=yes
], [
PKG_CHECK_MODULES(LIBPCI, libpci >= 3.0.0, [
sysinfo=yes
AC_DEFINE(HAVE_LIBPCI)
], [sysinfo=no])
])
], [
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SysInfo])
sysinfo=no
])
])
dnl #######################################################################
dnl # Check for DBUS libraries
dnl #######################################################################
AS_IF([test "x$dbus" = "xyes"], [
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60 gthread-2.0], dbus=yes, [
dbus=no
])
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool, no)
AS_IF([test "x$DBUS_BINDING_TOOL" = "xno" || test "x$dbus" = "xno"], [
dbus="no"
], [
COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $DBUS_CFLAGS"
AC_DEFINE(USE_DBUS)
AS_AC_EXPAND(DBUS_SERVICES_DIR, "$datadir/dbus-1/services")
AC_SUBST(DBUS_SERVICES_DIR)
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
])
])
dnl *********************************************************************
dnl ** LIBNOTIFY ********************************************************
dnl *********************************************************************
AS_IF([test "x$libnotify" = "xyes"], [
PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.4, [], [
libnotify=no
])
AS_IF([test "$libnotify" != "no"], [
GUI_LIBS="$GUI_LIBS $LIBNOTIFY_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $LIBNOTIFY_CFLAGS"
AC_DEFINE(USE_LIBNOTIFY)
])
])
dnl *********************************************************************
dnl ** LIBCANBERRA ******************************************************
dnl *********************************************************************
AS_IF([test "x$libcanberra" = "xyes"], [
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra >= 0.22, [], [
libcanberra=no
])
AS_IF([test "$libcanberra" != "no"], [
COMMON_LIBS="$COMMON_LIBS $LIBCANBERRA_LIBS"
COMMON_CFLAGS="$COMMON_CFLAGS $LIBCANBERRA_CFLAGS"
AC_DEFINE(USE_LIBCANBERRA)
])
])
dnl *********************************************************************
dnl ** SPELL ************************************************************
dnl *********************************************************************
AS_IF([test "x$isocodes" = "xyes"], [
PKG_CHECK_MODULES(ISOCODES, "iso-codes", [
iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes 2>/dev/null || echo /usr`
AC_MSG_NOTICE([iso-codes prefix: $iso_codes_prefix])
AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX], ["$iso_codes_prefix"], [ISO codes prefix])
AC_DEFINE_UNQUOTED([ISO_CODES_LOCALEDIR], ["$iso_codes_prefix/share/locale"], [ISO codes locale dir])
AC_DEFINE([HAVE_ISO_CODES], [1], [iso-codes available])
], [
isocodes=no
AC_MSG_WARN(iso-codes not found!)
])
])
dnl *********************************************************************
dnl ** Static Analysis **************************************************
dnl *********************************************************************
AS_IF([test "x$analyze" = "xyes"], [
AS_IF([test "$CC" != "clang"], [
AC_MSG_WARN(CC is not clang for static analysis)
analyze=no
])
])
dnl *********************************************************************
dnl ** CONDITIONALS *****************************************************
dnl *********************************************************************
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
AM_CONDITIONAL(DO_LUA, test "x$lua" = "xyes")
AM_CONDITIONAL(DO_PYTHON, test "x$python" != "xno")
AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
AM_CONDITIONAL(DO_STATIC_ANALYSIS, test "x$analyze" = "xyes")
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
AM_CONDITIONAL(HAVE_ISO_CODES, test "x$isocodes" = "xyes")
AM_CONDITIONAL(HAVE_GTK_MAC, test "x$_gdk_tgt" = xquartz)
AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno")
AM_CONDITIONAL(PLATFORM_OSX, test "x$platform_osx" == "xyes")
dnl *********************************************************************
dnl ** CFLAGS ***********************************************************
dnl *********************************************************************
AX_APPEND_COMPILE_FLAGS([\
-pipe \
-funsigned-char \
-fPIE \
-fPIC \
-Wall \
-Wextra \
-Wstrict-prototypes \
-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-pointer-sign \
-Wno-missing-field-initializers \
-Wno-unused-result \
-Werror=format-security \
-Werror=init-self \
-Werror=declaration-after-statement \
-Werror=missing-include-dirs \
-Werror=date-time \
-Werror=implicit-function-declaration \
-Werror=pointer-arith \
])
AS_IF([test "$stack_protector" = "yes"], [
AX_APPEND_COMPILE_FLAGS([ \
-fstack-protector-strong \
])
])
AX_APPEND_LINK_FLAGS([ \
-pie \
-Wl,-z,relro \
-Wl,-z,now \
])
dnl *********************************************************************
dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
dnl *********************************************************************
AC_MSG_CHECKING(for modern sigaction)
dnl libc5 on linux and FreeBSD 3.x doesn\'t have siginfo_t
dnl and the sa_sigation field.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[struct sigaction act;
siginfo_t *si;
act.sa_sigaction = 0;]])],[
AC_MSG_RESULT(yes)
AC_DEFINE(USE_SIGACTION)
],[AC_MSG_RESULT(no)])
AC_CHECK_FUNCS(memrchr)
AC_CHECK_FUNC(gethostbyname, ,
AC_CHECK_LIB(resolv, gethostbyname, ,
AC_CHECK_LIB(nsl, gethostbyname)))
AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(nsl, gethostname))
dnl necessary for IRIX
AC_CHECK_HEADERS(strings.h)
dnl Check for type in sys/socket.h - from Squid source (GPL)
AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
#include <sys/socket.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)
])
AS_IF([test $ac_cv_type_socklen_t = no], [
AC_DEFINE(socklen_t, int)
])
dnl Mac OS X and Darwin use lookupd, which caches DNS queries by default
AC_EGREP_CPP(lookupd, dnl
[#if (defined(__APPLE__) && defined(__MACH__))
lookupd
#endif], AC_DEFINE([LOOKUPD],1,[Define to 1 if the system uses lookupd]))
dnl freebsd needs this
LIBS="$LIBS $INTLLIBS"
GUI_LIBS="$GUI_LIBS $COMMON_LIBS"
dnl make these visible to all Makefiles
AC_SUBST(GUI_LIBS)
AC_SUBST(GUI_CFLAGS)
AC_SUBST(COMMON_LIBS)
AC_SUBST(COMMON_CFLAGS)
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LDFLAGS)
AC_SUBST(PYTHON_CPPFLAGS)
AC_SUBST(PYTHON_LIBS)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
AC_SUBST(OPENSSL_LIBS)
AC_SUBST(OPENSSL_CFLAGS)
AC_SUBST(PLUGIN_LDFLAGS)
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
dnl for plugin.c and pixmaps.c
AS_IF([test "x$prefix" = xNONE], [
prefix="$ac_default_prefix"
])
AS_IF([test "x$exec_prefix" = xNONE], [
exec_prefix="$prefix"
])
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
AS_AC_EXPAND(HEXCHATLIBDIR, "${libdir}/hexchat/plugins")
AC_DEFINE_UNQUOTED(HEXCHATLIBDIR, "$HEXCHATLIBDIR")
AS_AC_EXPAND(HEXCHATSHAREDIR, "$datadir")
AC_DEFINE_UNQUOTED(HEXCHATSHAREDIR, "$HEXCHATSHAREDIR")
dnl for plugins/xxx/Makefile.am
hexchatlibdir=${libdir}/hexchat/plugins
AC_SUBST(hexchatlibdir)
AC_CONFIG_FILES([
Makefile
data/Makefile
data/icons/Makefile
data/misc/Makefile
data/man/Makefile
data/man/hexchat.1
data/pkgconfig/Makefile
data/pkgconfig/hexchat-plugin.pc
src/Makefile
src/common/Makefile
src/common/dbus/Makefile
src/fe-text/Makefile
src/fe-gtk/Makefile
src/htm/Makefile
src/htm/thememan
osx/Info.plist
plugins/Makefile
plugins/lua/Makefile
plugins/python/Makefile
plugins/perl/Makefile
plugins/checksum/Makefile
plugins/doat/Makefile
plugins/fishlim/Makefile
plugins/sysinfo/Makefile
po/Makefile.in
])
AC_OUTPUT
echo
echo HexChat $VERSION
echo
echo GTK+ interface ........ : $gtkfe
echo Text interface ........ : $textfe
echo Theme manager ......... : $theme_manager
echo
echo OpenSSL support ....... : $openssl
echo D-Bus support ......... : $dbus
echo libnotify support ..... : $libnotify
echo libcanberra support ... : $libcanberra
echo Plugin interface ...... : $plugin
echo libproxy support ...... : $libproxy
echo
echo Lua ................... : $lua \($LUA\)
echo Perl .................. : $perl
echo Python ................ : $python
echo
echo Checksum .............. : $checksum
echo Do At ................. : $doat
echo FiSHLiM ............... : $fishlim
echo SysInfo ............... : $sysinfo
echo
echo Debug mode ............ : $enable_debug
echo
echo The binary will be installed in $prefix/bin
echo
if test "$gtkfe" = no; then
echo Warning: The GTK \(GUI\) frontend will not be built.
echo
fi
echo configure complete, now type \'make\' and pray.
echo

View File

@@ -1,16 +0,0 @@
SUBDIRS =
if DO_PLUGIN
SUBDIRS += pkgconfig
endif
if DO_GTK
SUBDIRS += icons misc man
else
if WITH_TM
SUBDIRS += misc
endif
endif
EXTRA_DIST = \
hexchat.gresource.xml

View File

@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/icons">
<file alias="hexchat.png" preprocess="to-pixdata" compressed="true">icons/hexchat.png</file>
<file alias="book.png" preprocess="to-pixdata" compressed="true">icons/book.png</file>
<file alias="hexchat.png" preprocess="to-pixdata">icons/hexchat.png</file>
<file alias="book.png" preprocess="to-pixdata">icons/book.png</file>
<file alias="ulist_voice.png" preprocess="to-pixdata" compressed="true">icons/ulist_voice.png</file>
<file alias="ulist_halfop.png" preprocess="to-pixdata" compressed="true">icons/ulist_halfop.png</file>
<file alias="ulist_op.png" preprocess="to-pixdata" compressed="true">icons/ulist_op.png</file>
<file alias="ulist_owner.png" preprocess="to-pixdata" compressed="true">icons/ulist_owner.png</file>
<file alias="ulist_founder.png" preprocess="to-pixdata" compressed="true">icons/ulist_founder.png</file>
<file alias="ulist_netop.png" preprocess="to-pixdata" compressed="true">icons/ulist_netop.png</file>
<file alias="ulist_voice.png" preprocess="to-pixdata">icons/ulist_voice.png</file>
<file alias="ulist_halfop.png" preprocess="to-pixdata">icons/ulist_halfop.png</file>
<file alias="ulist_op.png" preprocess="to-pixdata">icons/ulist_op.png</file>
<file alias="ulist_owner.png" preprocess="to-pixdata">icons/ulist_owner.png</file>
<file alias="ulist_founder.png" preprocess="to-pixdata">icons/ulist_founder.png</file>
<file alias="ulist_netop.png" preprocess="to-pixdata">icons/ulist_netop.png</file>
<file alias="tray_fileoffer.png" preprocess="to-pixdata" compressed="true">icons/tray_fileoffer.png</file>
<file alias="tray_highlight.png" preprocess="to-pixdata" compressed="true">icons/tray_highlight.png</file>
<file alias="tray_message.png" preprocess="to-pixdata" compressed="true">icons/tray_message.png</file>
<file alias="tray_fileoffer.png" preprocess="to-pixdata">icons/tray_fileoffer.png</file>
<file alias="tray_highlight.png" preprocess="to-pixdata">icons/tray_highlight.png</file>
<file alias="tray_message.png" preprocess="to-pixdata">icons/tray_message.png</file>
<file alias="tree_channel.png" preprocess="to-pixdata">icons/tree_channel.png</file>
<file alias="tree_dialog.png" preprocess="to-pixdata" compressed="true">icons/tree_dialog.png</file>
<file alias="tree_server.png" preprocess="to-pixdata" compressed="true">icons/tree_server.png</file>
<file alias="tree_util.png" preprocess="to-pixdata" compressed="true">icons/tree_util.png</file>
<file alias="tree_dialog.png" preprocess="to-pixdata">icons/tree_dialog.png</file>
<file alias="tree_server.png" preprocess="to-pixdata">icons/tree_server.png</file>
<file alias="tree_util.png" preprocess="to-pixdata">icons/tree_util.png</file>
</gresource>
</gresources>

View File

@@ -1,15 +0,0 @@
icon_DATA = hexchat.png
icondir = $(datadir)/icons/hicolor/48x48/apps
hicolor_DATA = hexchat.svg
hicolordir = $(datadir)/icons/hicolor/scalable/apps
UPDATE_ICON_CACHE = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor || :
install-data-hook:
$(UPDATE_ICON_CACHE);
uninstall-hook:
$(UPDATE_ICON_CACHE);
EXTRA_DIST = $(icon_DATA) $(hicolor_DATA)

9
data/icons/meson.build Normal file
View File

@@ -0,0 +1,9 @@
icondir = join_paths(get_option('datadir'), 'icons/hicolor')
install_data(
'hexchat.png',
install_dir: join_paths(icondir, '48x48/apps')
)
install_data(
'hexchat.svg',
install_dir: join_paths(icondir, 'scalable/apps')
)

View File

@@ -1,3 +0,0 @@
man_MANS = hexchat.1
EXTRA_DIST = hexchat.1.in

10
data/man/meson.build Normal file
View File

@@ -0,0 +1,10 @@
man_conf = configuration_data()
man_conf.set('VERSION', meson.project_version())
configure_file(
input: 'hexchat.1.in',
output: 'hexchat.1',
configuration: man_conf,
install: true,
install_dir: join_paths(get_option('mandir'), 'man1')
)

11
data/meson.build Normal file
View File

@@ -0,0 +1,11 @@
if get_option('with-plugin')
subdir('pkgconfig')
endif
if get_option('with-gtk')
subdir('icons')
subdir('misc')
subdir('man')
elif get_option('with-theme-manager')
subdir('misc')
endif

View File

@@ -1,50 +0,0 @@
appdatadir = $(datadir)/appdata
appdata_in_files =
if DO_GTK
appdata_in_files += hexchat.appdata.xml.in
endif
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
@INTLTOOL_XML_RULE@
if USE_DBUS
exec_command = 'hexchat --existing %U'
else
exec_command = 'hexchat %U'
endif
hexchat.desktop.in: hexchat.desktop.in.in
$(AM_V_GEN)sed -e s!\@exec_command\@!$(exec_command)! < $< > $@
data_desktopdir = $(datadir)/applications
data_desktop_in_files =
if DO_GTK
data_desktop_in_files += hexchat.desktop.in
endif
if WITH_TM
data_desktop_in_files += htm.desktop.in
mime_DATA = htm-mime.xml
mimedir = $(datadir)/mime/packages
endif
data_desktop_DATA = $(data_desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
UPDATE_MIME_DATABASE = update-mime-database "$(datadir)/mime" || :
UPDATE_DESKTOP_DATABASE = update-desktop-database -q "$(datadir)/applications" || :
install-data-hook:
$(UPDATE_MIME_DATABASE);
$(UPDATE_DESKTOP_DATABASE);
uninstall-hook:
$(UPDATE_MIME_DATABASE);
$(UPDATE_DESKTOP_DATABASE);
EXTRA_DIST = hexchat.appdata.xml.in hexchat.desktop.in.in htm.desktop.in htm-mime.xml
CLEANFILES = $(appdata_DATA) $(data_desktop_DATA) hexchat.desktop.in

View File

@@ -8,8 +8,8 @@
<translation type="gettext">hexchat</translation>
<summary>IRC Client</summary>
<description>
<_p>HexChat is an easy to use yet extensible IRC Client. It allows you to securely join multiple networks and talk to users privately or in channels using a customizable interface. You can even transfer files.</_p>
<_p>HexChat supports features such as: DCC, SASL, proxies, spellcheck, alerts, logging, custom themes, and Python/Perl scripts.</_p>
<p>HexChat is an easy to use yet extensible IRC Client. It allows you to securely join multiple networks and talk to users privately or in channels using a customizable interface. You can even transfer files.</p>
<p>HexChat supports features such as: DCC, SASL, proxies, spellcheck, alerts, logging, custom themes, and Python/Perl scripts.</p>
</description>
<url type="homepage">http://hexchat.github.io</url>
<url type="bugtracker">https://github.com/hexchat/hexchat</url>
@@ -19,8 +19,38 @@
<screenshots>
<screenshot type="default">
<image>http://i.imgur.com/tLMguQz.png</image>
<_caption>Main Chat Window</_caption>
<caption>Main Chat Window</caption>
</screenshot>
</screenshots>
<releases>
<release date="2016-12-10" version="2.12.4">
<description>
<p>This is another bug fix release:</p>
<ul>
<li>Fix issue with timers causing ping timeouts</li>
<li>Fix building against OpenSSL 1.1</li>
<li>Fix /exec output printing invalid utf8</li>
<li>Replace doat plugin with an internal command</li>
<li>Change how tab colors interact with plugins</li>
<li>Enable filtering the beep character by default</li>
</ul>
</description>
</release>
<release date="2016-10-22" version="2.12.3">
<description>
<p>This is a minor bug fix release just cleaning up a few issues:</p>
<ul>
<li>Fix crash with bad translations</li>
<li>Add new mhop command</li>
<li>Change ping timeout to 60 by default</li>
</ul>
</description>
</release>
</releases>
<kudos>
<kudo>UserDocs</kudo>
<kudo>HiDpiIcon</kudo>
<kudo>Notifications</kudo>
</kudos>
<update_contact>tingping_at_fedoraproject.org</update_contact>
</component>

View File

@@ -1,8 +1,8 @@
[Desktop Entry]
_Name=HexChat
_GenericName=IRC Client
_Comment=Chat with other people online
_Keywords=IM;Chat;
Name=HexChat
GenericName=IRC Client
Comment=Chat with other people online
Keywords=IM;Chat;
Exec=@exec_command@
Icon=hexchat
Terminal=false
@@ -14,5 +14,5 @@ MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
Actions=SafeMode;
[Desktop Action SafeMode]
_Name=Open Safe Mode
Name=Open Safe Mode
Exec=hexchat --no-auto --no-plugins

View File

@@ -1,5 +1,5 @@
[Desktop Entry]
_Name=HexChat Theme Manager
Name=HexChat Theme Manager
Exec=thememan %f
Icon=hexchat
Terminal=false

68
data/misc/meson.build Normal file
View File

@@ -0,0 +1,68 @@
appdir = join_paths(get_option('datadir'), 'applications')
desktop_utils = find_program('desktop-file-validate', required: false)
if get_option('with-gtk')
hexchat_appdata = i18n.merge_file(
input: 'hexchat.appdata.xml.in',
output: 'hexchat.appdata.xml',
po_dir: '../../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
)
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate hexchat.appdata.xml', appstream_util,
args: ['validate', hexchat_appdata]
)
endif
desktop_conf = configuration_data()
if get_option('with-dbus')
desktop_conf.set('exec_command', 'hexchat --existing %U')
else
desktop_conf.set('exec_command', 'hexchat %U')
endif
desktop_file = configure_file(
input: 'hexchat.desktop.in.in',
output: 'hexchat.desktop.in',
configuration: desktop_conf
)
hexchat_desktop = i18n.merge_file(
input: desktop_file,
output: 'hexchat.desktop',
po_dir: '../../po',
type: 'desktop',
install: true,
install_dir: appdir
)
if desktop_utils.found()
test('Validate hexchat.desktop', desktop_utils,
args: [hexchat_desktop]
)
endif
endif
if get_option('with-theme-manager')
htm_desktop = i18n.merge_file(
input: 'htm.desktop.in',
output: 'htm.desktop',
po_dir: '../../po',
type: 'desktop',
install: true,
install_dir: appdir
)
if desktop_utils.found()
test('Validate htm.desktop', desktop_utils,
args: [htm_desktop]
)
endif
install_data('htm-mime.xml',
install_dir: join_paths(get_option('datadir'), 'mime/packages')
)
endif

View File

@@ -1,4 +0,0 @@
pkgcfgdir = $(pkgconfigdir)
pkgcfg_DATA = hexchat-plugin.pc
EXTRA_DIST = hexchat-plugin.pc.in

View File

@@ -0,0 +1,14 @@
pkg_conf = configuration_data()
prefix = get_option('prefix')
pkg_conf.set('prefix', prefix)
pkg_conf.set('VERSION', meson.project_version())
pkg_conf.set('hexchatlibdir', join_paths(prefix, plugindir))
pkg_conf.set('includedir', join_paths(prefix, get_option('includedir')))
configure_file(
input: 'hexchat-plugin.pc.in',
output: 'hexchat-plugin.pc',
configuration: pkg_conf,
install: true,
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
)

17
fedora-mingw64.ini Normal file
View File

@@ -0,0 +1,17 @@
; dnf install mingw64-{gtk,openssl}
[binaries]
c = '/usr/bin/x86_64-w64-mingw32-gcc'
cpp = '/usr/bin/x86_64-w64-mingw32-g++'
ar = '/usr/bin/x86_64-w64-mingw32-gcc-ar'
strip = '/usr/bin/x86_64-w64-mingw32-strip'
pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'
[properties]
c_args = ['-DNTDDI_VERSION=NTDDI_WIN7', '-D_WIN32_WINNT=_WIN32_WINNT_WIN7']
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

View File

@@ -1,40 +0,0 @@
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var" = "x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])

View File

@@ -1,124 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no], [ENABLE DEBUG VARIABLES ...], [DISABLE DEBUG VARIABLES NDEBUG ...], [IS-RELEASE])
#
# DESCRIPTION
#
# Check for the presence of an --enable-debug option to configure, with
# the specified default value used when the option is not present. Return
# the value in the variable $ax_enable_debug.
#
# Specifying 'yes' adds '-g -O0' to the compilation flags for all
# languages. Specifying 'info' adds '-g' to the compilation flags.
# Specifying 'profile' adds '-g -pg' to the compilation flags and '-pg' to
# the linking flags. Otherwise, nothing is added.
#
# Define the variables listed in the second argument if debug is enabled,
# defaulting to no variables. Defines the variables listed in the third
# argument if debug is disabled, defaulting to NDEBUG. All lists of
# variables should be space-separated.
#
# If debug is not enabled, ensure AC_PROG_* will not add debugging flags.
# Should be invoked prior to any AC_PROG_* compiler checks.
#
# IS-RELEASE can be used to change the default to 'no' when making a
# release. Set IS-RELEASE to 'yes' or 'no' as appropriate. By default, it
# uses the value of $ax_is_release, so if you are using the AX_IS_RELEASE
# macro, there is no need to pass this parameter.
#
# AX_IS_RELEASE([git-directory])
# AX_CHECK_ENABLE_DEBUG()
#
# LICENSE
#
# Copyright (c) 2011 Rhys Ulerich <rhys.ulerich@gmail.com>
# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
#serial 5
AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[
AC_BEFORE([$0],[AC_PROG_CC])dnl
AC_BEFORE([$0],[AC_PROG_CXX])dnl
AC_BEFORE([$0],[AC_PROG_F77])dnl
AC_BEFORE([$0],[AC_PROG_FC])dnl
AC_MSG_CHECKING(whether to enable debugging)
ax_enable_debug_default=m4_tolower(m4_normalize(ifelse([$1],,[no],[$1])))
ax_enable_debug_is_release=m4_tolower(m4_normalize(ifelse([$4],,
[$ax_is_release],
[$4])))
# If this is a release, override the default.
AS_IF([test "$ax_enable_debug_is_release" = "yes"],
[ax_enable_debug_default="no"])
m4_define(ax_enable_debug_vars,[m4_normalize(ifelse([$2],,,[$2]))])
m4_define(ax_disable_debug_vars,[m4_normalize(ifelse([$3],,[NDEBUG],[$3]))])
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug=]@<:@yes/info/profile/no@:>@,[compile with debugging])],
[],enable_debug=$ax_enable_debug_default)
# empty mean debug yes
AS_IF([test "x$enable_debug" = "x"],
[enable_debug="yes"])
# case of debug
AS_CASE([$enable_debug],
[yes],[
AC_MSG_RESULT(yes)
CFLAGS="${CFLAGS} -g -O0"
CXXFLAGS="${CXXFLAGS} -g -O0"
FFLAGS="${FFLAGS} -g -O0"
FCFLAGS="${FCFLAGS} -g -O0"
OBJCFLAGS="${OBJCFLAGS} -g -O0"
],
[info],[
AC_MSG_RESULT(info)
CFLAGS="${CFLAGS} -g"
CXXFLAGS="${CXXFLAGS} -g"
FFLAGS="${FFLAGS} -g"
FCFLAGS="${FCFLAGS} -g"
OBJCFLAGS="${OBJCFLAGS} -g"
],
[profile],[
AC_MSG_RESULT(profile)
CFLAGS="${CFLAGS} -g -pg"
CXXFLAGS="${CXXFLAGS} -g -pg"
FFLAGS="${FFLAGS} -g -pg"
FCFLAGS="${FCFLAGS} -g -pg"
OBJCFLAGS="${OBJCFLAGS} -g -pg"
LDFLAGS="${LDFLAGS} -pg"
],
[
AC_MSG_RESULT(no)
dnl Ensure AC_PROG_CC/CXX/F77/FC/OBJC will not enable debug flags
dnl by setting any unset environment flag variables
AS_IF([test "x${CFLAGS+set}" != "xset"],
[CFLAGS=""])
AS_IF([test "x${CXXFLAGS+set}" != "xset"],
[CXXFLAGS=""])
AS_IF([test "x${FFLAGS+set}" != "xset"],
[FFLAGS=""])
AS_IF([test "x${FCFLAGS+set}" != "xset"],
[FCFLAGS=""])
AS_IF([test "x${OBJCFLAGS+set}" != "xset"],
[OBJCFLAGS=""])
])
dnl Define various variables if debugging is disabled.
dnl assert.h is a NOP if NDEBUG is defined, so define it by default.
AS_IF([test "x$enable_debug" = "xyes"],
[m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is enabled])])],
[m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is disabled])])])
ax_enable_debug=$enable_debug
])

View File

@@ -1,69 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_is_release.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_IS_RELEASE(POLICY)
#
# DESCRIPTION
#
# Determine whether the code is being configured as a release, or from
# git. Set the ax_is_release variable to 'yes' or 'no'.
#
# If building a release version, it is recommended that the configure
# script disable compiler errors and debug features, by conditionalising
# them on the ax_is_release variable. If building from git, these
# features should be enabled.
#
# The POLICY parameter specifies how ax_is_release is determined. It can
# take the following values:
#
# * git-directory: ax_is_release will be 'no' if a '.git' directory exists
# * minor-version: ax_is_release will be 'no' if the minor version number
# in $PACKAGE_VERSION is odd; this assumes
# $PACKAGE_VERSION follows the 'major.minor.micro' scheme
# * micro-version: ax_is_release will be 'no' if the micro version number
# in $PACKAGE_VERSION is odd; this assumes
# $PACKAGE_VERSION follows the 'major.minor.micro' scheme
# * always: ax_is_release will always be 'yes'
# * never: ax_is_release will always be 'no'
#
# Other policies may be added in future.
#
# LICENSE
#
# Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
#serial 3
AC_DEFUN([AX_IS_RELEASE],[
AC_BEFORE([AC_INIT],[$0])
m4_case([$1],
[git-directory],[
# $is_release = (.git directory does not exist)
AS_IF([test -d .git],[ax_is_release=no],[ax_is_release=yes])
],
[minor-version],[
# $is_release = ($minor_version is even)
minor_version=`echo "$PACKAGE_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
AS_IF([test "$(( $minor_version % 2 ))" -ne 0],
[ax_is_release=no],[ax_is_release=yes])
],
[micro-version],[
# $is_release = ($micro_version is even)
micro_version=`echo "$PACKAGE_VERSION" | sed 's/[[^.]]*\.[[^.]]*\.\([[^.]]*\).*/\1/'`
AS_IF([test "$(( $micro_version % 2 ))" -ne 0],
[ax_is_release=no],[ax_is_release=yes])
],
[always],[ax_is_release=yes],
[never],[ax_is_release=no],
[
AC_MSG_ERROR([Invalid policy. Valid policies: git-directory, minor-version.])
])
])

View File

@@ -1,327 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PYTHON_DEVEL([version])
#
# DESCRIPTION
#
# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
# in your configure.ac.
#
# This macro checks for Python and tries to get the include path to
# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LIBS) output
# variables. It also exports $(PYTHON_EXTRA_LIBS) and
# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
#
# You can search for some particular version of Python by passing a
# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
# note that you *have* to pass also an operator along with the version to
# match, and pay special attention to the single quotes surrounding the
# version number. Don't use "PYTHON_VERSION" for this: that environment
# variable is declared as precious and thus reserved for the end-user.
#
# This macro should work for all versions of Python >= 2.1.0. As an end
# user, you can disable the check for the python version by setting the
# PYTHON_NOVERSIONCHECK environment variable to something else than the
# empty string.
#
# If you need to use this macro for an older Python version, please
# contact the authors. We're always open for feedback.
#
# LICENSE
#
# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
# Copyright (c) 2009 Alan W. Irwin
# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net>
# Copyright (c) 2009 Andrew Collier
# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 18
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
AC_DEFUN([AX_PYTHON_DEVEL],[
#
# Allow the use of a (user set) custom python version
#
AC_ARG_VAR([PYTHON_VERSION],[The installed Python
version to use, for example '2.3'. This string
will be appended to the Python interpreter
canonical name.])
AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
if test -z "$PYTHON"; then
AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
PYTHON_VERSION=""
fi
#
# Check for a version of Python >= 2.1.0
#
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
ac_supports_python_ver=`$PYTHON -c "import sys; \
ver = sys.version.split ()[[0]]; \
print (ver >= '2.1.0')"`
if test "$ac_supports_python_ver" != "True"; then
if test -z "$PYTHON_NOVERSIONCHECK"; then
AC_MSG_RESULT([no])
AC_MSG_FAILURE([
This version of the AC@&t@_PYTHON_DEVEL macro
doesn't work properly with versions of Python before
2.1.0. You may need to re-run configure, setting the
variables PYTHON_CPPFLAGS, PYTHON_LIBS, PYTHON_SITE_PKG,
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
to something else than an empty string.
])
else
AC_MSG_RESULT([skip at user request])
fi
else
AC_MSG_RESULT([yes])
fi
#
# if the macro parameter ``version'' is set, honour it
#
if test -n "$1"; then
AC_MSG_CHECKING([for a version of Python $1])
ac_supports_python_ver=`$PYTHON -c "import sys; \
ver = sys.version.split ()[[0]]; \
print (ver $1)"`
if test "$ac_supports_python_ver" = "True"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([this package requires Python $1.
If you have it installed, but it isn't the default Python
interpreter in your system path, please pass the PYTHON_VERSION
variable to configure. See ``configure --help'' for reference.
])
PYTHON_VERSION=""
fi
fi
#
# Check if you have distutils, else fail
#
AC_MSG_CHECKING([for the distutils Python package])
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
if test -z "$ac_distutils_result"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot import Python module "distutils".
Please check your Python installation. The error was:
$ac_distutils_result])
PYTHON_VERSION=""
fi
#
# Check for Python include path
#
AC_MSG_CHECKING([for Python include path])
if test -z "$PYTHON_CPPFLAGS"; then
python_path=`$PYTHON -c "import distutils.sysconfig; \
print (distutils.sysconfig.get_python_inc ());"`
plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
if test -n "${python_path}"; then
if test "${plat_python_path}" != "${python_path}"; then
python_path="-I$python_path -I$plat_python_path"
else
python_path="-I$python_path"
fi
fi
PYTHON_CPPFLAGS=$python_path
fi
AC_MSG_RESULT([$PYTHON_CPPFLAGS])
AC_SUBST([PYTHON_CPPFLAGS])
#
# Check for Python library path
#
AC_MSG_CHECKING([for Python library path])
if test -z "$PYTHON_LIBS"; then
# (makes two attempts to ensure we've got a version number
# from the interpreter)
ac_python_version=`cat<<EOD | $PYTHON -
# join all versioning strings, on some systems
# major/minor numbers could be in different list elements
from distutils.sysconfig import *
e = get_config_var('VERSION')
if e is not None:
print(e)
EOD`
if test -z "$ac_python_version"; then
if test -n "$PYTHON_VERSION"; then
ac_python_version=$PYTHON_VERSION
else
ac_python_version=`$PYTHON -c "import sys; \
print (sys.version[[:3]])"`
fi
fi
# Make the versioning information available to the compiler
AC_DEFINE_UNQUOTED([HAVE_PYTHON], ["$ac_python_version"],
[If available, contains the Python version number currently in use.])
# First, the library directory:
ac_python_libdir=`cat<<EOD | $PYTHON -
# There should be only one
import distutils.sysconfig
e = distutils.sysconfig.get_config_var('LIBDIR')
if e is not None:
print (e)
EOD`
# Now, for the library:
ac_python_library=`cat<<EOD | $PYTHON -
import distutils.sysconfig
c = distutils.sysconfig.get_config_vars()
if 'LDVERSION' in c:
print ('python'+c[['LDVERSION']])
else:
print ('python'+c[['VERSION']])
EOD`
# This small piece shamelessly adapted from PostgreSQL python macro;
# credits goes to momjian, I think. I'd like to put the right name
# in the credits, if someone can point me in the right direction... ?
#
if test -n "$ac_python_libdir" -a -n "$ac_python_library"
then
# use the official shared library
ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
PYTHON_LIBS="-L$ac_python_libdir -l$ac_python_library"
else
# old way: use libpython from python_configdir
ac_python_libdir=`$PYTHON -c \
"from distutils.sysconfig import get_python_lib as f; \
import os; \
print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
fi
if test -z "PYTHON_LIBS"; then
AC_MSG_ERROR([
Cannot determine location of your Python DSO. Please check it was installed with
dynamic libraries enabled, or try setting PYTHON_LIBS by hand.
])
fi
fi
AC_MSG_RESULT([$PYTHON_LIBS])
AC_SUBST([PYTHON_LIBS])
#
# Check for site packages
#
AC_MSG_CHECKING([for Python site-packages path])
if test -z "$PYTHON_SITE_PKG"; then
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
print (distutils.sysconfig.get_python_lib(0,0));"`
fi
AC_MSG_RESULT([$PYTHON_SITE_PKG])
AC_SUBST([PYTHON_SITE_PKG])
#
# libraries which must be linked in when embedding
#
AC_MSG_CHECKING(python extra libraries)
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print (conf('LIBS') + ' ' + conf('SYSLIBS'))"`
fi
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
AC_SUBST(PYTHON_EXTRA_LDFLAGS)
#
# linking flags needed when embedding
#
AC_MSG_CHECKING(python extra linking flags)
if test -z "$PYTHON_EXTRA_LIBS"; then
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print (conf('LINKFORSHARED'))"`
fi
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
AC_SUBST(PYTHON_EXTRA_LIBS)
#
# final check to see if everything compiles alright
#
AC_MSG_CHECKING([consistency of all components of python development environment])
# save current global flags
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
ac_save_CPPFLAGS="$CPPFLAGS"
LIBS="$ac_save_LIBS $PYTHON_LIBS $PYTHON_EXTRA_LIBS $PYTHON_EXTRA_LIBS"
LDFLAGS="$ac_save_LDFLAGS $PYTHON_EXTRA_LDFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
AC_LANG_PUSH([C])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <Python.h>]],
[[Py_Initialize();]])
],[pythonexists=yes],[pythonexists=no])
AC_LANG_POP([C])
# turn back to default flags
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
LDFLAGS="$ac_save_LDFLAGS"
AC_MSG_RESULT([$pythonexists])
if test ! "x$pythonexists" = "xyes"; then
AC_MSG_FAILURE([
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LIBS environment variable.
Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
])
PYTHON_VERSION=""
fi
#
# all done!
#
])

View File

@@ -1,8 +0,0 @@
analysis_verbose = $(analysis_verbose_$(V))
analysis_verbose_ = $(analysis_verbose_$(AM_DEFAULT_VERBOSITY))
analysis_verbose_0 = @echo " CCSA " $@; $(COMPILE) --analyze $< -o $@;
analysis_verbose_1 = $(COMPILE) --analyze $< -o $@;
%.plist: %.c
$(analysis_verbose)

138
meson.build Normal file
View File

@@ -0,0 +1,138 @@
project('hexchat', 'c',
version: '2.12.4',
meson_version: '>= 0.37.0',
default_options: [
'c_std=gnu89',
'buildtype=debugoptimized',
'warning_level=1',
]
)
i18n = import('i18n')
gnome = import('gnome')
cc = meson.get_compiler('c')
libgio_dep = dependency('gio-2.0', version: '>= 2.34.0')
libgmodule_dep = dependency('gmodule-2.0')
if cc.get_id() == 'msvc'
libssl_dep = cc.find_library('libeay32')
else
libssl_dep = dependency('openssl', version: '>= 0.9.8',
required: get_option('with-ssl'))
endif
config_h = configuration_data()
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('GETTEXT_PACKAGE', 'hexchat')
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'),
get_option('datadir'), 'locale'))
config_h.set10('ENABLE_NLS', true)
# Optional features
config_h.set('USE_OPENSSL', get_option('with-ssl'))
config_h.set('USE_LIBPROXY', get_option('with-libproxy'))
config_h.set('USE_LIBCANBERRA', get_option('with-libcanberra'))
config_h.set('USE_DBUS', get_option('with-dbus'))
config_h.set('USE_PLUGIN', get_option('with-plugin'))
config_h.set('G_DISABLE_SINGLE_INCLUDES', true)
config_h.set('GTK_DISABLE_DEPRECATED', true)
config_h.set('GTK_DISABLE_SINGLE_INCLUDES', true)
config_h.set('GDK_PIXBUF_DISABLE_SINGLE_INCLUDES', true)
config_h.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_2_34')
config_h.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_34')
# Detected features
config_h.set('HAVE_MEMRCHR', cc.has_function('memrchr'))
config_h.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
if libssl_dep.found()
config_h.set('HAVE_X509_GET_SIGNATURE_NID',
cc.has_function('X509_get_signature_nid', dependencies: libssl_dep)
)
config_h.set('HAVE_SSL_CTX_GET_SSL_METHOD',
cc.has_function('SSL_CTX_get_ssl_method', dependencies: libssl_dep)
)
config_h.set('HAVE_DH_SET0_PQG',
cc.has_function('DH_set0_pqg', dependencies: libssl_dep)
)
config_h.set('HAVE_DH_GET0_KEY',
cc.has_function('DH_get0_key', dependencies: libssl_dep)
)
config_h.set('HAVE_DH_SET0_KEY',
cc.has_function('DH_set0_key', dependencies: libssl_dep)
)
config_h.set('HAVE_ERR_REMOVE_THREAD_STATE',
cc.has_function('ERR_remove_thread_state', dependencies: libssl_dep)
)
config_h.set('HAVE_ASN1_STRING_GET0_DATA',
cc.has_function('ASN1_STRING_get0_data', dependencies: libssl_dep)
)
endif
configure_file(output: 'config.h', configuration: config_h)
config_h_include = include_directories('.')
global_cflags = []
test_cflags = [
'-pipe',
'-funsigned-char',
'-Wno-conversion',
'-Wno-pointer-sign',
'-Wno-padded',
'-Wno-unused-parameter',
'-Wno-missing-prototypes',
'-Winline',
'-Wstrict-prototypes',
'-Werror=implicit-function-declaration',
'-Werror=pointer-arith',
'-Werror=init-self',
['-Werror=format-security', '-Werror=format=1'],
'-Werror=missing-include-dirs',
'-Werror=date-time',
]
foreach cflag : test_cflags
if cc.has_multi_arguments(cflag)
global_cflags += cflag
endif
endforeach
if get_option('buildtype') != 'plain'
if cc.has_argument('-fstack-protector-strong') and cc.links('''
int main (void) {
char buffer[16];
strcpy(buffer, "foo");
return 0;
}
''', args: '-fstack-protector-all')
global_cflags += '-fstack-protector-strong'
endif
endif
add_project_arguments(global_cflags, language: 'c')
global_ldflags = []
test_ldflags = [
'-Wl,-z,relro',
'-Wl,-z,now',
]
foreach ldflag : test_ldflags
if cc.has_argument(ldflag) and cc.links('int main (void) { return 0; }', args: ldflag)
global_ldflags += ldflag
endif
endforeach
add_project_link_arguments(global_ldflags, language: 'c')
subdir('src')
if get_option('with-plugin')
subdir('plugins')
endif
if cc.get_id() != 'msvc'
subdir('data')
subdir('po') # FIXME: build xgettext
meson.add_install_script('meson_post_install.py',
'@0@'.format(get_option('with-theme-manager'))
)
endif

56
meson_options.txt Normal file
View File

@@ -0,0 +1,56 @@
option('with-gtk', type: 'boolean',
description: 'Main graphical interface'
)
option('with-text', type: 'boolean', value: false,
description: 'Text interface (not generally useful)'
)
option('with-ssl', type: 'boolean',
description: 'Support for TLS connections, requires openssl'
)
option('with-plugin', type: 'boolean',
description: 'Support for loadable plugins'
)
option('with-dbus', type: 'boolean',
description: 'Support used for single-instance and scripting interface, Unix only'
)
option('with-libproxy', type: 'boolean',
description: 'Support for getting proxy information, Unix only'
)
option('with-libnotify', type: 'boolean',
description: 'Support for freedesktop notifications, Unix only'
)
option('with-libcanberra', type: 'boolean',
description: 'Support for sound alerts, Unix only'
)
option('with-theme-manager', type: 'boolean', value: false,
description: 'Utility to help manage themes, requires mono/.net'
)
# Plugins
option('with-checksum', type: 'boolean',
description: 'DCC checksum plugin'
)
option('with-exec', type: 'boolean',
description: '/exec plugin, Windows only'
)
option('with-fishlim', type: 'boolean',
description: 'Fish encryption plugin, requires openssl'
)
option('with-lua', type: 'string', value: 'luajit',
description: 'Lua scripting plugin, value is pkg-config name to use or "false"'
)
option('with-perl', type: 'boolean',
description: 'Perl scripting plugin'
)
option('with-python', type: 'string', value: 'python3',
description: 'Python scripting plugin. value is pkg-config name to use or "false"'
)
option('with-sysinfo', type: 'boolean',
description: 'System information plugin, requires libpci on Unix'
)
option('with-upd', type: 'boolean',
description: 'Update plugin, Windows only'
)
option('with-winamp', type: 'boolean',
description: 'Winamp plugin, Windows only'
)

24
meson_post_install.py Normal file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = os.path.join(prefix, 'share')
with_thememan = sys.argv[1] == 'true'
# Packaging tools define DESTDIR and this isn't needed for them
if 'DESTDIR' not in os.environ:
print('Updating icon cache...')
subprocess.call(['gtk-update-icon-cache', '-qtf',
os.path.join(datadir, 'icons', 'hicolor')])
print('Updating desktop database...')
subprocess.call(['update-desktop-database', '-q',
os.path.join(datadir, 'applications')])
if with_thememan:
print('Updating mime database...')
subprocess.call(['update-mime-database',
os.path.join(datadir, 'mime')])

View File

@@ -1,29 +0,0 @@
if DO_LUA
lua = lua
endif
if DO_PYTHON
pythondir = python
endif
if DO_PERL
perldir = perl
endif
if DO_DOAT
doatdir = doat
endif
if DO_FISHLIM
fishlimdir = fishlim
endif
if DO_CHECKSUM
checksumdir = checksum
endif
if DO_SYSINFO
sysinfodir = sysinfo
endif
SUBDIRS = $(lua) $(pythondir) $(perldir) $(checksumdir) $(doatdir) $(fishlimdir) $(sysinfodir)

View File

@@ -1,8 +0,0 @@
libdir = $(hexchatlibdir)
lib_LTLIBRARIES = checksum.la
checksum_la_SOURCES = checksum.c
checksum_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
checksum_la_LIBADD = $(GLIB_LIBS)
checksum_la_CPPFLAGS = -I$(top_srcdir)/src/common
checksum_la_CFLAGS = $(GLIB_CFLAGS)

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -40,7 +40,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@@ -0,0 +1,6 @@
shared_module('checksum', 'checksum.c',
dependencies: [libgio_dep, hexchat_plugin_dep],
install: true,
install_dir: plugindir,
name_prefix: '',
)

View File

@@ -1,9 +0,0 @@
libdir = $(hexchatlibdir)
lib_LTLIBRARIES = doat.la
doat_la_SOURCES = doat.c
doat_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
doat_la_LIBADD = $(GLIB_LIBS)
doat_la_CPPFLAGS = -I$(top_srcdir)/src/common
doat_la_CFLAGS = $(GLIB_CFLAGS)

View File

@@ -1,92 +0,0 @@
/* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING or http://lwsitu.com/xchat/COPYING
* for more details. */
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <glib.h>
#include "hexchat-plugin.h"
static hexchat_plugin *ph;
static int
parse_command( char *word[], char *word_eol[], void *userdata ) {
char *channel = NULL, *server = NULL, *token = NULL;
/* char *save_ptr1 = NULL;*/
char *str1 = NULL;
char *delimiter = NULL;
hexchat_context *ctx = NULL;
if( word[2] != NULL && word[3] != NULL ) {
for( str1 = word[2]; ; str1 = NULL ) {
/* token = strtok_r( str1, ",", &save_ptr1 );*/
token = strtok( str1, "," );
/* printf( "token: %s\n", token );*/
if( token == NULL ) {
break;
}
channel = g_strdup( token );
delimiter = strchr( channel, '/' );
server = NULL;
if( delimiter != NULL ) {
*delimiter = '\0';
if( strlen( delimiter + 1 ) > 0 ) {
server = g_strdup( delimiter + 1 );
}
}
/* /Network form */
if( strlen( channel ) == 0 ) {
g_free( channel );
channel = NULL;
}
/* printf( "channel[%s] server[%s]\n", channel, server );*/
if( (ctx = hexchat_find_context( ph, server, channel ) ) != NULL ) {
if( hexchat_set_context( ph, ctx ) ) {
hexchat_command( ph, word_eol[3] );
}
}
g_free( channel );
g_free( server );
}
}
return HEXCHAT_EAT_HEXCHAT;
}
int
hexchat_plugin_init( hexchat_plugin * plugin_handle, char **plugin_name,
char **plugin_desc, char **plugin_version, char *arg ) {
ph = plugin_handle;
*plugin_name = "Do At";
*plugin_version = "1.0001";
*plugin_desc = "Perform an arbitrary command on multiple channels";
hexchat_hook_command( ph, "doat", HEXCHAT_PRI_NORM, parse_command, "DOAT [channel,list,/network] [command], perform a command on multiple contexts", NULL );
hexchat_print (ph, "Do At plugin loaded\n");
return 1;
}
int
hexchat_plugin_deinit (void)
{
hexchat_print (ph, "Do At plugin unloaded\n");
return 1;
}

View File

@@ -1,3 +0,0 @@
EXPORTS
hexchat_plugin_init
hexchat_plugin_deinit

View File

@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4980AF24-9D42-427D-A8E6-0DF3B97C455D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>doat</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\win32\hexchat.props" />
<PropertyGroup>
<TargetName>hcdoat</TargetName>
<OutDir>$(HexChatRel)plugins\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(HexChatLib);$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(HexChatLib);$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="doat.c" />
</ItemGroup>
<ItemGroup>
<None Include="doat.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="doat.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="doat.def">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;EXEC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;EXEC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -38,7 +38,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;EXEC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;EXEC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

5
plugins/exec/meson.build Normal file
View File

@@ -0,0 +1,5 @@
shared_module('exec', 'exec.c',
dependencies: hexchat_plugin_dep,
install: true,
install_dir: plugindir
)

View File

@@ -1,10 +0,0 @@
EXTRA_DIST = LICENSE fish.h irc.h keystore.h plugin_hexchat.h dh1080.h
libdir = $(hexchatlibdir)
lib_LTLIBRARIES = fishlim.la
fishlim_la_SOURCES = fish.c irc.c keystore.c plugin_hexchat.c dh1080.c
fishlim_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
fishlim_la_LIBADD = $(GLIB_LIBS) $(OPENSSL_LIBS)
fishlim_la_CPPFLAGS = -I$(top_srcdir)/src/common
fishlim_la_CFLAGS = $(GLIB_CFLAGS) $(OPENSSL_CFLAGS)

View File

@@ -26,6 +26,7 @@
* to base64 for final use with blowfish.
*/
#include "config.h"
#include "dh1080.h"
#include <openssl/bn.h>
@@ -64,12 +65,23 @@ dh1080_init (void)
if ((g_dh = DH_new()))
{
int codes;
BIGNUM *p, *g;
g_dh->p = BN_bin2bn (prime1080, DH1080_PRIME_BYTES, NULL);
g_dh->g = BN_new ();
p = BN_bin2bn (prime1080, DH1080_PRIME_BYTES, NULL);
g = BN_new ();
g_assert (g_dh->p != NULL && g_dh->g != NULL);
BN_set_word(g_dh->g, 2);
if (p == NULL || g == NULL)
return 1;
BN_set_word (g, 2);
#ifndef HAVE_DH_SET0_PQG
g_dh->p = p;
g_dh->g = g;
#else
if (!DH_set0_pqg (g_dh, p, NULL, g))
return 1;
#endif
if (DH_check (g_dh, &codes))
return codes == 0;
@@ -136,6 +148,7 @@ dh1080_generate_key (char **priv_key, char **pub_key)
guchar buf[DH1080_PRIME_BYTES];
int len;
DH *dh;
const BIGNUM *dh_priv_key, *dh_pub_key;
g_assert (priv_key != NULL);
g_assert (pub_key != NULL);
@@ -150,12 +163,19 @@ dh1080_generate_key (char **priv_key, char **pub_key)
return 0;
}
#ifndef HAVE_DH_GET0_KEY
dh_pub_key = dh->pub_key;
dh_priv_key = dh->priv_key;
#else
DH_get0_key (dh, &dh_pub_key, &dh_priv_key);
#endif
MEMZERO (buf);
len = BN_bn2bin (dh->priv_key, buf);
len = BN_bn2bin (dh_priv_key, buf);
*priv_key = dh1080_encode_b64 (buf, len);
MEMZERO (buf);
len = BN_bn2bin(dh->pub_key, buf);
len = BN_bn2bin (dh_pub_key, buf);
*pub_key = dh1080_encode_b64 (buf, len);
OPENSSL_cleanse (buf, sizeof (buf));
@@ -169,6 +189,7 @@ dh1080_compute_key (const char *priv_key, const char *pub_key, char **secret_key
char *pub_key_data;
gsize pub_key_len;
BIGNUM *pk;
BIGNUM *temp_pub_key = BN_new();
DH *dh;
g_assert (secret_key != NULL);
@@ -190,9 +211,15 @@ dh1080_compute_key (const char *priv_key, const char *pub_key, char **secret_key
char *priv_key_data;
gsize priv_key_len;
int shared_len;
BIGNUM *priv_key_num;
priv_key_data = dh1080_decode_b64 (priv_key, &priv_key_len);
dh->priv_key = BN_bin2bn(priv_key_data, priv_key_len, NULL);
priv_key_num = BN_bin2bn(priv_key_data, priv_key_len, NULL);
#ifndef HAVE_DH_SET0_KEY
dh->priv_key = priv_key_num;
#else
DH_set0_key (dh, temp_pub_key, priv_key_num);
#endif
shared_len = DH_compute_key (shared_key, pk, dh);
SHA256(shared_key, shared_len, sha256);

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FISHLIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;FISHLIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -40,7 +40,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;FISHLIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;FISHLIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@@ -177,7 +177,9 @@ static gboolean save_keystore(GKeyFile *keyfile) {
#if !GLIB_CHECK_VERSION(2,40,0)
ok = keyfile_save_to_file (keyfile, filename);
#else
G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* Hide false positive */
ok = g_key_file_save_to_file (keyfile, filename, NULL);
G_GNUC_END_IGNORE_DEPRECATIONS
#endif
g_free (filename);

View File

@@ -0,0 +1,18 @@
if not libssl_dep.found()
error('fish plugin requires openssl')
endif
fishlim_sources = [
'dh1080.c',
'fish.c',
'irc.c',
'keystore.c',
'plugin_hexchat.c'
]
shared_module('fishlim', fishlim_sources,
dependencies: [libgio_dep, hexchat_plugin_dep, libssl_dep],
install: true,
install_dir: plugindir,
name_prefix: '',
)

View File

@@ -260,7 +260,7 @@ static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
char *pub_key;
if (cbc) {
hexchat_print(ph, "Recieved key exchange for CBC mode which is not supported.");
hexchat_print(ph, "Received key exchange for CBC mode which is not supported.");
goto cleanup;
}
@@ -280,12 +280,12 @@ static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
g_free(sender_lower);
if (cbc) {
hexchat_print(ph, "Recieved key exchange for CBC mode which is not supported.");
hexchat_print(ph, "Received key exchange for CBC mode which is not supported.");
goto cleanup;
}
if (!priv_key) {
hexchat_printf(ph, "Recieved a key exchange response for unknown user: %s", sender);
hexchat_printf(ph, "Received a key exchange response for unknown user: %s", sender);
goto cleanup;
}
} else {

View File

@@ -1,9 +0,0 @@
libdir = $(hexchatlibdir)
lib_LTLIBRARIES = lua.la
lua_la_SOURCES = lua.c
lua_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
lua_la_LIBADD = $(LUA_LIBS) $(GLIB_LIBS)
lua_la_CPPFLAGS = -I$(top_srcdir)/src/common
lua_la_CFLAGS = $(GLIB_CFLAGS) $(LUA_CFLAGS)

View File

@@ -1361,16 +1361,6 @@ static script_info *create_script(char const *file)
return info;
}
static void load_script(char const *file)
{
script_info *info = create_script(file);
if(info)
{
g_ptr_array_add(scripts, info);
check_deferred(info);
}
}
static script_info *get_script_by_file(char const *filename)
{
char const *expanded = expand_path(filename);
@@ -1387,6 +1377,26 @@ static script_info *get_script_by_file(char const *filename)
return NULL;
}
static int load_script(char const *file)
{
script_info *info = get_script_by_file(file);
if (info != NULL)
{
hexchat_print(ph, "Lua script is already loaded");
return 0;
}
info = create_script(file);
if (info)
{
g_ptr_array_add(scripts, info);
check_deferred(info);
}
return 1;
}
static int unload_script(char const *filename)
{
script_info *script = get_script_by_file(filename);
@@ -1685,8 +1695,17 @@ static int command_lua(char *word[], char *word_eol[], void *userdata)
return HEXCHAT_EAT_ALL;
}
/* Reinitialization safegaurd */
static int initialized = 0;
G_MODULE_EXPORT int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **name, char **description, char **version, char *arg)
{
if(initialized != 0)
{
hexchat_print(plugin_handle, "Lua interface already loaded\n");
return 0;
}
if (g_str_has_prefix(LUA_VERSION, "Lua "))
{
strcat(plugin_version, "/");
@@ -1698,6 +1717,7 @@ G_MODULE_EXPORT int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **na
*version = plugin_version;
ph = plugin_handle;
initialized = 1;
hexchat_hook_command(ph, "", HEXCHAT_PRI_NORM, command_console_exec, NULL, NULL);
hexchat_hook_command(ph, "LOAD", HEXCHAT_PRI_NORM, command_load, NULL, NULL);

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(LuaInclude);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -39,7 +39,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(LuaInclude);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

12
plugins/lua/meson.build Normal file
View File

@@ -0,0 +1,12 @@
if cc.get_id() == 'msvc'
lua_dep = cc.find_library('lua51')
else
lua_dep = dependency(get_option('with-lua'))
endif
shared_module('lua', 'lua.c',
dependencies: [libgio_dep, hexchat_plugin_dep, lua_dep],
install: true,
install_dir: plugindir,
name_prefix: '',
)

39
plugins/meson.build Normal file
View File

@@ -0,0 +1,39 @@
plugindir = join_paths(get_option('libdir'), 'hexchat/plugins')
if host_machine.system() == 'windows'
if get_option('with-exec')
subdir('exec')
endif
if get_option('with-upd')
subdir('upd')
endif
if get_option('with-winamp')
subdir('winamp')
endif
endif
if get_option('with-checksum')
subdir('checksum')
endif
if get_option('with-fishlim')
subdir('fishlim')
endif
if get_option('with-lua') != 'false'
subdir('lua')
endif
if get_option('with-perl')
subdir('perl')
endif
if get_option('with-python') != 'false'
subdir('python')
endif
if get_option('with-sysinfo')
subdir('sysinfo')
endif

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -40,7 +40,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@@ -1,20 +0,0 @@
EXTRA_DIST=generate_header lib/HexChat.pm lib/Xchat.pm lib/HexChat/Embed.pm lib/HexChat/List/Network.pm \
lib/HexChat/List/Network/Entry.pm lib/HexChat/List/Network/AutoJoin.pm lib/IRC.pm
libdir = $(hexchatlibdir)
lib_LTLIBRARIES = perl.la
perl_la_SOURCES = perl.c
perl_la_LDFLAGS = $(PERL_LDFLAGS) $(PLUGIN_LDFLAGS) -module
perl_la_LIBADD = $(GLIB_LIBS)
perl_la_CPPFLAGS = -I$(top_srcdir)/src/common
perl_la_CFLAGS = $(PERL_CFLAGS) $(GLIB_CFLAGS)
BUILT_SOURCES = hexchat.pm.h irc.pm.h
CLEANFILES = $(BUILT_SOURCES)
hexchat.pm.h irc.pm.h: lib/HexChat.pm lib/Xchat.pm lib/HexChat/Embed.pm \
lib/HexChat/List/Network.pm lib/HexChat/List/Network/Entry.pm \
lib/HexChat/List/Network/AutoJoin.pm lib/IRC.pm
cd $(srcdir); perl generate_header

29
plugins/perl/generate_header.py Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env python3
import sys
from os.path import basename
out_file = sys.argv[1]
in_files = sys.argv[2:]
def escape_perl(file):
ret = ''
for line in file:
# Escape " and \, strip empty space, shove in C strings.
ret += '"' + line.strip().replace('\\', '\\\\').replace('"', '\\"') + '\\n"\n'
return ret
with open(out_file, 'w') as o:
o.write('"BEGIN {\\n"\n')
for in_file in in_files:
o.write("\"$INC{{'{}'}} = 'Compiled into the plugin.';\\n\"\n".format(basename(in_file)))
o.write('"}\\n"\n')
for in_file in in_files:
o.write('"{\\n"\n')
o.write('"#line 1 \\"{}\\"\\n"\n'.format(basename(in_file)))
with open(in_file) as i:
o.write(escape_perl(i))
o.write('"}\\n"\n')

83
plugins/perl/meson.build Normal file
View File

@@ -0,0 +1,83 @@
generate_perl_header = find_program('generate_header.py')
hexchat_perl_module = custom_target('hexchat-perl-header',
input: [
'lib/HexChat.pm',
'lib/Xchat.pm',
'lib/HexChat/Embed.pm',
'lib/HexChat/List/Network.pm',
'lib/HexChat/List/Network/Entry.pm',
'lib/HexChat/List/Network/AutoJoin.pm',
],
output: 'hexchat.pm.h',
command: [generate_perl_header, '@OUTPUT@', '@INPUT@']
)
irc_perl_module = custom_target('irc-perl-header',
input: 'lib/IRC.pm',
output: 'irc.pm.h',
command: [generate_perl_header, '@OUTPUT@', '@INPUT@']
)
perl = find_program('perl')
ret = run_command([perl, '-MExtUtils::Embed', '-e', 'ccopts'])
if ret.returncode() != 0
error('perl: Failed to get cflags')
endif
perl_cflags = []
foreach flag : ret.stdout().strip().split(' ')
if flag.startswith('-I') or flag.startswith('-D')
perl_cflags += flag
endif
endforeach
ret = run_command([perl, '-MExtUtils::Embed', '-e', 'ldopts'])
if ret.returncode() != 0
error('perl: Failed to get ldflags')
endif
perl_ldflags = []
perl_rpath = ''
foreach flag : ret.stdout().strip().split(' ')
if flag.startswith('-L') or flag.startswith('-l')
perl_ldflags += flag
endif
if flag.startswith('-Wl,-rpath,')
# Install rpath
split = flag.split(',')
perl_rpath = split[split.length() - 1]
# For in tree
perl_ldflags += flag
endif
endforeach
perl_cflags += [
# Perl has its own 'config.h' that we must override
# TODO: Just rename ours to something more unique.
'-include', meson.build_root() + '/config.h'
]
if not cc.links('''
#define PERL_NO_INLINE_FUNCTIONS
#include <EXTERN.h>
#include <perl.h>
int main(void) {
PerlInterpreter *my_perl = perl_alloc();
return 0;
}
''', args: perl_cflags + perl_ldflags)
error('found perl not suitable for plugin')
endif
shared_module('perl',
sources: ['perl.c', hexchat_perl_module, irc_perl_module],
dependencies: [libgio_dep, hexchat_plugin_dep],
c_args: perl_cflags,
link_args: perl_ldflags,
install: true,
install_dir: plugindir,
install_rpath: perl_rpath,
name_prefix: '',
)

View File

@@ -27,7 +27,7 @@
#ifdef ENABLE_NLS
#include <locale.h>
#endif
#ifdef WIN32
#ifdef G_OS_WIN32
#include <windows.h>
#include <stdbool.h>
#else
@@ -44,7 +44,7 @@ static hexchat_plugin *ph; /* plugin handle */
static int perl_load_file (char *script_name);
#ifdef WIN32
#ifdef G_OS_WIN32
/* STRINGIFY is from perl's CORE/config.h */
#ifndef PERL_REQUIRED_VERSION
#define PERL_REQUIRED_VERSION STRINGIFY(PERL_REVISION) "." STRINGIFY(PERL_VERSION)
@@ -75,7 +75,7 @@ thread_mbox (char *str)
/* leave this before XSUB.h, to avoid readdir() being redefined */
#ifdef WIN32
#ifdef G_OS_WIN32
static void
perl_auto_load_from_path (const char *path)
{
@@ -130,7 +130,7 @@ perl_auto_load (void *unused)
{
const char *xdir;
char *sub_dir;
#ifdef WIN32
#ifdef G_OS_WIN32
int copied = 0;
char *slash = NULL;
#endif
@@ -1019,7 +1019,7 @@ XS (XS_HexChat_hook_fd)
package = ST (4);
data = NULL;
#ifdef WIN32
#ifdef G_OS_WIN32
if ((flags & HEXCHAT_FD_NOTSOCKET) == 0) {
/* this _get_osfhandle if from win32iop.h in the perl distribution,
* not the one provided by Windows
@@ -1434,7 +1434,7 @@ perl_init (void)
static int
perl_load_file (char *filename)
{
#ifdef WIN32
#ifdef G_OS_WIN32
static HMODULE lib = NULL;
if (!lib) {

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(HexChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -49,7 +49,7 @@ move hexchat.pm.h "$(IntDir)"</Command>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(HexChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@@ -1,9 +0,0 @@
libdir = $(hexchatlibdir)
lib_LTLIBRARIES = python.la
python_la_SOURCES = python.c
python_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
python_la_LIBADD = $(PYTHON_LIBS) $(GLIB_LIBS)
python_la_CPPFLAGS = -I$(top_srcdir)/src/common $(PYTHON_CPPFLAGS)
python_la_CFLAGS = $(GLIB_CFLAGS)

View File

@@ -0,0 +1,13 @@
python_opt = get_option('with-python')
if python_opt.startswith('python3')
python_dep = dependency(python_opt, version: '>= 3.3')
else
python_dep = dependency(python_opt, version: '>= 2.7')
endif
shared_module('python', 'python.c',
dependencies: [libgio_dep, hexchat_plugin_dep, python_dep],
install: true,
install_dir: plugindir,
name_prefix: '',
)

View File

@@ -59,7 +59,7 @@
#include <stdlib.h>
#include <sys/types.h>
#ifdef WIN32
#ifdef G_OS_WIN32
#include <direct.h>
#else
#include <unistd.h>
@@ -69,6 +69,8 @@
#include "hexchat-plugin.h"
#undef _POSIX_C_SOURCE /* Avoid warnings from /usr/include/features.h */
#undef _XOPEN_SOURCE
#undef HAVE_MEMRCHR /* Avoid redefinition in Python.h */
#undef HAVE_STRINGS_H
#include <Python.h>
#include <structmember.h>
#include <pythread.h>
@@ -104,7 +106,7 @@
#define PyUnicode_FromString PyString_FromString
#define PyUnicode_AsUTF8 PyString_AsString
#ifdef WIN32
#ifdef G_OS_WIN32
#undef WITH_THREAD
#endif
#endif
@@ -568,7 +570,7 @@ Callback_Server(char *word[], char *word_eol[], hexchat_event_attrs *attrs, void
PyObject *retobj;
PyObject *word_list, *word_eol_list;
PyObject *attributes;
int ret = 0;
int ret = HEXCHAT_EAT_NONE;
PyObject *plugin;
plugin = hook->plugin;
@@ -577,13 +579,13 @@ Callback_Server(char *word[], char *word_eol[], hexchat_event_attrs *attrs, void
word_list = Util_BuildList(word);
if (word_list == NULL) {
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
word_eol_list = Util_BuildList(word_eol);
if (word_eol_list == NULL) {
Py_DECREF(word_list);
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
attributes = Attribute_New(attrs);
@@ -619,7 +621,7 @@ Callback_Command(char *word[], char *word_eol[], void *userdata)
Hook *hook = (Hook *) userdata;
PyObject *retobj;
PyObject *word_list, *word_eol_list;
int ret = 0;
int ret = HEXCHAT_EAT_NONE;
PyObject *plugin;
plugin = hook->plugin;
@@ -628,13 +630,13 @@ Callback_Command(char *word[], char *word_eol[], void *userdata)
word_list = Util_BuildList(word);
if (word_list == NULL) {
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
word_eol_list = Util_BuildList(word_eol);
if (word_eol_list == NULL) {
Py_DECREF(word_list);
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
retobj = PyObject_CallFunction(hook->callback, "(OOO)", word_list,
@@ -665,7 +667,7 @@ Callback_Print_Attrs(char *word[], hexchat_event_attrs *attrs, void *userdata)
PyObject *word_list;
PyObject *word_eol_list;
PyObject *attributes;
int ret = 0;
int ret = HEXCHAT_EAT_NONE;
PyObject *plugin;
plugin = hook->plugin;
@@ -674,13 +676,13 @@ Callback_Print_Attrs(char *word[], hexchat_event_attrs *attrs, void *userdata)
word_list = Util_BuildList(word);
if (word_list == NULL) {
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
word_eol_list = Util_BuildEOLList(word);
if (word_eol_list == NULL) {
Py_DECREF(word_list);
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
attributes = Attribute_New(attrs);
@@ -714,7 +716,7 @@ Callback_Print(char *word[], void *userdata)
PyObject *retobj;
PyObject *word_list;
PyObject *word_eol_list;
int ret = 0;
int ret = HEXCHAT_EAT_NONE;
PyObject *plugin;
plugin = hook->plugin;
@@ -723,13 +725,13 @@ Callback_Print(char *word[], void *userdata)
word_list = Util_BuildList(word);
if (word_list == NULL) {
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
word_eol_list = Util_BuildEOLList(word);
if (word_eol_list == NULL) {
Py_DECREF(word_list);
END_PLUGIN(plugin);
return 0;
return HEXCHAT_EAT_NONE;
}
retobj = PyObject_CallFunction(hook->callback, "(OOO)", word_list,
@@ -788,7 +790,7 @@ static int
Callback_ThreadTimer(void *userdata)
{
RELEASE_XCHAT_LOCK();
#ifndef WIN32
#ifndef G_OS_WIN32
usleep(1);
#endif
ACQUIRE_XCHAT_LOCK();
@@ -1528,7 +1530,7 @@ Plugin_New(char *filename, PyObject *xcoobj)
PySys_SetObject("stderr", xcoobj);
if (filename) {
#ifdef WIN32
#ifdef G_OS_WIN32
char *file;
if (!g_file_get_contents_utf8(filename, &file, NULL, NULL)) {
hexchat_printf(ph, "Can't open file %s: %s\n",
@@ -2508,9 +2510,9 @@ IInterp_Cmd(char *word[], char *word_eol[], void *userdata)
if (channel && channel[0] == '>' && strcmp(channel, ">>python<<") == 0) {
hexchat_printf(ph, ">>> %s\n", word_eol[1]);
IInterp_Exec(word_eol[1]);
return 1;
return HEXCHAT_EAT_HEXCHAT;
}
return 0;
return HEXCHAT_EAT_NONE;
}

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(Python2Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -40,7 +40,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(Python2Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -40,7 +40,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@@ -1,17 +0,0 @@
libdir = $(hexchatlibdir)
sources = sysinfo.c format.c shared/df.c
if PLATFORM_OSX
sources += osx/backend.m
else
sources += unix/backend.c unix/match.c unix/parse.c unix/pci.c
endif
EXTRA_DIST = osx unix win32 shared format.h sysinfo.h sysinfo-backend.h
lib_LTLIBRARIES = sysinfo.la
sysinfo_la_SOURCES = $(sources)
sysinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
sysinfo_la_LIBADD = $(LIBPCI_LIBS) $(GLIB_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/src/common -I$(srcdir)/shared $(LIBPCI_CFLAGS) $(GLIB_CFLAGS)

View File

@@ -74,7 +74,7 @@ sysinfo_format_disk (guint64 total, guint64 free)
char *total_fmt, *free_fmt, *used_fmt, *ret;
GFormatSizeFlags format_flags = G_FORMAT_SIZE_DEFAULT;
#ifdef WIN32 /* Windows uses IEC size (with SI format) */
#ifdef G_OS_WIN32 /* Windows uses IEC size (with SI format) */
format_flags = G_FORMAT_SIZE_IEC_UNITS;
#endif

View File

@@ -0,0 +1,53 @@
sysinfo_sources = [
'format.c',
'sysinfo.c',
]
sysinfo_deps = [
libgio_dep,
hexchat_plugin_dep
]
sysinfo_includes = []
sysinfo_cargs = []
system = host_machine.system()
if system == 'linux' or system == 'darwin'
sysinfo_includes += 'shared'
sysinfo_sources += [
'shared/df.c'
]
if system == 'linux'
libpci = dependency('libpci')
sysinfo_deps += libpci
sysinfo_includes += 'unix'
sysinfo_sources += [
'unix/backend.c',
'unix/match.c',
'unix/parse.c',
'unix/pci.c',
]
picidsdir = libpci.get_pkgconfig_variable('idsdir')
pciids = join_paths(picidsdir, 'pci.ids')
sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
elif system == 'darwin'
add_languages('objc')
sysinfo_sources += 'osx/backend.m'
endif
elif system == 'windows'
sysinfo_sources += 'win32/backend.c'
else
error('sysinfo: Unknown system?')
endif
shared_module('sysinfo', sysinfo_sources,
dependencies: sysinfo_deps,
include_directories: include_directories(sysinfo_includes),
c_args: sysinfo_cargs,
install: true,
install_dir: plugindir,
name_prefix: '',
)

View File

@@ -133,16 +133,6 @@ print_info (char *info, gboolean announce)
hexchat_print (ph, _("Sysinfo: No info by that name\n"));
}
/*
* Simple wrapper for backend specific options.
* Ensure dest >= 512.
*/
int
sysinfo_get_str_pref (const char *pref, char *dest)
{
return hexchat_pluginpref_get_str (ph, pref, dest);
}
static gboolean
sysinfo_get_bool_pref (const char *pref, gboolean def)
{
@@ -184,24 +174,6 @@ sysinfo_set_pref (char *key, char *value)
sysinfo_set_pref_real (key, value, DEFAULT_ANNOUNCE);
return;
}
#ifdef HAVE_LIBPCI
else if (!strcmp (key, "pciids"))
{
if (value && value[0])
{
hexchat_pluginpref_set_str (ph, "pciids", value);
hexchat_printf (ph, _("Sysinfo: pciids is set to: %s\n"), value);
}
else
{
char buf[512];
if (hexchat_pluginpref_get_str (ph, "pciids", buf) == 0)
strcpy (buf, DEFAULT_PCIIDS);
hexchat_printf (ph, _("Sysinfo: pciids is set to: %s\n"), buf);
}
return;
}
#endif
else if (g_str_has_prefix (key, "hide_"))
{
int i;

View File

@@ -22,8 +22,5 @@
#define SYSINFO_H
#define bsize 1024
#define DEFAULT_PCIIDS "/usr/share/hwdata/pci.ids"
int sysinfo_get_str_pref (const char *name, char *dest);
#endif

View File

@@ -30,7 +30,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SYSINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;SYSINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(DepsRoot)\include;$(Glib);$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
</ClCompile>
@@ -43,7 +43,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;SYSINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;SYSINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(DepsRoot)\include;$(Glib);$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
</ClCompile>

View File

@@ -256,19 +256,7 @@ int xs_parse_distro(char *name)
FILE *fp = NULL;
char buffer[bsize], *pos = NULL;
if((fp = fopen("/etc/portage/make.conf", "r")) != NULL ||
(fp = fopen("/etc/make.conf", "r")) != NULL)
{
char keywords[bsize];
while(fgets(buffer, bsize, fp) != NULL)
find_match_char(buffer, "ACCEPT_KEYWORDS", keywords);
/* cppcheck-suppress uninitvar */
if (strstr(keywords, "\"") == NULL)
g_snprintf(buffer, bsize, "Gentoo Linux (stable)");
else
g_snprintf(buffer, bsize, "Gentoo Linux %s", keywords);
}
else if((fp = fopen("/etc/redhat-release", "r")) != NULL)
if((fp = fopen("/etc/redhat-release", "r")) != NULL)
fgets(buffer, bsize, fp);
else if((fp = fopen("/etc/mageia-release", "r")) != NULL)
fgets(buffer, bsize, fp);
@@ -302,6 +290,18 @@ int xs_parse_distro(char *name)
fgets(release, bsize, fp);
g_snprintf(buffer, bsize, "Debian %s", release);
}
else if((fp = fopen("/etc/portage/make.conf", "r")) != NULL ||
(fp = fopen("/etc/make.conf", "r")) != NULL)
{
char keywords[bsize];
while(fgets(buffer, bsize, fp) != NULL)
find_match_char(buffer, "ACCEPT_KEYWORDS", keywords);
/* cppcheck-suppress uninitvar */
if (strstr(keywords, "\"") == NULL)
g_snprintf(buffer, bsize, "Gentoo Linux (stable)");
else
g_snprintf(buffer, bsize, "Gentoo Linux %s", keywords);
}
else
g_snprintf(buffer, bsize, "Unknown Distro");
if(fp != NULL)

View File

@@ -122,11 +122,8 @@ void pci_find_fullname(char *fullname, char *vendor, char *device)
char *position;
int cardfound = 0;
FILE *fp;
if (!sysinfo_get_str_pref ("pciids", buffer))
strcpy (buffer, DEFAULT_PCIIDS);
fp = fopen (buffer, "r");
fp = fopen (PCIIDS_FILE, "r");
if(fp == NULL)
{
g_snprintf(fullname, bsize, "%s:%s", vendor, device);

8
plugins/upd/meson.build Normal file
View File

@@ -0,0 +1,8 @@
winsparkle_dep = cc.find_library('WinSparkle')
shared_module('upd', 'upd.c',
dependencies: [winsparkle_dep, hexchat_plugin_dep],
install: true,
install_dir: plugindir,
name_prefix: '',
)

View File

@@ -29,7 +29,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;UPD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;UPD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(WinSparklePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@@ -40,7 +40,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;UPD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;UPD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\common;$(WinSparklePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@@ -0,0 +1,6 @@
shared_module('winamp', 'winamp.c',
dependencies: [libgio_dep, hexchat_plugin_dep],
install: true,
install_dir: plugindir,
name_prefix: '',
)

View File

@@ -29,12 +29,12 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WINAMP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;WINAMP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;WINAMP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;WINAMP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>

View File

@@ -1,7 +0,0 @@
DOMAIN = $(PACKAGE)
subdir = po
top_builddir = ..
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
COPYRIGHT_HOLDER =
MSGID_BUGS_ADDRESS = www.hexchat.org
EXTRA_LOCALE_CATEGORIES =

1
po/meson.build Normal file
View File

@@ -0,0 +1 @@
i18n.gettext('hexchat', preset: 'glib')

View File

@@ -1,4 +1,4 @@
# HexChat [![Build Status](http://img.shields.io/travis/hexchat/hexchat.svg?style=flat)](https://travis-ci.org/hexchat/hexchat) [![Build Status](http://img.shields.io/jenkins/s/http/node1.sored.pl:8090/hexchat.svg?style=flat)](http://node1.sored.pl:8090/job/hexchat/)
# HexChat [![Build Status](http://img.shields.io/travis/hexchat/hexchat/master.svg?style=flat)](https://travis-ci.org/hexchat/hexchat) [![Build Status](https://img.shields.io/appveyor/ci/TingPing/hexchat/master.svg?style=flat)](https://ci.appveyor.com/project/TingPing/hexchat)
HexChat is an IRC client for Windows and UNIX-like operating systems.
See [IRCHelp.org](http://irchelp.org) for information about IRC in general.

View File

@@ -1,17 +0,0 @@
## Process this file with automake to produce Makefile.in
EXTRA_DIST = version-script
if DO_TEXT
text_fe = fe-text
endif
if DO_GTK
gtk_fe = fe-gtk
endif
SUBDIRS = common $(gtk_fe) $(text_fe)
if WITH_TM
SUBDIRS += htm
endif

View File

@@ -1,89 +0,0 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/m4/clang-analyze.am
noinst_LIBRARIES = libhexchatcommon.a
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)
EXTRA_DIST = \
cfgfiles.h \
chanopt.h \
ctcp.h \
dcc.h \
fe.h \
hexchat.h \
hexchatc.h \
hexchat-plugin.h \
history.h \
ignore.h \
inbound.h \
inet.h \
make-te.c \
marshalers.list \
modes.h \
network.h \
notify.h \
outbound.h \
plugin.h \
plugin-identd.h \
plugin-timer.h \
proto-irc.h \
server.h \
servlist.h \
ssl.h \
ssl.c \
text.h \
typedef.h \
textenums.h \
textevents.h \
textevents.in \
tree.h \
url.h \
userlist.h \
util.h
if USE_OPENSSL
ssl_c = ssl.c
endif
if USE_DBUS
dbusdir = dbus
libhexchatcommon_a_LIBADD = \
$(top_builddir)/src/common/dbus/dbus-*.$(OBJEXT)
endif
SUBDIRS = $(dbusdir) .
if DO_PLUGIN
include_HEADERS = hexchat-plugin.h
endif
noinst_PROGRAMS = make-te
libhexchatcommon_a_SOURCES = cfgfiles.c chanopt.c ctcp.c dcc.c hexchat.c \
history.c ignore.c inbound.c marshal.c modes.c network.c notify.c \
outbound.c plugin.c plugin-identd.c plugin-timer.c proto-irc.c server.c servlist.c \
$(ssl_c) text.c tree.c url.c userlist.c util.c
libhexchatcommon_a_CFLAGS = $(LIBPROXY_CFLAGS)
textenums.h: textevents.h
textevents.h: $(srcdir)/textevents.in make-te
$(AM_V_GEN) ./make-te < $< > $@ 2> textenums.h
marshal.h: $(srcdir)/marshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --header $< > $@
marshal.c: $(srcdir)/marshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --body $< > $@
if DO_STATIC_ANALYSIS
analyze_plists = $(libhexchatcommon_a_SOURCES:%.c=%.plist)
all-local: $(analyze_plists)
MOSTLYCLEANFILES = $(analyze_plists)
endif
BUILT_SOURCES = textenums.h textevents.h marshal.c marshal.h
CLEANFILES = $(BUILT_SOURCES)

View File

@@ -31,7 +31,7 @@
#include "hexchatc.h"
#include "typedef.h"
#ifdef WIN32
#ifdef G_OS_WIN32
#include <io.h>
#else
#include <unistd.h>
@@ -290,9 +290,9 @@ cfg_get_int (char *cfg, char *var)
char *xdir = NULL; /* utf-8 encoding */
#ifdef WIN32
#include <Windows.h>
#include <ShlObj.h>
#ifdef G_OS_WIN32
#include <windows.h>
#include <shlobj.h>
#endif
char *
@@ -300,7 +300,7 @@ get_xdir (void)
{
if (!xdir)
{
#ifndef WIN32
#ifndef G_OS_WIN32
xdir = g_build_filename (g_get_user_config_dir (), HEXCHAT_DIR, NULL);
#else
wchar_t* roaming_path_wide;
@@ -373,7 +373,7 @@ const struct prefs vars[] =
{"dcc_blocksize", P_OFFINT (hex_dcc_blocksize), TYPE_INT},
{"dcc_completed_dir", P_OFFSET (hex_dcc_completed_dir), TYPE_STR},
{"dcc_dir", P_OFFSET (hex_dcc_dir), TYPE_STR},
#ifndef WIN32
#ifndef G_OS_WIN32
{"dcc_fast_send", P_OFFINT (hex_dcc_fast_send), TYPE_BOOL},
#endif
{"dcc_global_max_get_cps", P_OFFINT (hex_dcc_global_max_get_cps), TYPE_INT},
@@ -527,7 +527,7 @@ const struct prefs vars[] =
{"irc_whois_front", P_OFFINT (hex_irc_whois_front), TYPE_BOOL},
{"net_auto_reconnect", P_OFFINT (hex_net_auto_reconnect), TYPE_BOOL},
#ifndef WIN32 /* FIXME fix reconnect crashes and remove this ifdef! */
#ifndef G_OS_WIN32 /* FIXME fix reconnect crashes and remove this ifdef! */
{"net_auto_reconnectonfail", P_OFFINT (hex_net_auto_reconnectonfail), TYPE_BOOL},
#endif
{"net_bind_host", P_OFFSET (hex_net_bind_host), TYPE_STR},
@@ -552,7 +552,7 @@ const struct prefs vars[] =
{"stamp_text", P_OFFINT (hex_stamp_text), TYPE_BOOL},
{"stamp_text_format", P_OFFSET (hex_stamp_text_format), TYPE_STR},
{"text_autocopy_color", P_OFFINT (hex_text_autocopy_color), TYPE_BOOL},
{"text_autocopy_color", P_OFFINT (hex_text_autocopy_color), TYPE_BOOL},
{"text_autocopy_stamp", P_OFFINT (hex_text_autocopy_stamp), TYPE_BOOL},
{"text_autocopy_text", P_OFFINT (hex_text_autocopy_text), TYPE_BOOL},
{"text_background", P_OFFSET (hex_text_background), TYPE_STR},
@@ -590,7 +590,7 @@ convert_with_fallback (char *str, const char *fallback)
{
char *utf;
#ifndef WIN32
#ifndef G_OS_WIN32
/* On non-Windows, g_get_user_name and g_get_real_name return a string in system locale, so convert it to utf-8. */
utf = g_locale_to_utf8 (str, -1, NULL, NULL, 0);
@@ -635,7 +635,7 @@ get_default_language (void)
if (!locale)
locale = g_getenv ("LANG") ? g_getenv ("LANG") : "en";
/* we might end up with something like "en_US.UTF-8". We will try to
/* we might end up with something like "en_US.UTF-8". We will try to
* search for "en_US"; if it fails we search for "en".
*/
lang = g_strdup (locale);
@@ -714,7 +714,7 @@ load_default_config(void)
char *username, *realname, *langs;
const char *font;
char *sp;
#ifdef WIN32
#ifdef G_OS_WIN32
wchar_t* roaming_path_wide;
gchar* roaming_path;
#endif
@@ -735,12 +735,12 @@ load_default_config(void)
memset (&prefs, 0, sizeof (struct hexchatprefs));
/* put in default values, anything left out is automatically zero */
/* BOOLEANS */
prefs.hex_away_show_once = 1;
prefs.hex_away_track = 1;
prefs.hex_dcc_auto_resume = 1;
#ifndef WIN32
#ifndef G_OS_WIN32
prefs.hex_dcc_fast_send = 1;
#endif
prefs.hex_gui_autoopen_chat = 1;
@@ -772,6 +772,7 @@ load_default_config(void)
prefs.hex_gui_ulist_icons = 1;
prefs.hex_gui_ulist_style = 1;
prefs.hex_gui_win_save = 1;
prefs.hex_input_filter_beep = 1;
prefs.hex_input_flash_hilight = 1;
prefs.hex_input_flash_priv = 1;
prefs.hex_input_tray_hilight = 1;
@@ -833,13 +834,13 @@ load_default_config(void)
prefs.hex_net_reconnect_delay = 10;
prefs.hex_notify_timeout = 15;
prefs.hex_text_max_indent = 256;
prefs.hex_text_max_lines = 500;
prefs.hex_text_max_lines = 5000;
prefs.hex_url_grabber_limit = 100; /* 0 means unlimited */
/* STRINGS */
strcpy (prefs.hex_away_reason, _("I'm busy"));
strcpy (prefs.hex_completion_suffix, ",");
#ifdef WIN32
#ifdef G_OS_WIN32
if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_Downloads, 0, NULL, &roaming_path_wide) != S_OK)
{
g_snprintf (prefs.hex_dcc_dir, sizeof (prefs.hex_dcc_dir), "%s\\downloads", get_xdir ());
@@ -917,7 +918,7 @@ make_config_dirs (void)
if (g_mkdir_with_parents (get_xdir (), 0700) != 0)
return -1;
buf = g_build_filename (get_xdir (), "addons", NULL);
if (g_mkdir (buf, 0700) != 0)
{
@@ -925,7 +926,7 @@ make_config_dirs (void)
return -1;
}
g_free (buf);
buf = g_build_filename (get_xdir (), HEXCHAT_SOUND_DIR, NULL);
if (g_mkdir (buf, 0700) != 0)
{
@@ -982,7 +983,7 @@ load_config (void)
i++;
}
while (vars[i].name);
g_free (cfg);
if (prefs.hex_gui_win_height < 138)
@@ -1008,7 +1009,7 @@ save_config (void)
config = default_file ();
new_config = g_strconcat (config, ".new", NULL);
fh = g_open (new_config, OFLAGS | O_TRUNC | O_WRONLY | O_CREAT, 0600);
if (fh == -1)
{
@@ -1022,7 +1023,7 @@ save_config (void)
g_free (new_config);
return 0;
}
i = 0;
do
{
@@ -1060,7 +1061,7 @@ save_config (void)
return 0;
}
#ifdef WIN32
#ifdef G_OS_WIN32
g_unlink (config); /* win32 can't rename to an existing file */
#endif
if (g_rename (new_config, config) == -1)

View File

@@ -27,7 +27,7 @@
#include <fcntl.h>
#include <errno.h>
#ifdef WIN32
#ifdef G_OS_WIN32
#include <io.h>
#else
#include <unistd.h>

View File

@@ -95,13 +95,13 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(HexChatLib);$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(HexChatLib);$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>

View File

@@ -20,7 +20,7 @@
#include <string.h>
#include <stdlib.h>
#ifndef WIN32
#ifndef G_OS_WIN32
#include <unistd.h>
#endif
@@ -138,7 +138,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
if (!g_ascii_strcasecmp (msg, "VERSION") && !prefs.hex_irc_hide_version)
{
#ifdef WIN32
#ifdef G_OS_WIN32
g_snprintf (outbuf, sizeof (outbuf), "VERSION HexChat "PACKAGE_VERSION" [x%d] / %s",
get_cpu_arch (), get_sys_str (1));
#else
@@ -172,7 +172,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
}
/* don't let IRCers specify path */
#ifdef WIN32
#ifdef G_OS_WIN32
if (strchr (word[5], '/') == NULL && strchr (word[5], '\\') == NULL)
#else
if (strchr (word[5], '/') == NULL)

View File

@@ -1,35 +0,0 @@
noinst_LIBRARIES = libhexchatdbus.a
libhexchatdbus_a_SOURCES = \
dbus-plugin.c \
dbus-plugin.h \
dbus-client.c \
dbus-client.h
EXTRA_DIST = \
remote-object.xml \
example.py \
org.hexchat.service.service.in
BUILT_SOURCES = \
remote-object-glue.h
CLEANFILES = $(BUILT_SOURCES)
AM_CPPFLAGS = -I$(top_srcdir)/src/common $(COMMON_CFLAGS) $(DBUS_CFLAGS)
noinst_PROGRAMS = example
example_SOURCES = example.c
example_LDADD = $(DBUS_LIBS) $(GLIB_LIBS)
remote-object-glue.h: remote-object.xml
$(AM_V_GEN) $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=remote_object --mode=glib-server --output=$@ $<
# Dbus service file
servicedir = $(DBUS_SERVICES_DIR)
service_in_files = org.hexchat.service.service.in
service_DATA = $(service_in_files:.service.in=.service)
# Rule to make the service file with bindir expanded
$(service_DATA): $(service_in_files) Makefile
@sed -e "s|\@bindir\@|$(bindir)|" $< > $@

View File

@@ -0,0 +1,44 @@
dbus_deps = [
dependency('dbus-glib-1')
]
dbus_sources = [
'dbus-plugin.c',
'dbus-client.c'
]
dbus_includes = [
include_directories('..'),
config_h_include
]
dbus_service_dir = join_paths(get_option('datadir'), 'dbus-1/services')
dbus_conf = configuration_data()
dbus_conf.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
configure_file(
input: 'org.hexchat.service.service.in',
output: 'org.hexchat.service.service',
configuration: dbus_conf,
install: true,
install_dir: dbus_service_dir
)
dbus_binding_tool = find_program('dbus-binding-tool')
dbus_remote_object = custom_target('remote-object-glue',
input: 'remote-object.xml',
output: 'remote-object-glue.h',
command: [dbus_binding_tool, '--prefix=remote_object', '--mode=glib-server',
'--output=@OUTPUT@', '@INPUT@']
)
hexchat_dbus = static_library('hexchatdbus',
sources: [dbus_remote_object, marshal] + dbus_sources,
dependencies: common_deps + dbus_deps,
include_directories: dbus_includes,
pic: true
)
hexchat_dbus_dep = declare_dependency(
link_with: hexchat_dbus
)

View File

@@ -23,6 +23,9 @@
* Jim Seymour (jseymour@LinxNet.com)
*/
#include "config.h"
#include <glib.h>
/* Required to make lseek use off64_t, but doesn't work on Windows */
#define _FILE_OFFSET_BITS 64
@@ -39,7 +42,7 @@
#define WANTDNS
#include "inet.h"
#ifdef WIN32
#ifdef G_OS_WIN32
#include <windows.h>
#include <io.h>
#else
@@ -59,7 +62,7 @@
#include "hexchatc.h"
/* Setting _FILE_OFFSET_BITS to 64 doesn't change lseek to use off64_t on Windows, so override lseek to the version that does */
#ifdef WIN32
#ifdef G_OS_WIN32
#define lseek _lseeki64
#endif
@@ -790,7 +793,7 @@ dcc_did_connect (GIOChannel *source, GIOCondition condition, struct DCC *dcc)
{
int er;
#ifdef WIN32
#ifdef G_OS_WIN32
if (condition & G_IO_ERR)
{
int len;
@@ -2452,7 +2455,7 @@ dcc_add_file (session *sess, char *file, guint64 size, int port, char *nick, gui
strcat (dcc->destfile, G_DIR_SEPARATOR_S);
if (prefs.hex_dcc_save_nick)
{
#ifdef WIN32
#ifdef G_OS_WIN32
char *t = strlen (dcc->destfile) + dcc->destfile;
strcpy (t, nick);
while (*t)

View File

@@ -406,7 +406,7 @@ int
hexchat_pluginpref_list (hexchat_plugin *ph,
char *dest);
#if !defined(PLUGIN_C) && defined(WIN32)
#if !defined(PLUGIN_C) && (defined(_WIN32) || defined(__CYGWIN__))
#ifndef HEXCHAT_PLUGIN_HANDLE
#define HEXCHAT_PLUGIN_HANDLE (ph)
#endif

View File

@@ -16,6 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <glib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -26,7 +29,7 @@
#define WANTSOCKET
#include "inet.h"
#ifdef WIN32
#ifdef G_OS_WIN32
#include <windows.h>
#else
#include <sys/wait.h>
@@ -126,11 +129,11 @@ lastact_update(session *sess)
int newidx = LACT_NONE;
int dia = (sess->type == SESS_DIALOG);
if (sess->nick_said)
if (sess->tab_state & TAB_STATE_NEW_HILIGHT)
newidx = dia? LACT_QUERY_HI: LACT_CHAN_HI;
else if (sess->msg_said)
else if (sess->tab_state & TAB_STATE_NEW_MSG)
newidx = dia? LACT_QUERY: LACT_CHAN;
else if (sess->new_data)
else if (sess->tab_state & TAB_STATE_NEW_DATA)
newidx = dia? LACT_QUERY: LACT_CHAN_DATA;
/* If already first at the right position, just return */
@@ -383,7 +386,7 @@ hexchat_reinit_timers (void)
notify_tag = fe_timeout_add_seconds (prefs.hex_notify_timeout,
notify_checklist, NULL);
}
else if (notify_tag != 0)
else if (!prefs.hex_notify_timeout && notify_tag != 0)
{
fe_timeout_remove (notify_tag);
notify_tag = 0;
@@ -394,7 +397,7 @@ hexchat_reinit_timers (void)
{
away_tag = fe_timeout_add_seconds (prefs.hex_away_timeout, away_check, NULL);
}
else if (away_tag != 0)
else if (!prefs.hex_away_track && away_tag != 0)
{
fe_timeout_remove (away_tag);
away_tag = 0;
@@ -405,7 +408,7 @@ hexchat_reinit_timers (void)
{
lag_check_update_tag = fe_timeout_add (500, hexchat_lag_check_update, NULL);
}
else if (lag_check_update_tag != 0)
else if (!prefs.hex_gui_lagometer && lag_check_update_tag != 0)
{
fe_timeout_remove (lag_check_update_tag);
lag_check_update_tag = 0;
@@ -417,7 +420,8 @@ hexchat_reinit_timers (void)
{
lag_check_tag = fe_timeout_add_seconds (30, hexchat_lag_check, NULL);
}
else if (lag_check_tag != 0)
else if ((!prefs.hex_net_ping_timeout && !prefs.hex_gui_lagometer)
&& lag_check_tag != 0)
{
fe_timeout_remove (lag_check_tag);
lag_check_tag = 0;
@@ -566,7 +570,7 @@ new_ircwindow (server *serv, char *name, int type, int focus)
static void
exec_notify_kill (session * sess)
{
#ifndef WIN32
#ifndef G_OS_WIN32
struct nbexec *re;
if (sess->running_exec != NULL)
{
@@ -810,7 +814,7 @@ xchat_init (void)
{
char buf[3068];
#ifdef WIN32
#ifdef G_OS_WIN32
WSADATA wsadata;
if (WSAStartup(0x0202, &wsadata) != 0)
@@ -840,7 +844,7 @@ xchat_init (void)
sigemptyset (&act.sa_mask);
sigaction (SIGUSR2, &act, NULL);
#else
#ifndef WIN32
#ifndef G_OS_WIN32
/* good enough for these old systems */
signal (SIGPIPE, SIG_IGN);
#endif
@@ -965,7 +969,7 @@ xchat_init (void)
fe_serverlist_open (NULL);
/* turned OFF via -a arg or by passing urls */
if (!arg_dont_autoconnect && !arg_urls)
if (!arg_dont_autoconnect && !arg_urls && !arg_url)
{
/* do any auto connects */
if (!servlist_have_auto ()) /* if no new windows open .. */
@@ -1018,7 +1022,7 @@ hexchat_exec (const char *cmd)
static void
set_locale (void)
{
#ifdef WIN32
#ifdef G_OS_WIN32
char hexchat_lang[13]; /* LC_ALL= plus 5 chars of hex_gui_lang and trailing \0 */
strcpy (hexchat_lang, "LC_ALL=");
@@ -1038,7 +1042,7 @@ main (int argc, char *argv[])
int i;
int ret;
#ifdef WIN32
#ifdef G_OS_WIN32
HRESULT coinit_result;
#endif
@@ -1104,7 +1108,7 @@ main (int argc, char *argv[])
libproxy_factory = px_proxy_factory_new();
#endif
#ifdef WIN32
#ifdef G_OS_WIN32
coinit_result = CoInitializeEx (NULL, COINIT_APARTMENTTHREADED);
if (SUCCEEDED (coinit_result))
{
@@ -1126,7 +1130,7 @@ main (int argc, char *argv[])
fe_message (buf, FE_MSG_ERROR);
}
#ifndef WIN32
#ifndef G_OS_WIN32
#ifndef __EMX__
/* OS/2 uses UID 0 all the time */
if (getuid () == 0)
@@ -1139,7 +1143,7 @@ main (int argc, char *argv[])
fe_main ();
#ifdef WIN32
#ifdef G_OS_WIN32
if (SUCCEEDED (coinit_result))
{
CoUninitialize ();
@@ -1150,7 +1154,7 @@ main (int argc, char *argv[])
px_proxy_factory_free(libproxy_factory);
#endif
#ifdef WIN32
#ifdef G_OS_WIN32
WSACleanup ();
#endif

View File

@@ -54,7 +54,7 @@
/* force a 32bit CMP.L */
#define WORDL(c0, c1, c2, c3) (guint32)(c0 | (c1 << 8) | (c2 << 16) | (c3 << 24))
#ifdef WIN32 /* for win32 */
#ifdef G_OS_WIN32 /* for win32 */
#define OFLAGS O_BINARY
#define sleep(t) Sleep(t*1000)
#include <direct.h>
@@ -352,6 +352,13 @@ typedef enum gtk_xtext_search_flags_e {
regexp = 16
} gtk_xtext_search_flags;
typedef enum {
TAB_STATE_NONE = 0,
TAB_STATE_NEW_DATA = (1 << 0),
TAB_STATE_NEW_MSG = (1 << 1),
TAB_STATE_NEW_HILIGHT = (1 << 2),
} tab_state_flags;
typedef struct session
{
/* Per-Channel Alerts */
@@ -406,16 +413,14 @@ typedef struct session
int lastact_idx; /* the sess_list_by_lastact[] index of the list we're in.
* For valid values, see defines of LACT_*. */
int new_data:1; /* new data avail? (purple tab) */
int nick_said:1; /* your nick mentioned? (blue tab) */
int msg_said:1; /* new msg available? (red tab) */
int ignore_date:1;
int ignore_mode:1;
int ignore_names:1;
int end_of_names:1;
int doing_who:1; /* /who sent on this channel */
int done_away_check:1; /* done checking for away status changes */
tab_state_flags tab_state;
tab_state_flags last_tab_state; /* before event is handled */
gtk_xtext_search_flags lastlog_flags;
void (*scrollback_replay_marklast) (struct session *sess);
} session;

View File

@@ -23,7 +23,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#ifdef WIN32
#ifdef G_OS_WIN32
#include <io.h>
#else
#include <unistd.h>

View File

@@ -23,7 +23,7 @@
#include <sys/types.h>
#include <time.h>
#ifdef WIN32
#ifdef G_OS_WIN32
#include <io.h>
#else
#include <unistd.h>
@@ -316,7 +316,7 @@ is_hilight (char *from, char *text, session *sess, server *serv)
g_free (text);
if (sess != current_tab)
{
sess->nick_said = TRUE;
sess->tab_state |= TAB_STATE_NEW_HILIGHT;
lastact_update (sess);
}
return 1;
@@ -373,14 +373,9 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
if (sess != current_tab)
{
if (fromme)
{
sess->msg_said = FALSE;
sess->new_data = TRUE;
} else
{
sess->msg_said = TRUE;
sess->new_data = FALSE;
}
sess->tab_state |= TAB_STATE_NEW_DATA;
else
sess->tab_state |= TAB_STATE_NEW_MSG;
lastact_update (sess);
}
@@ -448,8 +443,7 @@ inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
if (sess != current_tab)
{
sess->msg_said = TRUE;
sess->new_data = FALSE;
sess->tab_state |= TAB_STATE_NEW_MSG;
lastact_update (sess);
}

View File

@@ -22,7 +22,7 @@
#ifndef HEXCHAT_INET_H
#define HEXCHAT_INET_H
#ifndef WIN32
#ifndef G_OS_WIN32
#ifdef WANTSOCKET
#include <sys/types.h>

55
src/common/make-te.py Executable file
View File

@@ -0,0 +1,55 @@
#!/usr/bin/env python3
import sys
inf = open(sys.argv[1])
eventf = open(sys.argv[2], 'w')
enumsf = open(sys.argv[3], 'w')
enumsf.write(\
'''
/* this file is auto generated, edit textevents.in instead! */
enum
{
''')
eventf.write(\
'''
/* this file is auto generated, edit textevents.in instead! */
const struct text_event te[] = {
''')
try:
while True:
name = inf.readline().strip()
event_enum = inf.readline().strip()
event_help = inf.readline().strip()
event_str = inf.readline().strip()
args = inf.readline().strip()
translate = True
if args[0] == 'n':
args = int(args[1]) | 128
translate = False
else:
args = int(args)
if translate:
event_str = 'N_("%s")' %event_str
else:
event_str = '"%s"' %event_str
enumsf.write('\t%s,\n' %event_enum)
eventf.write('\n{"%s", %s, %u,\n%s},\n' %(
name, event_help, args, event_str,
))
inf.readline() # whitespace
except IndexError:
pass
enumsf.write('\tNUM_XP\n};\n')
eventf.write('};\n')

View File

@@ -28,7 +28,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -36,7 +36,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

116
src/common/meson.build Normal file
View File

@@ -0,0 +1,116 @@
common_sources = [
'cfgfiles.c',
'chanopt.c',
'ctcp.c',
'dcc.c',
'hexchat.c',
'history.c',
'ignore.c',
'inbound.c',
'modes.c',
'network.c',
'notify.c',
'outbound.c',
'plugin.c',
'plugin-identd.c',
'plugin-timer.c',
'proto-irc.c',
'server.c',
'servlist.c',
'text.c',
'tree.c',
'url.c',
'userlist.c',
'util.c'
]
common_deps = [
libgio_dep,
]
common_includes = [
config_h_include,
include_directories('.')
]
common_cflags = [
'-DHAVE_CONFIG_H',
]
if host_machine.system() == 'windows'
common_deps += [
cc.find_library('ws2_32'), # winsock
cc.find_library('winmm'), # playsound
cc.find_library('wbemuuid'), # sysinfo
]
common_sources += 'sysinfo/win32/backend.c'
common_includes += include_directories('sysinfo')
endif
marshal = gnome.genmarshal('marshal',
sources: 'marshalers.list',
prefix: '_hexchat_marshal',
internal: true
)
make_te = find_program('make-te.py')
textevents = custom_target('textevents',
input: 'textevents.in',
output: ['textevents.h', 'textenums.h'],
command: [make_te, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@']
)
# TODO:
# LOOKUPD
# SIGACTION
# HAVE_GTK_MAC
if get_option('with-ssl')
common_sources += 'ssl.c'
common_deps += libssl_dep
endif
if get_option('with-libproxy')
common_deps += dependency('libproxy-1.0')
endif
if get_option('with-libcanberra')
common_deps += dependency('libcanberra', version: '>= 0.22')
endif
if get_option('with-dbus')
subdir('dbus')
common_deps += hexchat_dbus_dep
common_includes += include_directories('dbus')
endif
if get_option('with-plugin')
common_deps += libgmodule_dep
common_cflags += '-DHEXCHATLIBDIR="@0@"'.format(join_paths(get_option('prefix'),
get_option('libdir'),
'hexchat/plugins'))
install_headers('hexchat-plugin.h')
endif
hexchat_common = static_library('hexchatcommon',
sources: [textevents] + marshal + common_sources,
include_directories: config_h_include,
dependencies: common_deps,
c_args: common_cflags,
pic: true
)
hexchat_common_dep = declare_dependency(
link_with: hexchat_common,
include_directories: common_includes,
compile_args: common_cflags,
dependencies: libgio_dep,
)
hexchat_plugin_dep = declare_dependency(
include_directories: common_includes,
compile_args: common_cflags,
)

View File

@@ -25,7 +25,7 @@
#include <stdio.h>
#include <glib.h>
#ifndef WIN32
#ifndef G_OS_WIN32
#include <unistd.h>
#endif

View File

@@ -24,7 +24,7 @@
#include <fcntl.h>
#include <time.h>
#ifdef WIN32
#ifdef G_OS_WIN32
#include <io.h>
#else
#include <unistd.h>

View File

@@ -28,7 +28,7 @@
#define WANTARPA
#include "inet.h"
#ifndef WIN32
#ifndef G_OS_WIN32
#include <sys/wait.h>
#include <unistd.h>
#endif
@@ -631,7 +631,7 @@ cmd_clear (struct session *sess, char *tbuf, char *word[], char *word_eol[])
while (list)
{
sess = list->data;
if (!sess->nick_said)
if (!(sess->tab_state & TAB_STATE_NEW_HILIGHT))
fe_text_clear (list->data, 0);
list = list->next;
}
@@ -1447,6 +1447,41 @@ cmd_dns (struct session *sess, char *tbuf, char *word[], char *word_eol[])
return FALSE;
}
static int
cmd_doat (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
GStrv channels;
guint i;
if (!word[2] || !*word[2] || !word[3] || !*word[3])
return FALSE;
channels = g_strsplit (word[2], ",", -1);
for (i = 0; channels[i] && *channels[i]; ++i)
{
char *chan = channels[i];
char *serv;
session *ctx;
/* Split channel and network, either may be empty */
if ((serv = strchr (chan, '/')))
{
*serv = '\0';
serv++;
if (!strlen (serv))
serv = NULL;
}
if (!strlen (chan))
chan = NULL;
if ((ctx = plugin_find_context (serv, chan, sess->server)))
handle_command (ctx, word_eol[3], FALSE);
}
g_strfreev (channels);
return TRUE;
}
static int
cmd_echo (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
@@ -1454,7 +1489,7 @@ cmd_echo (struct session *sess, char *tbuf, char *word[], char *word_eol[])
return TRUE;
}
#ifndef WIN32
#ifndef G_OS_WIN32
static void
exec_check_process (struct session *sess)
@@ -1682,6 +1717,25 @@ memrchr (const void *block, int c, size_t size)
}
#endif
static void
exec_print_line (session *sess, char *data, gssize len, gboolean tochannel)
{
char *valid;
exec_handle_colors (data, len);
valid = text_fixup_invalid_utf8 (data, len, NULL);
if (tochannel)
{
/* must turn off auto-completion temporarily */
const unsigned int old = prefs.hex_completion_auto;
prefs.hex_completion_auto = 0;
handle_multiline (sess, valid, FALSE, TRUE);
prefs.hex_completion_auto = old;
}
else
PrintText (sess, valid);
g_free (valid);
}
static gboolean
exec_data (GIOChannel *source, GIOCondition condition, struct nbexec *s)
{
@@ -1708,17 +1762,7 @@ exec_data (GIOChannel *source, GIOCondition condition, struct nbexec *s)
kill(s->childpid, SIGKILL);
if (len) {
buf[len] = '\0';
exec_handle_colors(buf, len);
if (s->tochannel)
{
/* must turn off auto-completion temporarily */
unsigned int old = prefs.hex_completion_auto;
prefs.hex_completion_auto = 0;
handle_multiline (s->sess, buf, FALSE, TRUE);
prefs.hex_completion_auto = old;
}
else
PrintText (s->sess, buf);
exec_print_line(s->sess, buf, len, s->tochannel);
}
g_free(buf);
waitpid (s->childpid, NULL, 0);
@@ -1747,11 +1791,7 @@ exec_data (GIOChannel *source, GIOCondition condition, struct nbexec *s)
s->buffill = 0;
if (len) {
exec_handle_colors (buf, len);
if (s->tochannel)
handle_multiline (s->sess, buf, FALSE, TRUE);
else
PrintText (s->sess, buf);
exec_print_line(s->sess, buf, len, s->tochannel);
}
g_free (buf);
@@ -3931,8 +3971,9 @@ const struct commands xc_cmds[] = {
N_("DEVOICE <nick>, removes voice status from the nick on the current channel (needs chanop)")},
{"DISCON", cmd_discon, 0, 0, 1, N_("DISCON, Disconnects from server")},
{"DNS", cmd_dns, 0, 0, 1, N_("DNS <nick|host|ip>, Resolves an IP or hostname")},
{"DOAT", cmd_doat, 0, 0, 1, N_("DOAT <channel,list,/network> <command>")},
{"ECHO", cmd_echo, 0, 0, 1, N_("ECHO <text>, Prints text locally")},
#ifndef WIN32
#ifndef G_OS_WIN32
{"EXEC", cmd_exec, 0, 0, 1,
N_("EXEC [-o] <command>, runs the command. If -o flag is used then output is sent to current channel, else is printed to current text box")},
#ifndef __EMX__

View File

@@ -146,7 +146,7 @@ identd_read_ready (GDataInputStream *in_stream, GAsyncResult *res, ident_info *i
if (!local || !remote || local > G_MAXUINT16 || remote > G_MAXUINT16)
{
g_strlcat (buf, "ERROR : INVALID-PORT\r\n", sizeof (buf));
g_debug ("Identd: Recieved invalid port");
g_debug ("Identd: Received invalid port");
}
else
{
@@ -154,7 +154,7 @@ identd_read_ready (GDataInputStream *in_stream, GAsyncResult *res, ident_info *i
if (!info->username)
{
g_strlcat (buf, "ERROR : NO-USER\r\n", sizeof (buf));
g_debug ("Identd: Recieved invalid local port");
g_debug ("Identd: Received invalid local port");
}
else
{

Some files were not shown because too many files have changed in this diff Show More