nixpkgs/pkgs/servers/xmpp/pyMAILt/default.nix
Jörg Thalheim dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00

41 lines
1.3 KiB
Nix

{ stdenv, python, xmpppy, pythonPackages, fetchcvs, runtimeShell } :
stdenv.mkDerivation rec {
name = "pyMAILt-${version}";
version = "20090101";
src = fetchcvs {
cvsRoot = ":pserver:anonymous@xmpppy.cvs.sourceforge.net:/cvsroot/xmpppy";
module = "xmpppy/mail-transport";
date = "2009-01-01";
sha256 = "15301252e52b4ccb2156baefed8982a2a0cce3ae8eae3caf3cc28dfa615c8d6e";
};
pythonPath = [ xmpppy ];
buildInputs = [ pythonPackages.wrapPython ];
/* doConfigure should be removed if not needed */
installPhase = ''
cd mail-transport
mkdir -p $out/bin $out/share/${name}
sed -e 's@/usr/bin/@${python}/bin/@' -i mail.py
sed -e '/configFiles/aconfigFiles += [os.getenv("HOME")+"/.pyMAILt.xml"]' -i config.py
sed -e '/configFiles/aconfigFiles += [os.getenv("HOME")+"/.python-mail-transport.xml"]' -i config.py
sed -e '/configFiles/iimport os' -i config.py
cp * $out/share/$name
cat > $out/bin/pyMAILt <<EOF
#!${runtimeShell}
cd $out/share/${name}
./mail.py \"$@\"
EOF
chmod a+rx $out/bin/pyMAILt $out/share/${name}/mail.py
wrapPythonPrograms
'';
meta = with stdenv.lib; {
description = "Email transport module for XMPP";
platforms = platforms.unix;
license = licenses.gpl2;
};
}