packages feed

distribution-nixpkgs 1.1.1 → 1.2

raw patch · 2 files changed

+55/−58 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Distribution.Nixpkgs.License: Unknown :: (Maybe String) -> License
+ Distribution.Nixpkgs.License: Unknown :: Maybe String -> License
- Distribution.Nixpkgs.PackageMap: readNixpkgPackageMap :: FilePath -> Maybe Path -> IO PackageMap
+ Distribution.Nixpkgs.PackageMap: readNixpkgPackageMap :: [String] -> IO PackageMap

Files

distribution-nixpkgs.cabal view
@@ -1,56 +1,55 @@-name:           distribution-nixpkgs-version:        1.1.1-synopsis:       Types and functions to manipulate the Nixpkgs distribution-description:    Types and functions to represent, query, and manipulate the Nixpkgs distribution.-category:       Distribution, Nix-homepage:       https://github.com/peti/distribution-nixpkgs#readme-bug-reports:    https://github.com/peti/distribution-nixpkgs/issues-maintainer:     Peter Simons <simons@cryp.to>-license:        BSD3-license-file:   LICENSE-build-type:     Simple-cabal-version:  >= 1.10-tested-with:    GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1+name:          distribution-nixpkgs+version:       1.2+synopsis:      Types and functions to manipulate the Nixpkgs distribution+description:   Types and functions to represent, query, and manipulate the Nixpkgs distribution.+license:       BSD3+license-file:  LICENSE+maintainer:    Peter Simons <simons@cryp.to>+tested-with:   GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.3+category:      Distribution, Nix+homepage:      https://github.com/peti/distribution-nixpkgs#readme+bug-reports:   https://github.com/peti/distribution-nixpkgs/issues+build-type:    Simple+cabal-version: >= 1.10  source-repository head-  type: git+  type:     git   location: https://github.com/peti/distribution-nixpkgs  library-  hs-source-dirs:-      src-  other-extensions: DeriveGeneric PackageImports RecordWildCards TemplateHaskell-  ghc-options: -Wall-  build-depends:-      aeson-    , base > 4.2 && < 5-    , bytestring-    , Cabal > 2.2-    , containers-    , deepseq >= 1.4-    , language-nix > 2-    , lens-    , pretty >= 1.1.2-    , process-    , split-  exposed-modules:-      Distribution.Nixpkgs.License-      Distribution.Nixpkgs.Meta-      Distribution.Nixpkgs.PackageMap-      Distribution.Nixpkgs.Hashes-      Language.Nix.PrettyPrinting-  default-language: Haskell2010+  exposed-modules:    Distribution.Nixpkgs.Hashes+                      Distribution.Nixpkgs.License+                      Distribution.Nixpkgs.Meta+                      Distribution.Nixpkgs.PackageMap+                      Language.Nix.PrettyPrinting+  hs-source-dirs:     src+  build-depends:      base         > 4.2 && < 5+                    , Cabal        > 2.2+                    , aeson+                    , bytestring+                    , containers+                    , deepseq      >= 1.4+                    , language-nix > 2+                    , lens+                    , pretty       >= 1.1.2+                    , process+                    , split+  default-language:   Haskell2010+  default-extensions: MonadFailDesugaring+  other-extensions:   CPP+                      TemplateHaskell+                      RecordWildCards+                      DeriveGeneric+                      PackageImports+  ghc-options:        -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates+                      -Wredundant-constraints  test-suite hspec-  type: exitcode-stdio-1.0-  main-is: hspec.hs-  hs-source-dirs:-      test-  ghc-options: -Wall-  build-depends:-      base-    , deepseq-    , distribution-nixpkgs-    , hspec-    , lens-  default-language: Haskell2010+  type:               exitcode-stdio-1.0+  main-is:            hspec.hs+  hs-source-dirs:     test+  build-depends:      base, deepseq, distribution-nixpkgs, hspec, lens+  default-language:   Haskell2010+  default-extensions: MonadFailDesugaring+  ghc-options:        -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates+                      -Wredundant-constraints
src/Distribution/Nixpkgs/PackageMap.hs view
@@ -3,30 +3,28 @@   , resolve   ) where +import Control.Lens import qualified Data.Aeson as JSON import qualified Data.ByteString.Lazy as LBS import Data.Function import Data.List as List import Data.List.Split-import qualified Data.Map.Strict as Map import Data.Map.Strict ( Map )+import qualified Data.Map.Strict as Map import Data.Maybe import Data.Set ( Set ) import qualified Data.Set as Set-import Distribution.Text import Language.Nix import System.Process-import Control.Lens  type PackageMap = Map Identifier (Set Path) -readNixpkgPackageMap :: FilePath -> Maybe Path -> IO PackageMap-readNixpkgPackageMap nixpkgs attrpath = fmap identifierSet2PackageMap (readNixpkgSet nixpkgs attrpath)+readNixpkgPackageMap :: [String] -> IO PackageMap+readNixpkgPackageMap = fmap identifierSet2PackageMap . readNixpkgSet -readNixpkgSet :: FilePath -> Maybe Path -> IO (Set String)-readNixpkgSet nixpkgs attrpath = do-  let extraArgs = maybe [] (\p -> ["-A", display p]) attrpath-  (_, Just h, _, _) <- createProcess (proc "nix-env" (["-qaP", "--json", "-f", nixpkgs] ++ extraArgs))+readNixpkgSet :: [String] -> IO (Set String)+readNixpkgSet extraArgs = do+  (_, Just h, _, _) <- createProcess (proc "nix-env" (["-qaP", "--json"] ++ extraArgs))                        { std_out = CreatePipe, env = Nothing }  -- TODO: ensure that overrides don't screw up our results   buf <- LBS.hGetContents h   let pkgmap :: Either String (Map String JSON.Object)