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