buildPythonPackage: introduce "disabled" argument

Useful to disable the package for specific python versions.

Typically usage: disable = isPy3k;
This commit is contained in:
Domen Kožar 2014-08-24 16:01:21 +02:00
parent fc5f6e4e79
commit 47673e43c9
2 changed files with 12 additions and 2 deletions

View file

@ -34,7 +34,10 @@
# The difference is that `pythonPath' is not propagated to the user
# environment. This is preferrable for programs because it doesn't
# pollute the user environment.
, pythonPath ? []
, pythonPath ? []
# used to disable derivation, useful for specific python versions
, disabled ? false
, meta ? {}
@ -46,6 +49,8 @@
, ... } @ attrs:
assert (!disabled);
# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
python.stdenv.mkDerivation (attrs // {
inherit doCheck;

View file

@ -7,6 +7,7 @@ let
isPy33 = python.majorVersion == "3.3";
isPy34 = python.majorVersion == "3.4";
isPyPy = python.executable == "pypy";
isPy3k = strings.substring 0 1 python.majorVersion == "3";
# Unique python version identifier
pythonName =
@ -537,6 +538,8 @@ rec {
avro = buildPythonPackage (rec {
name = "avro-1.7.6";
disabled = isPy3k;
src = fetchurl {
url = "https://pypi.python.org/packages/source/a/avro/${name}.tar.gz";
md5 = "7f4893205e5ad69ac86f6b44efb7df72";
@ -550,7 +553,9 @@ rec {
avro3k = pkgs.lowPrio (buildPythonPackage (rec {
name = "avro3k-1.7.7-SNAPSHOT";
disabled = (!isPy3k);
src = fetchurl {
url = "https://pypi.python.org/packages/source/a/avro3k/${name}.tar.gz";
sha256 = "15ahl0irwwj558s964abdxg4vp6iwlabri7klsm2am6q5r0ngsky";