packages feed

stackage2nix 0.7.1 → 0.7.2

raw patch · 11 files changed

+35/−23 lines, 11 filesdep ~Cabal

Dependency ranges changed: Cabal

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+# 0.7.2+- Build with ghc-8.4+- Drop compatibility with Cabal<2.2+- Don't check extra-deps when generating derivation from stack.yaml+ # 0.7.1 - Generate stack packages `stack-yaml-packages.nix` 
src/AllCabalHashes.hs view
@@ -6,11 +6,10 @@ import Data.ByteString.Lazy as BSL import Data.Map as M import Data.Text as T-import Data.Text.Encoding as T import Distribution.Nixpkgs.Hashes as NH import Distribution.Package import Distribution.PackageDescription-import Distribution.PackageDescription.Parse+import Distribution.PackageDescription.Parsec import Distribution.Text ( display ) import Git import Git.Libgit2 as Libgit2@@ -46,9 +45,9 @@       BlobString bs -> return bs       BlobStringLazy bsl -> return $ BSL.toStrict bsl       _ -> fail $ "Git SHA1 " ++ show sha1Hash ++ ": expected single Blob"-  cabal <- case parseGenericPackageDescription (T.unpack $ T.decodeUtf8 buf) of-    ParseOk _ a     -> return a-    ParseFailed err -> fail ("Git SHA1 " ++ show sha1Hash ++ ": " ++ show err)+  cabal <- let (_, res) = runParseResult (parseGenericPackageDescription buf)+           in case res of Right a       -> return a+                          Left (_, err) -> fail ("Git SHA1 " ++ show sha1Hash ++ ": " ++ show err)   let     hash = printSHA256 (digest (digestByName "sha256") buf)     pkg  = setCabalFileHash hash cabal@@ -58,9 +57,9 @@ readPackageByName repoDir (PackageIdentifier name version) = do   let cabalFile = repoDir </> unPackageName name </> display version </> unPackageName name <.> "cabal"   buf <- BS.readFile cabalFile-  cabal <- case parseGenericPackageDescription (T.unpack $ T.decodeUtf8 buf) of-             ParseOk _ a  -> return a-             ParseFailed err -> fail (cabalFile ++ ": " ++ show err)+  cabal <- let (_, res) = runParseResult (parseGenericPackageDescription buf)+           in case res of Right a       -> return a+                          Left (_, err) -> fail (cabalFile ++ ": " ++ show err)   let     hash = NH.printSHA256 (SSL.digest (SSL.digestByName "sha256") buf)     pkg  = setCabalFileHash hash cabal
src/Distribution/Nixpkgs/Haskell/FromStack.hs view
@@ -68,14 +68,14 @@       (haskellResolver conf)       (targetPlatform conf)       (targetCompiler conf)-      flags+      (mkFlagAssignment flags)       (planDependencies plan)       (configureBenches . configureTests $ pkgCabal pkg)     genericDrv = fromPackageDescription       (haskellResolver conf)       (nixpkgsResolver conf)       missingDeps-      flags+      (mkFlagAssignment flags)       descr     depName (Dependency name _) = name     testDeps = setOf@@ -97,4 +97,5 @@ finalizePackage pkg pconf drv = drv   & src .~ pkgSource pkg   & doCheck &&~ enableCheck pconf+  & testDepends %~ (if enableCheck pconf then id else const mempty)   & runHaddock &&~ enableHaddock pconf
src/Distribution/Nixpkgs/Haskell/FromStack/Package.hs view
@@ -5,7 +5,6 @@ import Data.Function (on) import Data.Graph (Graph, Vertex) import Data.Maybe-import Data.Monoid import Data.Ord as O import Distribution.Text (display, disp) import Distribution.Package (unPackageName, packageName)
src/Distribution/Nixpkgs/Haskell/Packages/PrettyPrinting.hs view
@@ -2,6 +2,8 @@  import Language.Nix.PrettyPrinting +import Prelude hiding ((<>))+ compilerConfig :: Doc -> Doc compilerConfig body =   funargsCurried ["self", "super"] <+> body
src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs view
@@ -17,6 +17,8 @@ import           Language.Nix.PrettyPrinting as PP import           Stack.Config (StackResolver, unStackResolver) +import           Prelude hiding ((<>))+  data OverrideConfig = OverrideConfig   { _ocGhc              :: Version
src/Runner.hs view
@@ -50,9 +50,12 @@       let         stackResolver = stackConf ^. scResolver         stackPackagesConfig = mkStackPackagesConfig opts+        stackExtraDepsConfig = stackPackagesConfig+          & spcDoCheckPackages .~ False+          & spcDoHaddockPackages .~ False       stackConfPackages <- traverse (fmap mkNode . packageDerivation stackPackagesConfig hackageDb)         $ stackConf ^. scPackages-      stackConfExtraDeps  <- traverse (fmap mkNode . packageDerivation stackPackagesConfig hackageDb)+      stackConfExtraDeps  <- traverse (fmap mkNode . packageDerivation stackExtraDepsConfig hackageDb)         $ stackConf ^. scExtraDeps       let         stackConfAllPackages = maybe stackConfPackages ((<>) stackConfPackages)@@ -189,6 +192,6 @@   , _spcNixpkgsResolver   = \i -> Just (Nix.binding # (i, Nix.path # [i]))   , _spcTargetPlatform    = opts ^. optPlatform   , _spcTargetCompiler    = unknownCompilerInfo (opts ^. optCompilerId) NoAbiTag-  , _spcFlagAssignment    = []+  , _spcFlagAssignment    = mempty   , _spcDoCheckPackages   = opts ^. optDoCheckPackages   , _spcDoHaddockPackages = opts ^. optDoHaddockPackages }
src/Stack/Config.hs view
@@ -3,13 +3,11 @@ module Stack.Config where  import Control.Lens-import Data.Bifunctor import Data.ByteString as BS import Data.Coerce import Data.List as L import Data.List.NonEmpty as NE import Data.Maybe-import Data.Semigroup import Data.Text as T import Data.Yaml import Network.URI@@ -192,4 +190,4 @@     mkStackConfig = over (scPackages . traversed . spLocation) relativeToStackYaml       . over (scExtraDeps . traversed . spLocation) relativeToStackYaml       . fromYamlConfig-  second mkStackConfig . decodeEither <$> BS.readFile (stackYaml ^. syFilePath)+  bimap show mkStackConfig . decodeEither' <$> BS.readFile (stackYaml ^. syFilePath)
stackage2nix.cabal view
@@ -1,5 +1,5 @@ name:                stackage2nix-version:             0.7.1+version:             0.7.2 synopsis:            Convert Stack files into Nix build instructions. homepage:            https://github.com/typeable/stackage2nix#readme license:             BSD3@@ -31,7 +31,7 @@                      , LtsHaskell                      , Paths_stackage2nix   build-depends:       base > 4.7 && < 5-                     , Cabal > 2+                     , Cabal > 2.2                      , QuickCheck                      , aeson                      , bytestring
test/Stack/Config/YamlSpec.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} -module Stack.Config.YamlSpec where+module Stack.Config.YamlSpec (spec) where  import Data.ByteString import Data.Text.Encoding as T@@ -150,8 +150,11 @@ spec :: Spec spec = describe "Config" $ do   specify "minimal" $-    (Y.decode configYamlMinimal :: Maybe Config) `shouldBe` Just configMinimal+    (decodeMaybe configYamlMinimal :: Maybe Config) `shouldBe` Just configMinimal   specify "full" $-    (Y.decode configYaml :: Maybe Config) `shouldBe` Just config+    (decodeMaybe configYaml :: Maybe Config) `shouldBe` Just config   specify "new" $-    (Y.decode configNewYaml :: Maybe Config) `shouldBe` Just configNew+    (decodeMaybe configNewYaml :: Maybe Config) `shouldBe` Just configNew++decodeMaybe :: ByteString -> Maybe Config+decodeMaybe = either (const Nothing) id . Y.decodeEither'
test/Stack/ConfigSpec.hs view
@@ -31,7 +31,7 @@     $ checkYamlConfig packageExtraDepsNewBs packageExtraDepsNewConf  parseYamlConfig :: ByteString -> Maybe StackConfig-parseYamlConfig = fmap fromYamlConfig . Y.decode+parseYamlConfig = either (const Nothing) (Just . fromYamlConfig) . Y.decodeEither'  checkYamlConfig :: ByteString -> StackConfig -> Expectation checkYamlConfig bs sc = parseYamlConfig bs `shouldBe` Just sc