nixpkgs/pkgs/servers/xmpp/pyIRCt/default.nix

42 lines
1.2 KiB
Nix
Raw Normal View History

2016-01-24 15:50:54 +00:00
{ stdenv, fetchurl, xmpppy, pythonIRClib, python, pythonPackages } :
stdenv.mkDerivation rec {
name = "pyIRCt-${version}";
version = "0.4";
src = fetchurl {
2013-07-14 02:17:07 +01:00
url = "mirror://sourceforge/xmpppy/irc-transport-${version}.tar.gz";
sha256 = "0gbc0dvj1p3088b6x315yjrlwnc5vvzp0var36wlf9z60ghvk8yb";
};
2016-01-24 15:50:54 +00:00
buildInputs = [ pythonPackages.wrapPython ];
pythonPath = [
xmpppy pythonIRClib
];
/* doConfigure should be removed if not needed */
2016-01-24 15:50:54 +00:00
# phaseNames = ["deploy" (a.makeManyWrappers "$out/share/${name}/irc.py" a.pythonWrapperArguments)];
installPhase = ''
mkdir -p $out/bin $out/share/${name}
2016-01-24 15:50:54 +00:00
sed -e 's@/usr/bin/@${python}/bin/@' -i irc.py
sed -e '/configFiles/aconfigFiles += [os.getenv("HOME")+"/.pyIRCt.xml"]' -i config.py
sed -e '/configFiles/aconfigFiles += [os.getenv("HOME")+"/.python-irc-transport.xml"]' -i config.py
sed -e '/configFiles/iimport os' -i config.py
2016-01-24 15:50:54 +00:00
cp * $out/share/${name}
cat > $out/bin/pyIRCt <<EOF
2017-01-15 12:44:52 +00:00
#!${stdenv.shell}
2016-01-24 15:50:54 +00:00
cd $out/share/${name}
./irc.py \"$@\"
EOF
chmod a+rx $out/bin/pyIRCt $out/share/${name}/irc.py
2016-01-24 15:50:54 +00:00
wrapPythonPrograms
'';
meta = {
description = "IRC transport module for XMPP";
platforms = stdenv.lib.platforms.unix;
};
}