2012-09-08 20:26:37 -07:00
|
|
|
{ stdenv, fetchurl, tcl, tk, tcllib, tcltls, tclgpg
|
2015-09-15 02:13:22 -07:00
|
|
|
, bwidget, makeWrapper, xlibsWrapper
|
2014-01-06 05:36:53 -08:00
|
|
|
, withSitePlugins ? true
|
2014-01-06 04:33:52 -08:00
|
|
|
, theme ? null
|
|
|
|
}:
|
2012-06-04 11:28:40 -07:00
|
|
|
|
2014-01-06 05:36:53 -08:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2012-09-08 20:41:40 -07:00
|
|
|
let
|
2015-02-08 04:23:33 -08:00
|
|
|
version = "1.1";
|
2014-01-06 05:36:53 -08:00
|
|
|
|
|
|
|
main = {
|
|
|
|
name = "tkabber";
|
2015-02-08 04:23:33 -08:00
|
|
|
sha256 = "1ip0mi2icqkjxiam4qj1qcynnz9ck1ggzcbcqyjj132hakd855a2";
|
2014-01-06 05:36:53 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
plugins = {
|
|
|
|
name = "tkabber-plugins";
|
2015-02-08 04:23:33 -08:00
|
|
|
sha256 = "1dr12rh4vs1w1bga45k4ijgxs39801c1k4z3b892pn1dwv84il5y";
|
2014-01-06 05:36:53 -08:00
|
|
|
};
|
|
|
|
|
2012-09-08 20:41:40 -07:00
|
|
|
tclLibraries = [ bwidget tcllib tcltls tclgpg ];
|
|
|
|
|
|
|
|
getTclLibPath = p: "${p}/lib/${p.libPrefix}";
|
|
|
|
|
|
|
|
tclLibPaths = stdenv.lib.concatStringsSep " "
|
|
|
|
(map getTclLibPath tclLibraries);
|
|
|
|
|
2014-01-06 05:36:53 -08:00
|
|
|
mkTkabber = attrs: stdenv.mkDerivation (rec {
|
|
|
|
name = "${attrs.name}-${version}";
|
2012-06-04 11:28:40 -07:00
|
|
|
|
2014-01-06 05:36:53 -08:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://files.jabber.ru/tkabber/${name}.tar.xz";
|
|
|
|
inherit (attrs) sha256;
|
|
|
|
};
|
2012-06-04 11:28:40 -07:00
|
|
|
|
2014-01-06 05:36:53 -08:00
|
|
|
prePatch = ''
|
|
|
|
sed -e "s@/usr/local@$out@" -i Makefile
|
|
|
|
'';
|
|
|
|
} // removeAttrs attrs [ "name" "sha256" ]);
|
|
|
|
|
|
|
|
in mkTkabber (main // {
|
|
|
|
postPatch = ''
|
2012-06-04 11:28:40 -07:00
|
|
|
substituteInPlace login.tcl --replace \
|
|
|
|
"custom::defvar loginconf(sslcacertstore) \"\"" \
|
2015-05-31 15:48:17 -07:00
|
|
|
"custom::defvar loginconf(sslcacertstore) \$env(SSL_CERT_FILE)"
|
2014-01-06 05:36:53 -08:00
|
|
|
'' + optionalString (theme != null) ''
|
2014-01-06 04:33:52 -08:00
|
|
|
themePath="$out/share/doc/tkabber/examples/xrdb/${theme}.xrdb"
|
2012-06-04 11:28:40 -07:00
|
|
|
sed -i '/^if.*load_default_xrdb/,/^}$/ {
|
2014-01-06 04:33:52 -08:00
|
|
|
s@option readfile \(\[fullpath [^]]*\]\)@option readfile "'"$themePath"'"@
|
2012-06-04 11:28:40 -07:00
|
|
|
}' tkabber.tcl
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2014-01-06 05:15:58 -08:00
|
|
|
for prog in $out/bin/*; do
|
|
|
|
wrapProgram "$prog" \
|
|
|
|
--prefix PATH : "${tk}/bin" \
|
|
|
|
--set TCLLIBPATH '"${tclLibPaths}"' \
|
2014-01-06 05:36:53 -08:00
|
|
|
${optionalString withSitePlugins ''
|
|
|
|
--set TKABBER_SITE_PLUGINS '${mkTkabber plugins}/share/tkabber-plugins'
|
|
|
|
''}
|
2014-01-06 05:15:58 -08:00
|
|
|
done
|
2012-06-04 11:28:40 -07:00
|
|
|
'';
|
|
|
|
|
2015-09-15 02:13:22 -07:00
|
|
|
buildInputs = [ tcl tk xlibsWrapper makeWrapper ] ++ tclLibraries;
|
2012-06-04 11:28:40 -07:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://tkabber.jabber.ru/";
|
2014-01-06 05:36:53 -08:00
|
|
|
description = "A GUI XMPP (Jabber) client written in Tcl/Tk";
|
2012-09-08 20:49:15 -07:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2012-06-04 11:28:40 -07:00
|
|
|
};
|
2014-01-06 05:36:53 -08:00
|
|
|
})
|