cabal2nix 2.7.2 → 2.8
raw patch · 6 files changed
+28/−61 lines, 6 filesdep ~basedep ~hpackPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, hpack
API changes (from Hackage documentation)
Files
- cabal2nix.cabal +5/−49
- src/Cabal2nix.hs +10/−2
- src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs +1/−1
- src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs +1/−0
- src/Distribution/Nixpkgs/Haskell/FromCabal/Normalize.hs +9/−7
- src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs +2/−2
cabal2nix.cabal view
@@ -1,11 +1,5 @@--- This file has been generated from package.yaml by hpack version 0.21.2.------ see: https://github.com/sol/hpack------ hash: 92f9b21ea7d805cee72dd61ac36b18711504bee1d8e06b4dbffb9ade7fab4378- name: cabal2nix-version: 2.7.2+version: 2.8 synopsis: Convert Cabal files into Nix build instructions. description: Convert Cabal files into Nix build instructions. Users of Nix can install the latest version by running: .@@ -116,7 +110,7 @@ , filepath , hackage-db >2 , hopenssl >=2- , hpack+ , hpack == 0.21.* , language-nix , lens , optparse-applicative@@ -150,58 +144,26 @@ executable cabal2nix main-is: Main.hs- hs-source-dirs:- cabal2nix+ hs-source-dirs: cabal2nix ghc-options: -Wall- build-depends:- Cabal >2- , aeson- , ansi-wl-pprint- , base <5- , bytestring- , cabal2nix- , containers- , deepseq >=1.4- , directory- , distribution-nixpkgs >=1.1- , filepath- , hackage-db >2- , hopenssl >=2- , hpack- , language-nix- , lens- , optparse-applicative- , pretty >=1.1.2- , process- , split- , text- , time- , transformers- , yaml- other-modules:- Paths_cabal2nix+ build-depends: base, cabal2nix default-language: Haskell2010 executable hackage2nix main-is: Main.hs- hs-source-dirs:- hackage2nix+ hs-source-dirs: hackage2nix ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: Cabal >2 , aeson- , ansi-wl-pprint , base <5 , bytestring , cabal2nix , containers- , deepseq >=1.4 , directory , distribution-nixpkgs >=1.1 , filepath- , hackage-db >2 , hopenssl >=2- , hpack , language-nix , lens , monad-par@@ -209,13 +171,7 @@ , mtl , optparse-applicative , pretty >=1.1.2- , process- , split- , text- , time- , transformers , utf8-string- , yaml other-modules: Paths_cabal2nix HackageGit
src/Cabal2nix.hs view
@@ -19,10 +19,14 @@ import Distribution.Nixpkgs.Fetch import Distribution.Nixpkgs.Haskell import Distribution.Nixpkgs.Haskell.FromCabal+import Distribution.Nixpkgs.Haskell.FromCabal.Normalize ( normalizeCabalFlags )+import Distribution.Nixpkgs.Haskell.FromCabal.Flags import qualified Distribution.Nixpkgs.Haskell.FromCabal.PostProcess as PP (pkg)+import qualified Distribution.Nixpkgs.Haskell.Hackage as DB import Distribution.Nixpkgs.Haskell.PackageSourceSpec import Distribution.Nixpkgs.Meta import Distribution.PackageDescription ( mkFlagName, FlagAssignment )+import Distribution.Package ( packageId ) import Distribution.Simple.Utils ( lowercase ) import Distribution.System import Distribution.Text@@ -33,7 +37,6 @@ import System.IO ( hFlush, hPutStrLn, stdout, stderr ) import qualified Text.PrettyPrint.ANSI.Leijen as P2 hiding ( (<$>), (<>) ) import Text.PrettyPrint.HughesPJClass ( Doc, Pretty(..), text, vcat, hcat, semi )-import qualified Distribution.Nixpkgs.Haskell.Hackage as DB data Options = Options { optSha256 :: Maybe String@@ -159,12 +162,17 @@ let withHpackOverrides :: Derivation -> Derivation withHpackOverrides = if pkgRanHpack pkg then hpackOverrides else id++ flags :: FlagAssignment+ flags = normalizeCabalFlags $+ configureCabalFlags (packageId (pkgCabal pkg)) ++ readFlagList optFlags+ deriv :: Derivation deriv = withHpackOverrides $ fromGenericPackageDescription (const True) (\i -> Just (binding # (i, path # [i]))) optSystem (unknownCompilerInfo optCompiler NoAbiTag)- (readFlagList optFlags)+ flags [] (pkgCabal pkg) & src .~ pkgSource pkg
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs view
@@ -41,7 +41,7 @@ | name == "highlighting-kate" = [enable "pcre-light"] | name == "hlibsass" && version >= mkVersion [0,1,5] = [enable "externalLibsass"]- | name == "hmatrix" = [enable "openblas"]+ | name == "hmatrix" = [enable "openblas", enable "disable-default-paths"] | name == "hslua" = [enable "system-lua"] | name == "idris" = [enable "gmp", enable "ffi", enable "curses", ("execonly", version `withinRange` (orLaterVersion (mkVersion [1,1,1]))) ] | name == "io-streams" = [enable "NoInteractiveTests"]
src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs view
@@ -184,6 +184,7 @@ buildToolNixName "nix-env" = return "nix" buildToolNixName "nix-instantiate" = return "nix" buildToolNixName "nix-store" = return "nix"+buildToolNixName "fltk-config" = return "fltk" buildToolNixName x = return (fromString x) -- | Helper function to extract the package name from a String that may or may
src/Distribution/Nixpkgs/Haskell/FromCabal/Normalize.hs view
@@ -47,14 +47,16 @@ quote (c:cs) = c : quote cs quote [] = [] --- | When a flag is specified multiple times, the first occurrence counts. This--- is counter-intuitive, IMHO, but it's how cabal does it. Flag names are--- spelled in all lowercase.+-- | When a flag is specified multiple times, the last occurrence counts. Flag+-- names are spelled all lowercase. -- -- >>> normalizeCabalFlags [(mkFlagName "foo", True), (mkFlagName "FOO", True), (mkFlagName "Foo", False)]--- [(FlagName "foo",True)]+-- [(FlagName "foo",False)] normalizeCabalFlags :: FlagAssignment -> FlagAssignment-normalizeCabalFlags flags' = nubBy ((==) `on` fst) (sortBy (compare `on` fst) flags)- where- flags = [ (mkFlagName (lowercase (unFlagName n)), b) | (n, b) <- flags' ]+normalizeCabalFlags flags =+ sortBy (compare `on` fst) $+ reverse $+ nubBy ((==) `on` fst) $+ reverse $+ [ (mkFlagName (lowercase (unFlagName n)), b) | (n, b) <- flags ]
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs view
@@ -75,7 +75,7 @@ , ("hfsevents", hfseventsOverrides) , ("HFuse", set phaseOverrides hfusePreConfigure) , ("hlibgit2 >= 0.18.0.14", set (testDepends . tool . contains (pkg "git")) True)- , ("hmatrix", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e '/\\\\/usr\\\\//D'\";")+ , ("hmatrix < 0.18.1.1", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e '/\\\\/usr\\\\//D'\";") , ("holy-project", set doCheck False) -- attempts to access the network , ("hoogle", set testTarget "--test-option=--no-net") , ("hsignal < 0.2.7.4", set phaseOverrides "prePatch = \"rm -v Setup.lhs\";") -- https://github.com/amcphail/hsignal/issues/1@@ -126,7 +126,7 @@ , ("Win32-shortcut", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Windows))) , ("wxcore", set (libraryDepends . pkgconfig . contains (pkg "wxGTK")) True) , ("wxc", wxcHook)- , ("X11", over (libraryDepends . system) (Set.union (Set.fromList $ map bind ["pkgs.xorg.libXinerama","pkgs.xorg.libXext","pkgs.xorg.libXrender"])))+ , ("X11", over (libraryDepends . system) (Set.union (Set.fromList $ map bind ["pkgs.xorg.libXinerama","pkgs.xorg.libXext","pkgs.xorg.libXrender","pkgs.xorg.libXScrnSaver"]))) , ("xmonad", set phaseOverrides xmonadPostInstall) , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (bind "self.zip") (pkg "zip"))) , ("zip-archive >= 0.3.1", set (testDepends . tool . contains (pkg "zip")) True) -- https://github.com/jgm/zip-archive/issues/35