diff --git a/pkgs/development/python-modules/buildout-nix/default.nix b/pkgs/development/python-modules/buildout-nix/default.nix new file mode 100644 index 000000000000..26b6fb0cfcda --- /dev/null +++ b/pkgs/development/python-modules/buildout-nix/default.nix @@ -0,0 +1,21 @@ +{ fetchurl, stdenv, buildPythonPackage }: + +buildPythonPackage { + name = "zc.buildout-nix-2.2.0"; + + src = fetchurl { + url = "https://pypi.python.org/packages/source/z/zc.buildout/zc.buildout-2.2.0.tar.gz"; + md5 = "771dd9807da7d5ef5bb998991c5fdae1"; + }; + + patches = [ ./nix.patch ]; + + postInstall = "mv $out/bin/buildout{,-nix}"; + + meta = { + homepage = "http://www.buildout.org"; + description = "A software build and configuration system"; + license = stdenv.lib.licenses.zpt21; + maintainers = [ stdenv.lib.maintainers.goibhniu ]; + }; +} diff --git a/pkgs/development/python-modules/buildout-nix/nix.patch b/pkgs/development/python-modules/buildout-nix/nix.patch new file mode 100644 index 000000000000..a09163518a96 --- /dev/null +++ b/pkgs/development/python-modules/buildout-nix/nix.patch @@ -0,0 +1,23 @@ +--- a/src/zc/buildout/easy_install.py 2013-08-27 22:28:40.233718116 +0200 ++++ b/src/zc/buildout/easy_install.py 2013-08-27 22:31:07.967871186 +0200 +@@ -508,16 +508,15 @@ + self._dest, os.path.basename(dist.location)) + + if os.path.isdir(dist.location): +- # we got a directory. It must have been +- # obtained locally. Just copy it. +- shutil.copytree(dist.location, newloc) ++ # Symlink to dists in /nix/store ++ if not os.path.exists(newloc): ++ os.symlink(dist.location, newloc) + else: + + + setuptools.archive_util.unpack_archive( + dist.location, newloc) +- +- redo_pyc(newloc) ++ redo_pyc(newloc) + + # Getting the dist from the environment causes the + # distribution meta data to be read. Cloning isn't diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 59707c58de89..3cd30b715f07 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -126,6 +126,9 @@ pythonPackages = modules // import ./python-packages-generated.nix { inherit python buildPythonPackage pygobject pycairo; }; + # A patched version of buildout, useful for buildout based development on Nix + zc_buildout_nix = callPackage ../development/python-modules/buildout-nix { }; + # packages defined here afew = buildPythonPackage rec {