depot/third_party/nixpkgs/pkgs/development/python-modules/distutils-cfg/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

32 lines
853 B
Nix

# global distutils configuration, see http://docs.python.org/2/install/index.html#distutils-configuration-files
{ stdenv, python, writeText, extraCfg ? "", overrideCfg ? "" }:
let
distutilsCfg = writeText "distutils.cfg" (
if overrideCfg != "" then overrideCfg else ''
[easy_install]
# don't allow network connections during build to ensure purity
allow-hosts = None
# make sure we always unzip installed packages otherwise setup hooks won't work
zip_ok = 0
${extraCfg}
'');
in stdenv.mkDerivation {
name = "${python.libPrefix}-distutils.cfg";
buildInputs = [ python ];
dontUnpack = true;
installPhase = ''
dest="$out/lib/${python.libPrefix}/site-packages/distutils"
mkdir -p $dest
ln -s ${python}/lib/${python.libPrefix}/distutils/* $dest
ln -s ${distutilsCfg} $dest/distutils.cfg
'';
}