mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Merge pull request #4583 from NixOS/buildLocalCabal-new-cabal2nix
buildLocalCabal: use new cabal2nix feature
This commit is contained in:
commit
10895c3577
1 changed files with 9 additions and 8 deletions
|
@ -3136,20 +3136,21 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
|
|||
|
||||
buildCommand = ''
|
||||
export HOME="$TMPDIR"
|
||||
${nativePkgs.haskellPackages.cabal2nix}/bin/cabal2nix ${src + "/${name}.cabal"} --sha256=FILTERME \
|
||||
| grep -v FILTERME | sed \
|
||||
-e 's/licenses.proprietary/licenses.unfree/' \
|
||||
-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/' > $out
|
||||
${nativePkgs.haskellPackages.cabal2nix}/bin/cabal2nix ${src} \
|
||||
| sed -e 's/licenses.proprietary/licenses.unfree/' > $out
|
||||
'';
|
||||
|
||||
} // pkgs.lib.optionalAttrs nativePkgs.stdenv.isLinux {
|
||||
LANG = "en_US.UTF-8";
|
||||
LOCALE_ARCHIVE = "${nativePkgs.glibcLocales}/lib/locale/locale-archive";
|
||||
});
|
||||
in callPackage cabalExpr ({ inherit src cabalDrvArgs; } // args);
|
||||
in callPackage cabalExpr {
|
||||
cabal = self.cabal.override {
|
||||
extension = eself: esuper: {
|
||||
buildDepends = [ self.cabalInstall ] ++ esuper.buildDepends;
|
||||
} // cabalDrvArgs;
|
||||
};
|
||||
};
|
||||
|
||||
buildLocalCabal = src: name: self.buildLocalCabalWithArgs { inherit src name; };
|
||||
|
||||
|
|
Loading…
Reference in a new issue