From 754704ea1884563beda72ddff2ab328e690278d0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Nov 2013 20:32:49 +0100 Subject: [PATCH] Allow packages to be marked as "broken" by setting meta.broken The effect is that they won't show up in "nix-env -qa" anymore. --- doc/meta.xml | 9 +++++++++ nixos/modules/module-list.nix | 2 +- pkgs/applications/virtualization/nova/client.nix | 1 + pkgs/applications/virtualization/nova/default.nix | 15 ++++++++------- pkgs/applications/virtualization/xen/default.nix | 1 + pkgs/stdenv/generic/default.nix | 4 ++++ 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/doc/meta.xml b/doc/meta.xml index 09252410d807..df84915cc091 100644 --- a/doc/meta.xml +++ b/doc/meta.xml @@ -118,6 +118,15 @@ interpretation: package). + + broken + If set to true, the package is + marked as “broken”, meaning that it won’t show up in + nix-env -qa, and cannot be built or installed. + Sush packages should be removed from Nixpkgs eventually unless + they are fixed. + + diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index eaa8e03f17fd..b8f09bc48e0c 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -279,5 +279,5 @@ ./virtualisation/libvirtd.nix #./virtualisation/nova.nix ./virtualisation/virtualbox-guest.nix - ./virtualisation/xen-dom0.nix + #./virtualisation/xen-dom0.nix ] diff --git a/pkgs/applications/virtualization/nova/client.nix b/pkgs/applications/virtualization/nova/client.nix index bb65f80d2066..bcc72d19bb39 100644 --- a/pkgs/applications/virtualization/nova/client.nix +++ b/pkgs/applications/virtualization/nova/client.nix @@ -16,5 +16,6 @@ pythonPackages.buildPythonPackage rec { meta = { homepage = https://github.com/rackspace/python-novaclient; description = "Client library and command line tool for the OpenStack Nova API"; + broken = true; }; } diff --git a/pkgs/applications/virtualization/nova/default.nix b/pkgs/applications/virtualization/nova/default.nix index a9a36ffca4fe..c1ef20b7aa08 100644 --- a/pkgs/applications/virtualization/nova/default.nix +++ b/pkgs/applications/virtualization/nova/default.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation rec { paste_deploy m2crypto ipy boto_1_9 twisted sqlalchemy_migrate distutils_extra simplejson readline glance cheetah lockfile httplib2 # !!! should libvirt be a build-time dependency? Note that - # libxml2Python is a dependency of libvirt.py. + # libxml2Python is a dependency of libvirt.py. libvirt libxml2Python novaclient ]; buildInputs = - [ pythonPackages.python + [ pythonPackages.python pythonPackages.wrapPython pythonPackages.mox intltool @@ -45,11 +45,11 @@ stdenv.mkDerivation rec { substituteInPlace nova/api/ec2/cloud.py \ --replace 'sh genrootca.sh' $out/libexec/nova/genrootca.sh ''; - + buildPhase = "python setup.py build"; installPhase = - '' + '' p=$(toPythonPath $out) export PYTHONPATH=$p:$PYTHONPATH mkdir -p $p @@ -59,14 +59,14 @@ stdenv.mkDerivation rec { # computes some stuff from its own argv[0]. So put the wrapped # programs in $out/libexec under their original names. mkdir -p $out/libexec/nova - + wrapProgram() { local prog="$1" local hidden=$out/libexec/nova/$(basename "$prog") mv $prog $hidden makeWrapper $hidden $prog "$@" } - + wrapPythonPrograms cp -prvd etc $out/etc @@ -86,9 +86,10 @@ stdenv.mkDerivation rec { doCheck = false; # !!! fix checkPhase = "python setup.py test"; - + meta = { homepage = http://nova.openstack.org/; description = "OpenStack Compute (a.k.a. Nova), a cloud computing fabric controller"; + broken = true; }; } diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix index 3cb16a6b4425..5f149b059787 100644 --- a/pkgs/applications/virtualization/xen/default.nix +++ b/pkgs/applications/virtualization/xen/default.nix @@ -136,5 +136,6 @@ stdenv.mkDerivation { description = "Xen hypervisor and management tools for Dom0"; platforms = [ "i686-linux" "x86_64-linux" ]; maintainers = [ stdenv.lib.maintainers.eelco ]; + broken = true; }; } diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index f8aff33a327f..083a71548b91 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -18,6 +18,8 @@ let allowUnfree = config.allowUnfree or true && builtins.getEnv "HYDRA_DISALLOW_UNFREE" != "1"; + allowBroken = builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1"; + stdenvGenerator = setupScript: rec { # The stdenv that we are producing. @@ -51,6 +53,8 @@ let mkDerivation = attrs: if !allowUnfree && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) then throw "package ‘${attrs.name}’ has an unfree license, refusing to evaluate" + else if !allowBroken && attrs.meta.broken or false then + throw "you can't use package ‘${attrs.name}’ because it has been marked as broken" else lib.addPassthru (derivation ( (removeAttrs attrs ["meta" "passthru" "crossAttrs"])