summary refs log tree commit diff
path: root/pkgs/development/python-modules/buildout-nix
diff options
context:
space:
mode:
authorCillian de Róiste <goibhniu@fsfe.org>2013-08-28 00:26:06 +0200
committerCillian de Róiste <goibhniu@fsfe.org>2013-08-28 00:26:06 +0200
commit01cc4301f36d439b4f918dbb521937c09f097e7c (patch)
tree61b8f93f3c48c3b584a0949798b28fab7bc04453 /pkgs/development/python-modules/buildout-nix
parentefcffe61e49a827de02c3f82ff3d18684f1d96ee (diff)
downloadnixpkgs-01cc4301f36d439b4f918dbb521937c09f097e7c.tar
nixpkgs-01cc4301f36d439b4f918dbb521937c09f097e7c.tar.gz
nixpkgs-01cc4301f36d439b4f918dbb521937c09f097e7c.tar.bz2
nixpkgs-01cc4301f36d439b4f918dbb521937c09f097e7c.tar.lz
nixpkgs-01cc4301f36d439b4f918dbb521937c09f097e7c.tar.xz
nixpkgs-01cc4301f36d439b4f918dbb521937c09f097e7c.tar.zst
nixpkgs-01cc4301f36d439b4f918dbb521937c09f097e7c.zip
Add a patched version of buildout 2.2.0 for development with nix
Without this patch buildout will copy eggs from the nix store into the
./eggs directory and then try to compile them. This fails because they
are read only. This patch changes the behaviour to create symlinks to
eggs available in the nix store instead of copying them, and not to
try to compile the eggs in the store. To differentiate this from the
default buildout (which may be provided otherwise e.g. as a
dependency) the executable is renamed to buildout-nix.

This can be used in conjuntion with myEnvFun to create development
environments which make use of the python modules available in the
store while downloading any additional required eggs. A pleasant side
effect is that you can conveniently replace the symlink with a copy
for debugging purposes.
Diffstat (limited to 'pkgs/development/python-modules/buildout-nix')
-rw-r--r--pkgs/development/python-modules/buildout-nix/default.nix21
-rw-r--r--pkgs/development/python-modules/buildout-nix/nix.patch23
2 files changed, 44 insertions, 0 deletions
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 00000000000..26b6fb0cfcd
--- /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 00000000000..a09163518a9
--- /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