分页: 1 / 1

关于Gaim的编译和openq一点Hack

发表于 : 2005-12-25 13:16
id_sonic
openq有时候会崩溃大家都知道,可是昨天我的openq崩溃得特别平凡,于是干脆从新编译了gaim和openq,现在一次也没崩溃过。

编译 Gaim(1.5.0) 需要注意的是,它需要一些开发包才能支持声音或者以X环境为基础的磕睡功能等,这里我给出一个相关的软件包列表(当然对应的 dev 包安装了才能正常编译):

代码: 全选

ii  libao2                    0.8.5-1        Cross Platform Audio Output Librar 
ii  libaspell15               0.50.5-3       The GNU Aspell spell-checker runti 
ii  libatk1.0-0               1.6.1-3        The ATK accessibility toolkit 
ii  libaudiofile0             0.2.6-4        Open-source version of SGI's audio 
ii  libc6                     2.3.2.ds1-16   GNU C Library: Shared libraries an 
ii  libgcrypt11               1.2.0-4        LGPL Crypto library - runtime libr 
ii  libglib2.0-0              2.4.6-2        The GLib library of C routines 
ii  libgnutls11               1.0.16-7       GNU TLS library - runtime library 
ii  libgtk2.0-0               2.4.9-1        The GTK+ graphical user interface 
ii  libgtkspell0              2.0.7-1        a spell-checking addon for GTK's T 
ii  libice6                   4.3.0.dfsg.1-4 Inter-Client Exchange library 
ii  libpango1.0-0             1.4.1-2        Layout and rendering of internatio 
ii  libperl5.8                5.8.4-2        Shared Perl library. 
ii  libsm6                    4.3.0.dfsg.1-4 X Window System Session Management 
ii  libstartup-notification0  0.7-1          library for program launch feedbac 
ii  libx11-6                  4.3.0.dfsg.1-4 X Window System protocol client li 
ii  libxext6                  4.3.0.dfsg.1-4 X Window System miscellaneous exte 
ii  perl                      5.8.4-2        Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.8.4] 5.8.4-2        The Pathologically Eclectic Rubbis 
ii  xlibs                     4.3.0.dfsg.1-4 X Window System client libraries m
ii  libxss                    6.8.2
安装完以上包后编译出的 Gaim 信息:

代码: 全选

Gaim was compiled with the following:
Arguments to ./configure:  
Print debugging messages:  No
Binary relocation:  Enabled
Plugins:  Enabled
SSL:  Gaim was compiled with SSL support
GNUTLS:  Enabled
NSS:  Enabled
Tcl: Yes
Tk:  No
External libzephyr:  No
Zephyr uses Kerberos: No
AO:  Yes   #libao-dev 是必须的,如果没有   AO: No   没有声音
NAS Audio:  No
GtkSpell:  Enabled
XScreenSaver support:  Yes
X SM support:  Yes
这里可能你觉得 1.5.0 版本的声音文件 与 图标太老了,你可以下载 2.0 beta 把声音与图标等文件 copy 到1.5.0 ,不过注意别把 Makefile.* 这些文件也 copy 过去了, 也许也需要对拷贝过去的个别新文件从新明明才能把文件全部替换完,这里就不叙述了。

关于 openq 的 hack

想了一下,openq的崩溃应该与文件传输有关系,所以就去掉源代码中的文件传输功能,这里其实只需要小小的更改 src 目录中 im.c 的代码就可以了:

代码: 全选

[..................]
// a debug function
void _qq_show_packet(gchar * desc, gchar * buf, gint len);

enum
{
        QQ_NORMAL_IM_TEXT = 0x000b,
         /*****
            QQ_NORMAL_IM_FILE_REQUEST = 0x0035,
	QQ_NORMAL_IM_FILE_APPROVE_UDP = 0x0037,
	QQ_NORMAL_IM_FILE_APPROVE_TCP = 0x0003,
	QQ_NORMAL_IM_FILE_REJECT_UDP = 0x0039,
	QQ_NORMAL_IM_FILE_REJECT_TCP = 0x0005,
	QQ_NORMAL_IM_FILE_NOTIFY = 0x003b,
	QQ_NORMAL_IM_FILE_CANCEL = 0x0049,
	QQ_NORMAL_IM_FILE_PASV = 0x003f,
         *****/
};

[...............]

	case QQ_NORMAL_IM_TEXT:
		gaim_debug (GAIM_DEBUG_INFO,
			    "QQ",
			    "Normal IM, text type:\n [%d] => [%d], src: %s\n",
			    common->sender_uid, common->receiver_uid,
			    qq_get_source_str (common->sender_ver));
		_qq_process_recv_normal_im_text (data, cursor, len, common,
						 gc);
		break;
		/********
		case QQ_NORMAL_IM_FILE_REJECT_UDP:
		qq_process_recv_file_reject (data, cursor, len,
					     common->sender_uid, gc);
		break;
	case QQ_NORMAL_IM_FILE_APPROVE_UDP:
		qq_process_recv_file_accept (data, cursor, len,
					     common->sender_uid, gc);
		break;
	case QQ_NORMAL_IM_FILE_REQUEST:
		qq_process_recv_file_request (data, cursor, len,
					      common->sender_uid, gc);
		break;
		case QQ_NORMAL_IM_FILE_CANCEL:
		qq_process_recv_file_cancel (data, cursor, len,
					     common->sender_uid, gc);
		break;
		case QQ_NORMAL_IM_FILE_NOTIFY:
		qq_process_recv_file_notify (data, cursor, len,
				common->sender_uid, gc);
		break;
		**********/
	default:
		im_unprocessed = g_newa (qq_recv_normal_im_unprocessed, 1);
		im_unprocessed->common = common;
		im_unprocessed->unknown = *cursor;
		im_unprocessed->length = data + len - *cursor;

[................]
可以看出只是注释掉与文件传输相关的代码就很容易做到了,然后编译 openq 并安装,搞定了。

最后可能需要改动你的 笑脸 主题,应该openq中的 QQ , MSN ,Yahoo的都太老了,还没有jabber的主题,这个改动是很容易,可以到这里下载自己喜欢的主题,然后改动theme文件就可以了。

若有问题,请回贴

贴个图:

发表于 : 2005-12-27 15:12
id_sonic
重新制作的 qq2005 默认头像,openq使用,复制 qq_*.png 到

/usr/local/share/pixmaps/gaim/status/default/

或者

/usr/share/pixmaps/gaim/status/default/

即可

发表于 : 2005-12-29 11:59
jazzi
自己动手,丰衣足食啊,老兄的精神值得嘉奖
我的openq没法显示群组啊,遗憾 :lol: