nixpkgs/pkgs/applications/networking/instant-messengers/tkabber/default.nix

69 lines
1.7 KiB
Nix
Raw Normal View History

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