<commit_before>module Cabal2Nix.Generate ( cabal2nix, cabal2nix' ) where

import Cabal2Nix.Flags
import Cabal2Nix.License
import Cabal2Nix.Normalize
import Cabal2Nix.PostProcess
import Data.Maybe
import Distribution.Compiler
import Distribution.Nixpkgs.Haskell
import qualified Distribution.Package as Cabal
import qualified Distribution.PackageDescription as Cabal
import Distribution.PackageDescription.Configuration
import Distribution.System
import qualified Data.Set as Set

cabal2nix :: Cabal.FlagAssignment -> Cabal.GenericPackageDescription -> Derivation
cabal2nix flags' cabal = drv { cabalFlags = flags }
  where drv = cabal2nix' descr
        flags = normalizeCabalFlags (flags' ++ configureCabalFlags (Cabal.package (Cabal.packageDescription cabal)))
        Right (descr, _) = finalizePackageDescription
                            flags
                            (const True)
                            (Platform X86_64 Linux)                 -- shouldn't be hardcoded
                            (unknownCompilerInfo (CompilerId GHC (Version [7,8,4] [])) NoAbiTag)
                            []
                            cabal

cabal2nix' :: Cabal.PackageDescription -> Derivation
cabal2nix' tpkg = normalize $ postProcess $ normalize MkDerivation
  { pname          = let Cabal.PackageName x = Cabal.pkgName pkg in x<commit_msg>Update cabal2nix to generate output for GHC 7.10.x.<commit_after>module Cabal2Nix.Generate ( cabal2nix, cabal2nix' ) where

import Cabal2Nix.Flags
import Cabal2Nix.License
import Cabal2Nix.Normalize
import Cabal2Nix.PostProcess
import Data.Maybe
import Distribution.Compiler
import Distribution.Nixpkgs.Haskell
import qualified Distribution.Package as Cabal
import qualified Distribution.PackageDescription as Cabal
import Distribution.PackageDescription.Configuration
import Distribution.System
import qualified Data.Set as Set

cabal2nix :: Cabal.FlagAssignment -> Cabal.GenericPackageDescription -> Derivation
cabal2nix flags' cabal = drv { cabalFlags = flags }
  where drv = cabal2nix' descr
        flags = normalizeCabalFlags (flags' ++ configureCabalFlags (Cabal.package (Cabal.packageDescription cabal)))
        Right (descr, _) = finalizePackageDescription
                            flags
                            (const True)
                            (Platform X86_64 Linux)                 -- shouldn't be hardcoded
                            (unknownCompilerInfo (CompilerId GHC (Version [7,10,1] [])) NoAbiTag)
                            []
                            cabal

cabal2nix' :: Cabal.PackageDescription -> Derivation
cabal2nix' tpkg = normalize $ postProcess $ normalize MkDerivation
  { pname          = let Cabal.PackageName x = Cabal.pkgName pkg in x
{'fraction_non_alphanumeric': 0.0660825118656444, 'fraction_numerical': 0.01569916027747353, 'mean_word_length': 2.727891156462585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4593987', 'n_tokens_mistral': 776, 'n_tokens_neox': 737, 'n_words': 196}