depot/third_party/nixpkgs/pkgs/servers/xmpp/pyIRCt/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

41 lines
1.3 KiB
Nix

{ stdenv, fetchurl, xmpppy, pythonIRClib, python, pythonPackages, runtimeShell } :
stdenv.mkDerivation rec {
pname = "pyIRCt";
version = "0.4";
src = fetchurl {
url = "mirror://sourceforge/xmpppy/irc-transport-${version}.tar.gz";
sha256 = "0gbc0dvj1p3088b6x315yjrlwnc5vvzp0var36wlf9z60ghvk8yb";
};
buildInputs = [ pythonPackages.wrapPython ];
pythonPath = [
xmpppy pythonIRClib
];
# phaseNames = ["deploy" (a.makeManyWrappers "$out/share/${name}/irc.py" a.pythonWrapperArguments)];
installPhase = ''
mkdir -p $out/bin $out/share/${pname}-${version}
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
cp * $out/share/${pname}-${version}
cat > $out/bin/pyIRCt <<EOF
#!${runtimeShell}
cd $out/share/${pname}-${version}
./irc.py \"$@\"
EOF
chmod a+rx $out/bin/pyIRCt $out/share/${pname}-${version}/irc.py
wrapPythonPrograms
'';
meta = with stdenv.lib; {
description = "IRC transport module for XMPP";
platforms = platforms.unix;
license = licenses.gpl2;
};
}