mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 18:23:09 +00:00
32 lines
790 B
Nix
32 lines
790 B
Nix
# global distutils configuration, see http://docs.python.org/2/install/index.html#distutils-configuration-files
|
|
|
|
{ stdenv, python, writeText, extraCfg ? "" }:
|
|
|
|
|
|
let
|
|
distutilsCfg = writeText "distutils.cfg" ''
|
|
[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 ];
|
|
|
|
unpackPhase = "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
|
|
'';
|
|
}
|