3
0
Fork 0
forked from mirrors/nixpkgs

Merge branch 'buildLocalCabal-drvArgs' of git://github.com/proger/nixpkgs

buildLocalCabal: allow drvArgs in buildLocalCabalWithArgs
This commit is contained in:
Shea Levy 2014-05-06 09:27:40 -04:00
commit 0d0f7d2681

View file

@ -3088,7 +3088,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.finalReturn x
cabal2nix = callPackage ../development/tools/haskell/cabal2nix {};
# Build a cabal package given a local .cabal file
buildLocalCabalWithArgs = { src, name, args ? {} }: let
buildLocalCabalWithArgs = { src, name, args ? {}, cabalDrvArgs ? { jailbreak = true; } }: let
cabalExpr = pkgs.stdenv.mkDerivation ({
name = "${name}.nix";
@ -3096,16 +3096,17 @@ let result = let callPackage = x : y : modifyPrio (newScope result.finalReturn x
${self.cabal2nix}/bin/cabal2nix ${src + "/${name}.cabal"} --sha256=FILTERME \
| grep -v FILTERME | sed \
-e 's/licenses.proprietary/licenses.unfree/' \
-e 's/{ cabal/{ cabal, cabalInstall, src/' \
-e 's/{ cabal/{ cabal, cabalInstall, cabalDrvArgs ? {}, src/' \
-e 's/cabal.mkDerivation (self: {/cabal.mkDerivation (self: cabalDrvArgs \/\/ {/' \
-e 's/buildDepends = \[/buildDepends = \[ cabalInstall/' \
-e 's/pname = \([^\n]*\)/pname = \1\n inherit src;\n jailbreak = true;/' > $out
-e 's/pname = \([^\n]*\)/pname = \1\n inherit src;\n/' > $out
'';
} // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
});
in callPackage cabalExpr ({ inherit src; } // args);
in callPackage cabalExpr ({ inherit src cabalDrvArgs; } // args);
buildLocalCabal = src: name: self.buildLocalCabalWithArgs { inherit src name; };