haskell-te: 4224ad80400af459077c453bbc7309cbd82c493e

     1: # Back-ported from newer nixpkgs
     2: { cabal2nix, fetchFromGitHub, glibcLocales, lib, stdenv }:
     3: 
     4: with lib;
     5: with rec {
     6:   all-cabal-hashes = fetchFromGitHub {
     7:     owner  = "commercialhaskell";
     8:     repo   = "all-cabal-hashes";
     9:     rev    = "1932d9e";
    10:     sha256 = "07036zgxpf7s057qr5jf5wjg17rl3jsrlaxfg15avmfbgrl23fd6";
    11:   };
    12: 
    13:   hackage2nix = name: version: stdenv.mkDerivation {
    14:     name           = "cabal2nix-${name}-${version}";
    15:     buildInputs    = [ cabal2nix ];
    16:     phases         = ["installPhase"];
    17:     LANG           = "en_US.UTF-8";
    18:     LOCALE_ARCHIVE = lib.optionalString
    19:                        stdenv.isLinux
    20:                        "${glibcLocales}/lib/locale/locale-archive";
    21:     installPhase = ''
    22:       export HOME="$TMP"
    23:       mkdir $out
    24:       hash=$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' ${all-cabal-hashes}/${name}/${version}/${name}.json)
    25:       cabal2nix --sha256=$hash ${all-cabal-hashes}/${name}/${version}/${name}.cabal >$out/default.nix
    26:     '';
    27:   };
    28: };
    29: 
    30: hackage2nix

Generated by git2html.