evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / distutils-cfg / default.nix
blob89bd841560604c16536ab4b006d3d68fb488ff31
1 # global distutils configuration, see http://docs.python.org/2/install/index.html#distutils-configuration-files
4   stdenv,
5   python,
6   writeText,
7   extraCfg ? "",
8   overrideCfg ? "",
9 }:
11 let
12   distutilsCfg = writeText "distutils.cfg" (
13     if overrideCfg != "" then
14       overrideCfg
15     else
16       ''
17         [easy_install]
19         # don't allow network connections during build to ensure purity
20         allow-hosts = None
22         # make sure we always unzip installed packages otherwise setup hooks won't work
23         zip_ok = 0
25         ${extraCfg}
26       ''
27   );
29 stdenv.mkDerivation {
30   name = "${python.libPrefix}-distutils.cfg";
32   buildInputs = [ python ];
34   dontUnpack = true;
36   installPhase = ''
37     dest="$out/${python.sitePackages}/distutils"
38     mkdir -p $dest
39     ln -s ${python}/lib/${python.libPrefix}/distutils/* $dest
40     ln -s ${distutilsCfg} $dest/distutils.cfg
41   '';