cabal2nix 2.12 → 2.13
raw patch · 9 files changed
+39/−34 lines, 9 filesdep ~CabalPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Cabal
API changes (from Hackage documentation)
+ Cabal2nix: [optDoBenchmark] :: Options -> Bool
+ Distribution.Nixpkgs.Haskell.Derivation: doBenchmark :: Lens' Derivation Bool
- Cabal2nix: Options :: Maybe String -> [String] -> Bool -> Bool -> Bool -> Bool -> Maybe String -> Bool -> Bool -> Bool -> Maybe Bool -> [String] -> Maybe FilePath -> Bool -> [String] -> CompilerId -> Platform -> Maybe FilePath -> Maybe UTCTime -> NixpkgsResolver -> String -> Bool -> Options
+ Cabal2nix: Options :: Maybe String -> [String] -> Bool -> Bool -> Bool -> Bool -> Bool -> Maybe String -> Bool -> Bool -> Bool -> Maybe Bool -> [String] -> Maybe FilePath -> Bool -> [String] -> CompilerId -> Platform -> Maybe FilePath -> Maybe UTCTime -> NixpkgsResolver -> String -> Bool -> Options
Files
- cabal2nix.cabal +6/−4
- src/Cabal2nix.hs +3/−0
- src/Distribution/Nixpkgs/Haskell/Derivation.hs +4/−1
- src/Distribution/Nixpkgs/Haskell/FromCabal.hs +1/−0
- src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs +5/−13
- src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs +1/−1
- src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs +12/−3
- src/Distribution/Nixpkgs/Haskell/PackageSourceSpec.hs +4/−1
- test/Main.hs +3/−11
cabal2nix.cabal view
@@ -1,5 +1,5 @@ name: cabal2nix-version: 2.12+version: 2.13 synopsis: Convert Cabal files into Nix build instructions. description: Convert Cabal files into Nix build instructions. Users of Nix can install the latest@@ -74,7 +74,7 @@ Александр Цамутали maintainer: Peter Simons <simons@cryp.to> stability: stable-tested-with: GHC == 8.4.4, GHC == 8.6.2+tested-with: GHC == 8.4.4, GHC == 8.6.3 category: Distribution, Nix homepage: https://github.com/nixos/cabal2nix#readme bug-reports: https://github.com/nixos/cabal2nix/issues@@ -200,5 +200,7 @@ default-extensions: MonadFailDesugaring build-tools: cabal2nix ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wincomplete-record-updates- -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N- -with-rtsopts=-K1K+ -Wredundant-constraints -threaded -with-rtsopts=-K64K+ -- TODO: This ought to be 1K! ^^^+ -- https://github.com/NixOS/cabal2nix/issues/398+ -- https://github.com/feuerbach/tasty/issues/234
src/Cabal2nix.hs view
@@ -49,6 +49,7 @@ , optHpack :: Bool , optDoCheck :: Bool , optJailbreak :: Bool+ , optDoBenchmark :: Bool , optRevision :: Maybe String , optHyperlinkSource :: Bool , optEnableLibraryProfiling :: Bool@@ -76,6 +77,7 @@ <*> switch (long "hpack" <> help "run hpack before configuring this package (only non-hackage packages)") <*> flag True False (long "no-check" <> help "don't run regression test suites of this package") <*> switch (long "jailbreak" <> help "disregard version restrictions on build inputs")+ <*> switch (long "benchmark" <> help "enable benchmarks for this package") <*> optional (strOption $ long "revision" <> help "revision to use when fetching from VCS") <*> flag True False (long "no-hyperlink-source" <> help "don't generate pretty-printed source code for the documentation") <*> switch (long "enable-library-profiling" <> help "enable library profiling in the generated build")@@ -228,6 +230,7 @@ & metaSection.maintainers .~ Set.fromList (map (review ident) optMaintainer) -- & metaSection.platforms .~ Set.fromList optPlatform & doCheck &&~ optDoCheck+ & doBenchmark ||~ optDoBenchmark & extraFunctionArgs %~ Set.union (Set.fromList ("inherit stdenv":map (fromString . ("inherit " ++)) optExtraArgs)) shell :: Doc
src/Distribution/Nixpkgs/Haskell/Derivation.hs view
@@ -7,7 +7,7 @@ module Distribution.Nixpkgs.Haskell.Derivation ( Derivation, nullDerivation, pkgid, revision, src, subpath, isLibrary, isExecutable , extraFunctionArgs, libraryDepends, executableDepends, testDepends, configureFlags- , cabalFlags, runHaddock, jailbreak, doCheck, testTarget, hyperlinkSource, enableSplitObjs+ , cabalFlags, runHaddock, jailbreak, doCheck, doBenchmark, testTarget, hyperlinkSource, enableSplitObjs , enableLibraryProfiling, enableExecutableProfiling, phaseOverrides, editedCabalFile, metaSection , dependencies, setupDepends, benchmarkDepends, enableSeparateDataOutput )@@ -55,6 +55,7 @@ , _runHaddock :: Bool , _jailbreak :: Bool , _doCheck :: Bool+ , _doBenchmark :: Bool , _testTarget :: String , _hyperlinkSource :: Bool , _enableLibraryProfiling :: Bool@@ -86,6 +87,7 @@ , _runHaddock = error "undefined Derivation.runHaddock" , _jailbreak = error "undefined Derivation.jailbreak" , _doCheck = error "undefined Derivation.doCheck"+ , _doBenchmark = error "undefined Derivation.doBenchmark" , _testTarget = error "undefined Derivation.testTarget" , _hyperlinkSource = error "undefined Derivation.hyperlinkSource" , _enableLibraryProfiling = error "undefined Derivation.enableLibraryProfiling"@@ -131,6 +133,7 @@ , boolattr "doHaddock" (not _runHaddock) _runHaddock , boolattr "jailbreak" _jailbreak _jailbreak , boolattr "doCheck" (not _doCheck) _doCheck+ , boolattr "doBenchmark" _doBenchmark _doBenchmark , onlyIf (not (null _testTarget)) $ attr "testTarget" $ string _testTarget , boolattr "hyperlinkSource" (not _hyperlinkSource) _hyperlinkSource , onlyIf (not (null _phaseOverrides)) $ vcat ((map text . lines) _phaseOverrides)
src/Distribution/Nixpkgs/Haskell/FromCabal.hs view
@@ -91,6 +91,7 @@ & runHaddock .~ doHaddockPhase & jailbreak .~ False & doCheck .~ True+ & doBenchmark .~ False & testTarget .~ mempty & hyperlinkSource .~ True & enableSplitObjs .~ True
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs view
@@ -22,24 +22,16 @@ | name == "fltkhs" = [enable "opengl"] | name == "folds" = [disable "test-hlint"] | name == "git-annex" = [ enable "assistant"- , enable "cryptonite"+ , disable "benchmark" , enable "dbus"- , enable "desktopnotify"- , enable "dns"- , enable "feed"- , enable "inotify"+ , disable "debuglocks"+ , enable "magicmime" , enable "pairing" , enable "production"- , enable "quvi"- , disable "s3"- , enable "tahoe"- , enable "tdfa"- , ("testsuite", version `withinRange` "< 6.20170925 || >= 6.20171214")+ , enable "s3" , enable "torrentparser"- , disable "webapp"- , disable "webapp-secure"+ , enable "webapp" , enable "webdav"- , enable "xmpp" ] | name == "haskeline" = [enable "terminfo"] | name == "haste-compiler" = [enable "portable"]
src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs view
@@ -59,7 +59,7 @@ libNixName "gnome-vfs-2.0" = return "gnome-vfs" libNixName "gnome-vfs-module-2.0" = return "gnome-vfs_module" libNixName "gobject-2.0" = return "glib"-libNixName "gobject-introspection-1.0" = return "gobjectIntrospection"+libNixName "gobject-introspection-1.0" = return "gobject-introspection" libNixName "gstreamer-audio-0.10" = return "gst-plugins-base" libNixName "gstreamer-audio-1.0" = return "gst-plugins-base" libNixName "gstreamer-base-0.10" = return "gst-plugins-base"
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs view
@@ -147,9 +147,9 @@ , ("network-attoparsec", set doCheck False) -- test suite requires network access , ("numeric-qq", set doCheck False) -- test suite doesn't finish even after 1+ days , ("opencv", opencvOverrides)- , ("pandoc >= 1.16.0.2", set doCheck False) -- https://github.com/jgm/pandoc/issues/2709 and https://github.com/fpco/stackage/issues/1332- , ("pandoc", set jailbreak False) -- jailbreak-cabal break the build- , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/172+ , ("pandoc >= 1.16.0.2 && < 2.5", set doCheck False) -- https://github.com/jgm/pandoc/issues/2709 and https://github.com/fpco/stackage/issues/1332+ , ("pandoc", pandocOverrides)+ , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/369 , ("purescript", set doCheck False) -- test suite doesn't cope with Nix build env , ("proto-lens-protobuf-types", set (libraryDepends . tool . contains (pkg "protobuf")) True) , ("proto-lens-protoc", set (libraryDepends . tool . contains (pkg "protobuf")) True)@@ -381,3 +381,12 @@ , "pkgs.xorg.libXt" , "pkgs.xorg.libXmu" ]++pandocOverrides :: Derivation -> Derivation+pandocOverrides = set phaseOverrides postInstall+ where+ postInstall = unlines [ "postInstall = ''"+ , " mkdir -p $out/share"+ , " mv $data/*/*/man $out/share/"+ , "'';"+ ]
src/Distribution/Nixpkgs/Haskell/PackageSourceSpec.hs view
@@ -216,7 +216,10 @@ case mPackage of Left err -> liftIO $ hPutStrLn stderr ("*** hpack error: " ++ show err ++ ". Exiting.") >> exitFailure Right r -> do- let hpackOutput = encodeUtf8 $ Hpack.renderPackage [] (Hpack.decodeResultPackage r)+ let hpackOutput =+ let body = Hpack.renderPackage [] (Hpack.decodeResultPackage r)+ cabalVersion = Hpack.decodeResultCabalVersion r+ in encodeUtf8 $ cabalVersion ++ body hash = printSHA256 $ digest (digestByName "sha256") hpackOutput case runParseGenericPackageDescription "<hpack output>" hpackOutput of Left msg -> liftIO $ do
test/Main.hs view
@@ -99,14 +99,6 @@ -- * Helper functions ------------------------------------------------------------------------------- --- | Find all *files* in the given directory. This function does not recurse,--- nor does it include the special entries @'.'@ or @'..'@ in the result.--listDirectoryFiles :: FilePath -> IO [FilePath]-listDirectoryFiles dirPath = do- entries <- listDirectory dirPath- filterM doesFileExist (map (dirPath </>) entries)- -- | Find all *files* in the given directory that end with the given suffix. -- This function does not recurse, nor does it include the special entries -- @'.'@ or @'..'@ in the result.@@ -119,9 +111,9 @@ -- we prefer our own simpler code. listDirectoryFilesBySuffix :: String -> FilePath -> IO [FilePath]-listDirectoryFilesBySuffix suff =- fmap (filter ((suff ==) . takeExtension)) . listDirectoryFiles-+listDirectoryFilesBySuffix suff dirPath = do+ entries <- listDirectory dirPath+ filterM doesFileExist [ dirPath </> e | e <- entries, takeExtension e == suff ] -- | A variant of 'writeFile' that appends a newline to the end of the buffer -- before writing.