packages feed

cabal2nix 2.15.4 → 2.15.5

raw patch · 4 files changed

+11/−8 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Distribution.Nixpkgs.Haskell.Derivation: extraAttributes :: Lens' Derivation (Map String String)

Files

cabal2nix.cabal view
@@ -1,5 +1,5 @@ name:               cabal2nix-version:            2.15.4+version:            2.15.5 synopsis:           Convert Cabal files into Nix build instructions. description:   Convert Cabal files into Nix build instructions. Users of Nix can install the latest
src/Distribution/Nixpkgs/Fetch.hs view
@@ -77,7 +77,7 @@   pPrint DerivationSource {..} =     let isHackagePackage = "mirror://hackage/" `L.isPrefixOf` derivUrl         fetched = derivKind /= ""-    in if isHackagePackage then attr "sha256" $ string derivHash+    in if isHackagePackage then if derivHash /= "" then attr "sha256" $ string derivHash else mempty        else if not fetched then attr "src" $ text derivUrl             else vcat                  [ text "src" <+> equals <+> text ("fetch" ++ derivKind) <+> lbrace
src/Distribution/Nixpkgs/Haskell/Derivation.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-}@@ -9,13 +8,17 @@   , extraFunctionArgs, libraryDepends, executableDepends, testDepends, configureFlags   , cabalFlags, runHaddock, jailbreak, doCheck, doBenchmark, testTarget, hyperlinkSource, enableSplitObjs   , enableLibraryProfiling, enableExecutableProfiling, phaseOverrides, editedCabalFile, metaSection-  , dependencies, setupDepends, benchmarkDepends, enableSeparateDataOutput+  , dependencies, setupDepends, benchmarkDepends, enableSeparateDataOutput, extraAttributes   )   where +import Prelude hiding ((<>))+ import Control.DeepSeq import Control.Lens import Data.List ( isPrefixOf )+import Data.Map ( Map )+import qualified Data.Map as Map import Data.Set ( Set ) import qualified Data.Set as Set import Data.Set.Lens@@ -29,10 +32,6 @@ import Language.Nix import Language.Nix.PrettyPrinting -#if MIN_VERSION_base(4,11,0)-import Prelude hiding ((<>))-#endif- -- | A represtation of Nix expressions for building Haskell packages. -- The data type correspond closely to the definition of -- 'PackageDescription' from Cabal.@@ -45,6 +44,7 @@   , _isLibrary                  :: Bool   , _isExecutable               :: Bool   , _extraFunctionArgs          :: Set Binding+  , _extraAttributes            :: Map String String   , _setupDepends               :: BuildInfo   , _libraryDepends             :: BuildInfo   , _executableDepends          :: BuildInfo@@ -77,6 +77,7 @@   , _isLibrary = error "undefined Derivation.isLibrary"   , _isExecutable = error "undefined Derivation.isExecutable"   , _extraFunctionArgs = error "undefined Derivation.extraFunctionArgs"+  , _extraAttributes = error "undefined Derivation.extraAttributes"   , _setupDepends = error "undefined Derivation.setupDepends"   , _libraryDepends = error "undefined Derivation.libraryDepends"   , _executableDepends = error "undefined Derivation.executableDepends"@@ -138,6 +139,7 @@       , boolattr "hyperlinkSource" (not _hyperlinkSource) _hyperlinkSource       , onlyIf (not (null _phaseOverrides)) $ vcat ((map text . lines) _phaseOverrides)       , pPrint _metaSection+      , vcat [ attr k (text v) | (k,v) <- Map.toList _extraAttributes ]       ]     , rbrace     ]
src/Distribution/Nixpkgs/Haskell/FromCabal.hs view
@@ -83,6 +83,7 @@     & isLibrary .~ isJust library     & isExecutable .~ not (null executables)     & extraFunctionArgs .~ mempty+    & extraAttributes .~ mempty     & libraryDepends .~ foldMap (convertBuildInfo . libBuildInfo) (maybeToList library ++ subLibraries)     & executableDepends .~ mconcat (map (convertBuildInfo . buildInfo) executables)     & testDepends .~ mconcat (map (convertBuildInfo . testBuildInfo) testSuites)