git.iko.soy/typeable/cabal2nix
on master help sign in
Require hpack >= 0.22
commitb31db774316d02af151c015063a7b8630448195a authorTom Smalley <tfsmalley@gmail.com> dateWed 24 Jan 2018, 10:40 (9 years ago) parent2160534
2 files changed+1−10
cabal2nix.cabal+1−1 src/Distribution/Nixpkgs/Haskell/PackageSourceSpec.hs−9
cabal2nix.cabal+1−1
@@ -104,7 +104,7 @@ library
104104 , filepath
105105 , hackage-db >2
106106 , hopenssl >=2
107− , hpack >= 0.21 && < 0.23
107+ , hpack == 0.22.*
108108 , language-nix
109109 , lens
110110 , optparse-applicative
src/Distribution/Nixpkgs/Haskell/PackageSourceSpec.hs−9
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
21module Distribution.Nixpkgs.Haskell.PackageSourceSpec
32 ( Package(..), getPackage, getPackage', loadHackageDB, sourceFromHackage
43 ) where
@@ -192,18 +191,10 @@ handleIO = Exception.handle
192191
193192hpackDirectory :: FilePath -> MaybeT IO (Bool, Cabal.GenericPackageDescription)
194193hpackDirectory dir = do
195−#if MIN_VERSION_hpack(0,22,0)
196194 mPackage <- liftIO $ Hpack.readPackageConfig "" $ dir </> "package.yaml"
197−#else
198− mPackage <- liftIO $ Hpack.readPackageConfig $ dir </> "package.yaml"
199−#endif
200195 case mPackage of
201196 Left err -> liftIO $ hPutStrLn stderr ("*** hpack error: " ++ show err ++ ". Exiting.") >> exitFailure
202−#if MIN_VERSION_hpack(0,22,0)
203197 Right (pkg', _) -> do
204−#else
205− Right (_, pkg') -> do
206−#endif
207198 let hpackOutput = Hpack.renderPackage Hpack.defaultRenderSettings 2 [] [] pkg'
208199 hash = printSHA256 $ digestString (digestByName "sha256") hpackOutput
209200 case parseGenericPackageDescription hpackOutput of