mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 09:43:14 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
{ lib, stdenv, python, xmpppy, pythonPackages, fetchcvs, runtimeShell } :
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "pyMAILt";
|
|
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 ];
|
|
|
|
installPhase = ''
|
|
cd mail-transport
|
|
mkdir -p $out/bin $out/share/${pname}-${version}
|
|
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/${pname}-${version}
|
|
./mail.py \"$@\"
|
|
EOF
|
|
chmod a+rx $out/bin/pyMAILt $out/share/${pname}-${version}/mail.py
|
|
wrapPythonPrograms
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Email transport module for XMPP";
|
|
platforms = platforms.unix;
|
|
license = licenses.gpl2;
|
|
};
|
|
}
|