git.iko.soy/typeable/cabal2nix
on master help sign in
Fix utf8 patch so that it actually compiles.
commitd6bbb40ec6c304151fb8cb0736f93d65d6ac5bb6 authorPeter Simons <simons@cryp.to> dateSat 11 Jun 2016, 14:50 (10 years ago) parent569b21b
3 files changed+6−6
distribution-nixpkgs/distribution-nixpkgs.cabal+2−2 distribution-nixpkgs/package.yaml+1−1 distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/PackageSourceSpec.hs+3−3
distribution-nixpkgs/distribution-nixpkgs.cabal+2−2
@@ -25,7 +25,7 @@ library
2525 ghc-options: -Wall
2626 build-depends:
2727 aeson
28− , base < 5
28+ , base > 4.2 && < 5
2929 , bytestring
3030 , Cabal >= 1.22.2
3131 , containers
@@ -78,7 +78,7 @@ test-suite spec
7878 ghc-options: -Wall
7979 build-depends:
8080 aeson
81− , base < 5
81+ , base > 4.2 && < 5
8282 , bytestring
8383 , Cabal >= 1.22.2
8484 , containers
distribution-nixpkgs/package.yaml+1−1
@@ -11,7 +11,7 @@ ghc-options: -Wall
1111
1212dependencies:
1313 - aeson
14− - base < 5
14+ - base > 4.2 && < 5
1515 - bytestring
1616 - Cabal >= 1.22.2
1717 - containers
distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/PackageSourceSpec.hs+3−3
@@ -19,7 +19,7 @@ import Distribution.Text ( simpleParse )
1919import System.Directory ( doesDirectoryExist, doesFileExist, createDirectoryIfMissing, getHomeDirectory, getDirectoryContents )
2020import System.Exit ( exitFailure )
2121import System.FilePath ( (</>), (<.>) )
22−import System.IO ( hPutStrLn, stderr, hPutStr, openFile, InputMode(ReadMode), hSetEncoding, utf8, hGetContents )
22+import System.IO ( hPutStrLn, stderr, hPutStr, openFile, IOMode(ReadMode), hSetEncoding, utf8, hGetContents )
2323
2424data Package = Package
2525 { pkgSource :: DerivationSource
@@ -143,9 +143,9 @@ cabalFromFile failHard file =
143143 -- wrap the whole block in `catchIO`, because of lazy IO. The `case` will force
144144 -- the reading of the file, so we will always catch the expression here.
145145 MaybeT $ handleIO (\err -> Nothing <$ hPutStrLn stderr ("*** parsing cabal file: " ++ show err)) $ do
146− inputHandle <- openFile ReadMode file
146+ inputHandle <- openFile file ReadMode
147147 hSetEncoding inputHandle utf8
148− content <- hGetContent inputHandle
148+ content <- hGetContents inputHandle
149149 case Cabal.parsePackageDescription content of
150150 Cabal.ParseFailed e | failHard -> do
151151 let (line, err) = ParseUtils.locatedErrorMsg e