From 470ade254e73e280b0ec9e1a1ef081926e0d1371 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 6 Sep 2012 14:59:07 +0200 Subject: [PATCH] Add support for jailbreak-cabal utility to the Cabal builder. Jailbreaks-cabal allows Nixpkgs maintainers to quick-fix builds of packages that over-specify their version requirements by removing the version restrictions of all dependencies from the Cabal file. Set jailbreak = true in the build expression to activate this feature. --- pkgs/build-support/cabal/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index 8ae8c06d5132..42392aff60c4 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -1,6 +1,6 @@ # generic builder for Cabal packages -{stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, enableLibraryProfiling ? false} : +{ stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, jailbreakCabal, enableLibraryProfiling ? false }: { mkDerivation = args : # arguments for the individual package, can modify the defaults @@ -86,7 +86,8 @@ configurePhase = '' eval "$preConfigure" - for i in Setup.hs Setup.lhs; do + ${lib.optionalString (lib.attrByPath ["jailbreak"] false self) "${jailbreakCabal}/bin/jailbreak-cabal ${self.pname}.cabal && " + }for i in Setup.hs Setup.lhs; do test -f $i && ghc --make $i done