packages feed

cabal2nix 2.19.1 → 2.20.0

raw patch · 18 files changed

+765/−89 lines, 18 filesdep +ansi-terminaldep ~Cabaldep ~basePVP ok

version bump matches the API change (PVP)

Dependencies added: ansi-terminal

Dependency ranges changed: Cabal, base

API changes (from Hackage documentation)

- Distribution.Nixpkgs.Haskell.Derivation: enableSplitObjs :: Lens' Derivation Bool
- Distribution.Nixpkgs.Haskell.Derivation: testTarget :: Lens' Derivation String
+ Distribution.Nixpkgs.Color: colorStderrLn :: MonadIO m => [SGR] -> String -> m ()
+ Distribution.Nixpkgs.Color: commandColor :: [SGR]
+ Distribution.Nixpkgs.Color: errorColor :: [SGR]
+ Distribution.Nixpkgs.Color: infoColor :: [SGR]
+ Distribution.Nixpkgs.Color: maybeColor :: Handle -> [SGR] -> String -> IO String
+ Distribution.Nixpkgs.Color: warningColor :: [SGR]
+ Distribution.Nixpkgs.Haskell.Derivation: testFlags :: Lens' Derivation [String]
+ Distribution.Nixpkgs.Haskell.Derivation: testTargets :: Lens' Derivation [String]

Files

CHANGELOG.md view
@@ -1,5 +1,39 @@ # Revision History for cabal2nix +## 2.20.0++* `cabal2nix` now [prints the commands it runs when fetching sources](https://github.com/nixOS/cabal2nix/commit/5327953d299eba0b6de4e88bacf4bba9022bb5e2).+* `cabal2nix` now [produces colorful output](https://github.com/NixOS/cabal2nix/pull/636)+  using ANSI SGR escape sequences when printing to a TTY.+  This can be disabled using the [`NO_COLOR` environment variable](https://no-color.org/)+  or forcibly enabled using `FORCE_COLOR`.+* `hackage2nix` now defaults internally to an utf-8 locale, ignoring enviroment+  variables.+* `cabal2nix` now exclusively uses the new+  [plural testTargets](https://github.com/NixOS/nixpkgs/pull/306283)+  argument.+  * This is an **API breaking change**: `_testTarget` was removed in+    favor of `_testTargets`.+  * Expressions using `_testTargets` will only work with+    Nixpkgs 24.11, 25.05 or newer.+    **Warning**: As of this writing (2025-03-10), the unstable channels of+    nixpkgs don't support testTargets yet. Inclusion is tracked by+    [nixpkgs#371032](https://github.com/NixOS/nixpkgs/pull/371032).+* Added support for the [testFlags argument](https://github.com/NixOS/nixpkgs/pull/126364),+  available since 21.11, to `Derivation`. **API breaking change**.+* Remove `_enableSplitObjs` from `Derivation` since it [hasn't been+  supported by Nixpkgs in a while](https://github.com/nixOS/nixpkgs/commit/a62b24be6d650757deb8fe222763f436a53650ff),+  **API breaking change**.+* Added and updated various library name to Nixpkgs attribute name mappings.+* Dropped/reduced post-processing hooks for+  * `pandoc`+  * `git-annex`+  * `haddock`+  * `tz`+* Postprocessing hooks utilising `replace` no longer fail when they can't find+  the binding to replace. This fixes an issue where `cabal2nix` would fail to+  generate an expression for a package when `hackage2nix` would succeed.+ ## 2.19.1  **Warning**: This version of `cabal2nix` generates Nix expressions that
cabal2nix.cabal view
@@ -1,5 +1,5 @@ name:               cabal2nix-version:            2.19.1+version:            2.20.0 synopsis:           Convert Cabal files into Nix build instructions. description:   Convert Cabal files into Nix build instructions. Users of Nix can install the latest@@ -12,14 +12,14 @@ -- list all contributors: git log --pretty='%an' | sort | uniq maintainer:         sternenseemann <sternenseemann@systemli.org> stability:          stable-tested-with:        GHC == 8.8.4 || == 8.10.7 || == 9.0.2 || == 9.2.2+tested-with:        GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.6 || == 9.8.3 || == 9.10.1 category:           Distribution, Nix homepage:           https://github.com/nixos/cabal2nix#readme bug-reports:        https://github.com/nixos/cabal2nix/issues build-type:         Simple-extra-source-files: README.md+extra-doc-files:    README.md                     CHANGELOG.md-                    test/golden-test-cases/*.cabal+extra-source-files: test/golden-test-cases/*.cabal                     test/golden-test-cases/*.nix.golden cabal-version:      1.24 @@ -30,6 +30,7 @@  library   exposed-modules:    Cabal2nix+                      Distribution.Nixpkgs.Color                       Distribution.Nixpkgs.Fetch                       Distribution.Nixpkgs.Haskell                       Distribution.Nixpkgs.Haskell.BuildInfo@@ -48,11 +49,12 @@                       Distribution.Nixpkgs.Haskell.Platform   other-modules:      Paths_cabal2nix   hs-source-dirs:     src-  build-depends:      base                 > 4.11+  build-depends:      base                 > 4.11 && <5                     -- When changing the Cabal version, ensure that it builds                     -- with all installation methods mentioned in the README!                     , Cabal                >= 3.0                     , aeson                > 1+                    , ansi-terminal                     , ansi-wl-pprint                     , bytestring                     , containers           >= 0.5.9
hackage2nix/Main.hs view
@@ -41,6 +41,7 @@ import Data.List.NonEmpty (NonEmpty) import Data.Semigroup (sconcat) import Options.Applicative.NonEmpty (some1)+import GHC.IO.Encoding (setLocaleEncoding)  type PackageSet = Map PackageName Version type PackageMultiSet = Map PackageName (Set Version)@@ -56,6 +57,7 @@  main :: IO () main = do+  setLocaleEncoding utf8   let cliOptions :: Parser CLI       cliOptions = CLI         <$> strOption (long "hackage" <> help "path to Hackage git repository" <> value "hackage" <> showDefaultWith id <> metavar "PATH")@@ -174,7 +176,7 @@     return (intercalate "\n\n" defs)    withFile hackagePackagesFile WriteMode $ \h -> do-    hPutStrLn h "/* hackage-packages.nix is an auto-generated file -- DO NOT EDIT! */"+    hPutStrLn h "/* hackage-packages.nix is auto-generated by hackage2nix -- DO NOT EDIT MANUALLY! */"     hPutStrLn h ""     hPutStrLn h "{ pkgs, lib, callPackage }:"     hPutStrLn h ""
src/Cabal2nix.hs view
@@ -17,6 +17,7 @@ import Data.String import Data.Time import Distribution.Compiler+import Distribution.Nixpkgs.Color (colorStderrLn, warningColor) import Distribution.Nixpkgs.Fetch import Distribution.Nixpkgs.Haskell import Distribution.Nixpkgs.Haskell.FromCabal@@ -36,7 +37,7 @@ import Options.Applicative import Paths_cabal2nix ( version ) import System.Environment ( getArgs )-import System.IO ( hFlush, hPutStrLn, stdout, stderr )+import System.IO ( hFlush, stdout, stderr ) import qualified Text.PrettyPrint.ANSI.Leijen as P2 import Text.PrettyPrint.HughesPJClass ( Doc, Pretty(..), text, vcat, hcat, semi, render, prettyShow ) @@ -188,8 +189,8 @@  cabal2nixWithDB :: DB.HackageDB -> Options -> IO (Either Doc Derivation) cabal2nixWithDB db opts@Options{..} = do-  when (isJust optHackageDb) $ hPutStrLn stderr "WARN: HackageDB provided directly; ignoring --hackage-db"-  when (isJust optHackageSnapshot) $ hPutStrLn stderr "WARN: HackageDB provided directly; ignoring --hackage-snapshot"+  when (isJust optHackageDb) $ colorStderrLn warningColor "WARN: HackageDB provided directly; ignoring --hackage-db"+  when (isJust optHackageSnapshot) $ colorStderrLn warningColor "WARN: HackageDB provided directly; ignoring --hackage-snapshot"   pkg <- getPackage' optHpack optFetchSubmodules (return db) $          Source {            sourceUrl = optUrl,
+ src/Distribution/Nixpkgs/Color.hs view
@@ -0,0 +1,70 @@+module Distribution.Nixpkgs.Color+    ( maybeColor+    , colorStderrLn+    , infoColor+    , warningColor+    , errorColor+    , commandColor+    ) where++import System.Environment (lookupEnv)+import System.IO (Handle, hIsTerminalDevice, hPutStrLn, stderr)+import System.Console.ANSI.Codes+    ( setSGRCode+    , SGR(Reset, SetColor, SetConsoleIntensity)+    , ConsoleLayer(Foreground)+    , ColorIntensity(Vivid)+    , Color(Yellow, Red, Cyan)+    , ConsoleIntensity(BoldIntensity)+    )+import Control.Monad.IO.Class (MonadIO(liftIO))++-- | Colors that indicate a warning message.+warningColor :: [SGR]+warningColor = [SetColor Foreground Vivid Yellow]++infoColor :: [SGR]+infoColor = [SetColor Foreground Vivid Cyan]++-- | Colors that indicate an error message.+errorColor :: [SGR]+errorColor = [SetColor Foreground Vivid Red, SetConsoleIntensity BoldIntensity]++-- | Colors that indicate a command is being executed.+commandColor :: [SGR]+commandColor = [SetColor Foreground Vivid Cyan, SetConsoleIntensity BoldIntensity]++-- | Check if an environment variable is set and non-empty.+envIsSet :: String -> IO Bool+envIsSet name = do+    value <- lookupEnv name+    pure $ case value of+       Nothing -> False+       Just "" -> False+       Just _ -> True++-- | Should output to the given `Handle` be colored?+shouldColor :: Handle -> IO Bool+shouldColor handle = do+    -- See: https://no-color.org/+    noColor <- envIsSet "NO_COLOR"+    if noColor+       then pure False+       else do+           forceColor <- envIsSet "FORCE_COLOR"+           if forceColor+              then pure True+              else hIsTerminalDevice handle++-- | If the given `Handle` should be colored, wrap a `String` in `SGR` codes.+maybeColor :: Handle -> [SGR] -> String -> IO String+maybeColor handle sgrCodes original = do+    shouldColor' <- shouldColor handle+    if not shouldColor'+       then pure original+       else pure $ setSGRCode sgrCodes <> original <> setSGRCode [Reset]++colorStderrLn :: MonadIO m => [SGR] -> String -> m ()+colorStderrLn sgrCodes original = liftIO $ do+    maybeColored <- maybeColor stderr sgrCodes original+    hPutStrLn stderr maybeColored
src/Distribution/Nixpkgs/Fetch.hs view
@@ -25,12 +25,12 @@ import qualified Data.ByteString.Lazy.Char8 as BS import qualified Data.List as L import Data.Maybe+import Distribution.Nixpkgs.Color (colorStderrLn, commandColor, warningColor) import GHC.Generics ( Generic ) import Language.Nix.PrettyPrinting as PP import System.Directory import System.Environment import System.Exit-import System.IO import System.Process  -- | A source is a location from which we can fetch, such as a HTTP URL, a GIT URL, ....@@ -219,7 +219,7 @@ fetchWith :: (Bool, DerivKind) -> Source -> MaybeT IO (DerivationSource, FilePath) fetchWith (supportsRev, kind) source = do   unless ((sourceRevision source /= "") || isUnknown (sourceHash source) || not supportsRev) $-    liftIO (hPutStrLn stderr "** need a revision for VCS when the hash is given. skipping.") >> mzero+    colorStderrLn warningColor "** need a revision for VCS when the hash is given. skipping." >> mzero    let (script, extraArgs) = case kind of         DerivKindUrl UnpackArchive ->  ("nix-prefetch-url", ["--unpack"])@@ -235,6 +235,8 @@          ++ sourceUrl source          : [ sourceRevision source | supportsRev ]          ++ hashToList (sourceHash source)++  colorStderrLn commandColor $ "$ " ++ unwords (script:args)    MaybeT $ liftIO $ do     envs <- getEnvironment
src/Distribution/Nixpkgs/Haskell/Derivation.hs view
@@ -6,7 +6,7 @@ module Distribution.Nixpkgs.Haskell.Derivation   ( Derivation, nullDerivation, pkgid, revision, src, subpath, isLibrary, isExecutable   , extraFunctionArgs, libraryDepends, executableDepends, testDepends, configureFlags-  , cabalFlags, runHaddock, jailbreak, doCheck, doBenchmark, testTarget, hyperlinkSource, enableSplitObjs+  , cabalFlags, runHaddock, jailbreak, doCheck, doBenchmark, testFlags, testTargets, hyperlinkSource   , enableLibraryProfiling, enableExecutableProfiling, phaseOverrides, editedCabalFile, metaSection   , dependencies, setupDepends, benchmarkDepends, enableSeparateDataOutput, extraAttributes   )@@ -56,11 +56,11 @@   , _jailbreak                  :: Bool   , _doCheck                    :: Bool   , _doBenchmark                :: Bool-  , _testTarget                 :: String+  , _testFlags                  :: [String]+  , _testTargets                :: [String]   , _hyperlinkSource            :: Bool   , _enableLibraryProfiling     :: Bool   , _enableExecutableProfiling  :: Bool-  , _enableSplitObjs            :: Bool   , _phaseOverrides             :: String   , _editedCabalFile            :: String   , _enableSeparateDataOutput   :: Bool@@ -89,11 +89,11 @@   , _jailbreak = error "undefined Derivation.jailbreak"   , _doCheck = error "undefined Derivation.doCheck"   , _doBenchmark = error "undefined Derivation.doBenchmark"-  , _testTarget = error "undefined Derivation.testTarget"+  , _testFlags = error "undefined Derivation.testFlags"+  , _testTargets = error "undefined Derivation.testTargets"   , _hyperlinkSource = error "undefined Derivation.hyperlinkSource"   , _enableLibraryProfiling = error "undefined Derivation.enableLibraryProfiling"   , _enableExecutableProfiling = error "undefined Derivation.enableExecutableProfiling"-  , _enableSplitObjs = error "undefined Derivation.enableSplitObjs"   , _phaseOverrides = error "undefined Derivation.phaseOverrides"   , _editedCabalFile = error "undefined Derivation.editedCabalFile"   , _enableSeparateDataOutput = error "undefined Derivation.enableSeparateDataOutput"@@ -130,12 +130,12 @@       , onlyIf (_benchmarkDepends /= mempty) $ pPrintBuildInfo "benchmark" _benchmarkDepends       , boolattr "enableLibraryProfiling" _enableLibraryProfiling _enableLibraryProfiling       , boolattr "enableExecutableProfiling" _enableExecutableProfiling _enableExecutableProfiling-      , boolattr "enableSplitObjs"  (not _enableSplitObjs) _enableSplitObjs       , 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+      , onlyIf (not (null _testFlags)) $ listattr "testFlags" empty (map show _testFlags)+      , onlyIf (not (null _testTargets)) $ listattr "testTargets" empty (map show _testTargets)       , boolattr "hyperlinkSource" (not _hyperlinkSource) _hyperlinkSource       , onlyIf (not (null _phaseOverrides)) $ vcat ((map text . lines) _phaseOverrides)       , pPrint _metaSection
src/Distribution/Nixpkgs/Haskell/FromCabal.hs view
@@ -112,9 +112,9 @@     & jailbreak .~ False     & doCheck .~ True     & doBenchmark .~ False-    & testTarget .~ mempty+    & testFlags .~ mempty+    & testTargets .~ mempty     & hyperlinkSource .~ True-    & enableSplitObjs .~ True     & enableLibraryProfiling .~ False     & enableExecutableProfiling .~ False     & enableSeparateDataOutput .~ not (null dataFiles)
src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration.hs view
@@ -19,7 +19,7 @@ import Data.Aeson import Data.Map as Map import Data.Set as Set-import Data.Text as T+import qualified Data.Text as T import Data.Yaml import Distribution.Compiler import Distribution.Nixpkgs.Haskell.Constraint@@ -105,7 +105,7 @@ instance FromJSONKey PackageName where   fromJSONKey = FromJSONKeyText parseKey -parseKey :: FromJSON k => Text -> k+parseKey :: FromJSON k => T.Text -> k parseKey s = either error id (parseEither parseJSON (String s))  readConfiguration :: FilePath -> IO Configuration
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs view
@@ -24,18 +24,17 @@  | name == "diagrams-builder"   = [enable "cairo", enable "svg", enable "ps", enable "rasterific"]  | name == "fltkhs"             = [enable "opengl"]  | name == "folds"              = [disable "test-hlint"]- | name == "git-annex"          = [ enable "assistant"+ | name == "git-annex"          = [ -- default+                                    enable "assistant"+                                  , disable "debuglocks"+                                    -- custom                                   , disable "benchmark"+                                  , enable "crypton"                                   , enable "dbus"-                                  , disable "debuglocks"                                   , enable "magicmime"-                                  , enable "networkbsd"                                   , enable "pairing"                                   , enable "production"-                                  , enable "s3"                                   , enable "torrentparser"-                                  , enable "webapp"-                                  , enable "webdav"                                   ]  | name == "haskeline"          = [enable "terminfo"]  | name == "haste-compiler"     = [enable "portable"]
src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs view
@@ -28,6 +28,7 @@ libNixName "appindicator-0.1"                   = return "libappindicator-gtk2" libNixName "appindicator3-0.1"                  = return "libappindicator-gtk3" libNixName "asound"                             = return "alsa-lib"+libNixName "ayatana-appindicator3-0.1"          = return "libayatana-appindicator" libNixName "b2"                                 = return "libb2" libNixName "boost_context"                      = return "boost" libNixName "bz2"                                = return "bzip2"@@ -60,12 +61,15 @@ libNixName "GLEW"                               = return "glew" libNixName "GLU"                                = ["libGLU","libGL"] libNixName "glut"                               = ["freeglut","libGLU","libGL"]-libNixName "gnome-keyring"                      = return "gnome-keyring"+libNixName "gmodule"                            = return "glib"+libNixName "gmodule-2.0"                        = return "glib"+libNixName "gnome-keyring"                      = return "libgnome-keyring" libNixName "gnome-keyring-1"                    = return "libgnome-keyring" 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 "gobject-introspection"+libNixName "graphene-gobject-1.0"               = return "graphene" 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"@@ -79,10 +83,23 @@ libNixName "gtk+-2.0"                           = return "gtk2" libNixName "gtk+-3.0"                           = return "gtk3" libNixName "gtk-x11-2.0"                        = return "gtk_x11"+libNixName "gtk4-atspi"                         = return "gtk4"+libNixName "gtk4-broadway"                      = return "gtk4"+libNixName "gtk4"                               = return "gtk4"+libNixName "gtk4-unix-print"                    = return "gtk4"+libNixName "gtk4-wayland"                       = return "gtk4"+libNixName "gtk4-x11"                           = return "gtk4" libNixName "gtksourceview-3.0"                  = return "gtksourceview3"+libNixName "gtksourceview-5"                    = return "gtksourceview5"+libNixName "harfbuzz-gobject"                   = return "harfbuzz"+libNixName "harfbuzz-subset"                    = return "harfbuzz" libNixName "hidapi-libusb"                      = return "hidapi"+libNixName "icu-i18n"                           = return "icu"+libNixName "icu-io"                             = return "icu"+libNixName "icu-uc"                             = return "icu" libNixName "icudata"                            = return "icu" libNixName "icui18n"                            = return "icu"+libNixName "icuio"                              = return "icu" libNixName "icuuc"                              = return "icu" libNixName "idn"                                = return "libidn" libNixName "IL"                                 = return "libdevil"@@ -90,7 +107,10 @@ libNixName "Imlib2"                             = return "imlib2" libNixName "iw"                                 = return "wirelesstools" libNixName "jack"                               = return "libjack2"-libNixName "javascriptcoregtk-4.0"              = return "webkitgtk"+libNixName "javascriptcoregtk"                  = return "webkitgtk"+libNixName "javascriptcoregtk-4.0"              = return "webkitgtk_4_0"+libNixName "javascriptcoregtk-4.1"              = return "webkitgtk_4_1"+libNixName "javascriptcoregtk-6.0"              = return "webkitgtk_6_0" libNixName "jpeg"                               = return "libjpeg" libNixName "jvm"                                = return "jdk" libNixName "lapack"                             = return "liblapack"@@ -99,14 +119,21 @@ libNixName "libavutil"                          = return "ffmpeg" libNixName "libbrotlienc"                       = return "brotli" libNixName "libbrotlidec"                       = return "brotli"+libNixName "libcurl"                            = return "curl" libNixName "libgsasl"                           = return "gsasl"+libNixName "liblzma"                            = return "xz"+libNixName "libnm"                              = return "networkmanager" libNixName "libpcre"                            = return "pcre" libNixName "libpcre2"                           = return "pcre2" libNixName "libpcre2-8"                         = libNixName "libpcre2"+libNixName "libpipewire-0.3"                    = return "pipewire" libNixName "libqrencode"                        = return "qrencode" libNixName "libR"                               = return "R" libNixName "libsecp256k1"                       = return "secp256k1"-libNixName "libsoup-gnome-2.4"                  = return "libsoup"+libNixName "libsoup-2.4"                        = return "libsoup_2_4"+libNixName "libsoup-gnome-2.4"                  = return "libsoup_2_4"+libNixName "libsoup-3.0"                        = return "libsoup_3"+libNixName "libspa-0.2"                         = return "pipewire" libNixName "libsystemd"                         = return "systemd" libNixName "libudev"                            = return "systemd" libNixName "libxml-2.0"                         = return "libxml2"@@ -121,7 +148,7 @@ libNixName "mpi"                                = return "openmpi" libNixName "mysql"                              = return "mariadb" libNixName "ncursesw"                           = return "ncurses"-libNixName "netsnmp"                            = return "net_snmp"+libNixName "netsnmp"                            = return "net-snmp" libNixName "nix-cmd"                            = return "nix" libNixName "nix-expr"                           = return "nix" libNixName "nix-main"                           = return "nix"@@ -170,16 +197,22 @@ libNixName "udev"                               = return "systemd"; libNixName "uuid"                               = return "libossp_uuid"; libNixName "vte-2.91"                           = return "vte_291"+libNixName "vulkan"                             = return "vulkan-loader" libNixName "wayland-client"                     = return "wayland" libNixName "wayland-cursor"                     = return "wayland" libNixName "wayland-egl"                        = return "libGL" libNixName "wayland-server"                     = return "wayland"-libNixName "webkit"                             = return "webkitgtk"+libNixName "webkit"                             = return "webkitgtk" -- this is an alias, so it only works for downstream expressions not in hackage-packages.nix libNixName "webkit2gtk"                         = return "webkitgtk"-libNixName "webkit2gtk-4.0"                     = return "webkitgtk"-libNixName "webkit2gtk-web-extension-4.0"       = return "webkitgtk"+libNixName "webkit2gtk-4.0"                     = return "webkitgtk_4_0"+libNixName "webkit2gtk-4.1"                     = return "webkitgtk_4_1"+libNixName "webkit2gtk-6.0"                     = return "webkitgtk_6_0"+libNixName "webkit2gtk-web-extension-4.0"       = return "webkitgtk_4_0"+libNixName "webkit2gtk-web-extension-4.1"       = return "webkitgtk_4_1"+libNixName "webkit2gtk-web-extension-6.0"       = return "webkitgtk_6_0"+libNixName "wxGTK"                              = return "wxGTK32" libNixName "X11"                                = return "libX11"-libNixName "x11"                                = return "xlibsWrapper"+libNixName "x11"                                = return "libX11" libNixName "xau"                                = return "libXau" libNixName "Xcursor"                            = return "libXcursor" libNixName "xerces-c"                           = return "xercesc"@@ -200,6 +233,73 @@ libNixName "yaml-0.1"                           = return "libyaml" libNixName "z"                                  = return "zlib" libNixName "zmq"                                = return "zeromq"+libNixName "TKBO"                               = return "opencascade-occt"+libNixName "TKBRep"                             = return "opencascade-occt"+libNixName "TKBin"                              = return "opencascade-occt"+libNixName "TKBinL"                             = return "opencascade-occt"+libNixName "TKBinTObj"                          = return "opencascade-occt"+libNixName "TKBinXCAF"                          = return "opencascade-occt"+libNixName "TKBool"                             = return "opencascade-occt"+libNixName "TKCAF"                              = return "opencascade-occt"+libNixName "TKCDF"                              = return "opencascade-occt"+libNixName "TKDCAF"                             = return "opencascade-occt"+libNixName "TKDE"                               = return "opencascade-occt"+libNixName "TKDECascade"                        = return "opencascade-occt"+libNixName "TKDEGLTF"                           = return "opencascade-occt"+libNixName "TKDEIGES"                           = return "opencascade-occt"+libNixName "TKDEOBJ"                            = return "opencascade-occt"+libNixName "TKDEPLY"                            = return "opencascade-occt"+libNixName "TKDESTEP"                           = return "opencascade-occt"+libNixName "TKDESTL"                            = return "opencascade-occt"+libNixName "TKDEVRML"                           = return "opencascade-occt"+libNixName "TKDraw"                             = return "opencascade-occt"+libNixName "TKExpress"                          = return "opencascade-occt"+libNixName "TKFeat"                             = return "opencascade-occt"+libNixName "TKFillet"                           = return "opencascade-occt"+libNixName "TKG2d"                              = return "opencascade-occt"+libNixName "TKG3d"                              = return "opencascade-occt"+libNixName "TKGeomAlgo"                         = return "opencascade-occt"+libNixName "TKGeomBase"                         = return "opencascade-occt"+libNixName "TKHLR"                              = return "opencascade-occt"+libNixName "TKLCAF"                             = return "opencascade-occt"+libNixName "TKMath"                             = return "opencascade-occt"+libNixName "TKMesh"                             = return "opencascade-occt"+libNixName "TKMeshVS"                           = return "opencascade-occt"+libNixName "TKOffset"                           = return "opencascade-occt"+libNixName "TKOpenGl"                           = return "opencascade-occt"+libNixName "TKOpenGlTest"                       = return "opencascade-occt"+libNixName "TKPrim"                             = return "opencascade-occt"+libNixName "TKQADraw"                           = return "opencascade-occt"+libNixName "TKRWMesh"                           = return "opencascade-occt"+libNixName "TKService"                          = return "opencascade-occt"+libNixName "TKShHealing"                        = return "opencascade-occt"+libNixName "TKStd"                              = return "opencascade-occt"+libNixName "TKStdL"                             = return "opencascade-occt"+libNixName "TKTObj"                             = return "opencascade-occt"+libNixName "TKTObjDRAW"                         = return "opencascade-occt"+libNixName "TKTopAlgo"                          = return "opencascade-occt"+libNixName "TKTopTest"                          = return "opencascade-occt"+libNixName "TKV3d"                              = return "opencascade-occt"+libNixName "TKVCAF"                             = return "opencascade-occt"+libNixName "TKViewerTest"                       = return "opencascade-occt"+libNixName "TKXCAF"                             = return "opencascade-occt"+libNixName "TKXDEDRAW"                          = return "opencascade-occt"+libNixName "TKXMesh"                            = return "opencascade-occt"+libNixName "TKXSBase"                           = return "opencascade-occt"+libNixName "TKXSDRAW"                           = return "opencascade-occt"+libNixName "TKXSDRAWDE"                         = return "opencascade-occt"+libNixName "TKXSDRAWGLTF"                       = return "opencascade-occt"+libNixName "TKXSDRAWIGES"                       = return "opencascade-occt"+libNixName "TKXSDRAWOBJ"                        = return "opencascade-occt"+libNixName "TKXSDRAWPLY"                        = return "opencascade-occt"+libNixName "TKXSDRAWSTEP"                       = return "opencascade-occt"+libNixName "TKXSDRAWSTL"                        = return "opencascade-occt"+libNixName "TKXSDRAWVRML"                       = return "opencascade-occt"+libNixName "TKXml"                              = return "opencascade-occt"+libNixName "TKXmlL"                             = return "opencascade-occt"+libNixName "TKXmlTObj"                          = return "opencascade-occt"+libNixName "TKXmlXCAF"                          = return "opencascade-occt"+libNixName "TKernel"                            = return "opencascade-occt" libNixName x                                    = return (guessNixIdentifier x)  -- | Map build tool names to Nix attribute names.
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs view
@@ -89,9 +89,9 @@   , ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)   , ("dbus", set doCheck False) -- don't execute tests that try to access the network   , ("dhall", set doCheck False) -- attempts to access the network-  , ("dns", set testTarget "spec")      -- don't execute tests that try to access the network+  , ("dns", set testTargets ["spec"])      -- don't execute tests that try to access the network   , ("eventstore", set (metaSection . platforms) (Just $ Set.singleton (NixpkgsPlatformGroup (ident # "x86_64"))))-  , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))+  , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${lib.getDev pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${lib.getLib pkgs.freenect}/lib"])))   , ("fltkhs", set (libraryDepends . system . contains (pkg "fltk14")) True . over (libraryDepends . pkgconfig) (Set.union (pkgs ["libGLU", "libGL"]))) -- TODO: fltk14 belongs into the *setup* dependencies.   , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)   , ("gi-cairo", giCairoPhaseOverrides)                     -- https://github.com/haskell-gi/haskell-gi/issues/36@@ -110,14 +110,12 @@   , ("gio", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)   , ("git", set doCheck False)          -- https://github.com/vincenthz/hit/issues/33   , ("git-annex >= 6.20170925 && < 6.20171214", set doCheck False)      -- some versions of git-annex require their test suite to be run inside of a git checkout-  , ("git-annex", gitAnnexHook)   , ("github-backup", set (executableDepends . tool . contains (pkg "git")) True)   , ("GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))   , ("GlomeVec", set (libraryDepends . pkgconfig . contains (bind "self.llvmPackages.llvm")) True)   , ("graphviz", set (testDepends . system . contains (pkg "graphviz")) True)   , ("gtk3", gtk3Hook)   , ("gtkglext", gtkglextHook)-  , ("haddock", haddockHook) -- https://github.com/haskell/haddock/issues/511   , ("hakyll", set (testDepends . tool . contains (pkg "util-linux")) True) -- test suite depends on "rev"   , ("haskell-src-exts", set doCheck False)   , ("hfsevents", hfseventsOverrides)@@ -125,7 +123,7 @@   , ("hlibgit2 >= 0.18.0.14", set (testDepends . tool . contains (pkg "git")) True)   , ("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")+  , ("hoogle", set testFlags ["--no-net"])   , ("hsignal < 0.2.7.4", set phaseOverrides "prePatch = \"rm -v Setup.lhs\";") -- https://github.com/amcphail/hsignal/issues/1   , ("hslua < 0.9.3", over (libraryDepends . system) (replace (pkg "lua") (pkg "lua5_1")))   , ("hslua >= 0.9.3 && < 2.0.0", over (libraryDepends . system) (replace (pkg "lua") (pkg "lua5_3")))@@ -138,7 +136,7 @@   , ("include-file <= 0.1.0.2", set (libraryDepends . haskell . contains (self "random")) True) -- https://github.com/Daniel-Diaz/include-file/issues/1   , ("js-jquery", set doCheck False)            -- attempts to access the network   , ("libconfig", over (libraryDepends . system) (replace "config = null" (pkg "libconfig")))-  , ("libxml", set (configureFlags . contains "--extra-include-dir=${libxml2.dev}/include/libxml2") True)+  , ("libxml", set (configureFlags . contains "--extra-include-dir=${lib.getDev libxml2}/include/libxml2") True)   , ("liquid-fixpoint", set (testDepends . system . contains (pkg "z3")) True . set (testDepends . system . contains (pkg "nettools")) True . set (testDepends . system . contains (pkg "git")) True . set doCheck False)   , ("liquidhaskell", set (testDepends . system . contains (pkg "z3")) True)   , ("lua >= 2.0.0 && < 2.2.0", over (libraryDepends . system) (replace (pkg "lua") (pkg "lua5_3")))@@ -152,7 +150,7 @@   , ("opencv", opencvOverrides)   , ("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 < 2.6", pandocPre26Overrides)-  , ("pandoc >= 2.6", pandocOverrides)+  , ("pandoc >= 2.6 && < 3.1.10", pandocPre3110Overrides) -- https://github.com/jgm/pandoc/commit/55227a20273267c236ec039c3e6559287a1dca45   , ("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)@@ -161,6 +159,7 @@   , ("qtah-qt5", set (libraryDepends . tool . contains (bind "pkgs.qt5.qtbase")) True)   , ("readline", over (libraryDepends . system) (Set.union (pkgs ["readline", "ncurses"])))   , ("req", set doCheck False)  -- test suite requires network access+  , ("rest-rewrite", over (testDepends . system) (Set.union (pkgs ["graphviz", "z3"])))   , ("sbv > 7", set (testDepends . system . contains (pkg "z3")) True)   , ("sdr", set (metaSection . platforms) (Just $ Set.singleton (NixpkgsPlatformGroup (ident # "x86_64")))) -- https://github.com/adamwalker/sdr/issues/2   , ("shake-language-c", set doCheck False) -- https://github.com/samplecount/shake-language-c/issues/26@@ -173,7 +172,6 @@   , ("tensorflow-proto", set (libraryDepends . tool . contains (pkg "protobuf")) True)   , ("thyme", set (libraryDepends . tool . contains (self "cpphs")) True) -- required on Darwin   , ("twilio", set doCheck False)         -- attempts to access the network-  , ("tz", set phaseOverrides "preConfigure = \"export TZDIR=${pkgs.tzdata}/share/zoneinfo\";")   , ("udev", set (metaSection . platforms) (Just $ Set.singleton (NixpkgsPlatformGroup (ident # "linux"))))   , ("websockets", set doCheck False)   -- https://github.com/jaspervdj/websockets/issues/104   , ("Win32", set (metaSection . platforms) (Just $ Set.singleton (NixpkgsPlatformGroup (ident # "windows"))))@@ -204,46 +202,19 @@  -- | @replace old new bset@ replaces the Nix binding @old@ with @new@ in the -- set of bindings @bset@. If @old@ is not found in @bset@, then the function--- fails with an 'error'.+-- returns @bset@. Unfortunately, the set of 'Binding's may be different+-- between 'Derivation's generated by @cabal2nix@ and @hackage2nix@. replace :: Binding -> Binding -> Set Binding -> Set Binding-replace old new bs-  | old `Set.member` bs = Set.insert new (Set.delete old bs)-  | otherwise           = error (unwords [ "post-process: cannot replace name binding"-                                         , show old, "by", show new-                                         , "because it's not found in set"-                                         , show bs-                                         ])+replace old new = Set.map (\x -> if x == old then new else x)  gtk3Hook :: Derivation -> Derivation    -- https://github.com/NixOS/cabal2nix/issues/145 gtk3Hook = set (libraryDepends . pkgconfig . contains (pkg "gtk3")) True          . over (libraryDepends . pkgconfig) (Set.filter (\b -> view localName b /= "gtk3")) -haddockHook :: Derivation -> Derivation-haddockHook = set doCheck False-            . set phaseOverrides "preCheck = \"unset GHC_PACKAGE_PATH\";"-            . over (dependencies . haskell) (Set.filter (\b -> view localName b /= "haddock-test"))-            . set (metaSection . broken) False--gitAnnexHook :: Derivation -> Derivation-gitAnnexHook = set phaseOverrides gitAnnexOverrides-             . over (executableDepends . system) (Set.union buildInputs)-  where-    gitAnnexOverrides = unlines-      [ "preConfigure = \"export HOME=$TEMPDIR; patchShebangs .\";"-      , "postBuild = ''"-      , "  ln -sf dist/build/git-annex/git-annex git-annex"-      , "  ln -sf git-annex git-annex-shell"-      , "'';"-      , "installPhase = \"make PREFIX=$out BUILDER=: install install-completions\";"-      , "checkPhase = ''PATH+=\":$PWD\" git-annex test'';"-      , "enableSharedExecutables = false;"-      ]-    buildInputs = pkgs ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]- hfusePreConfigure :: String hfusePreConfigure = unlines   [ "preConfigure = ''"-  , "  sed -i -e \"s@  Extra-Lib-Dirs:         /usr/local/lib@  Extra-Lib-Dirs:         ${fuse}/lib@\" HFuse.cabal"+  , "  sed -i -e \"s@  Extra-Lib-Dirs:         /usr/local/lib@  Extra-Lib-Dirs:         ${lib.getLib fuse}/lib@\" HFuse.cabal"   , "'';"   ] @@ -340,7 +311,7 @@                       . set (libraryDepends . pkgconfig . contains (pkg "cairo")) True   where     txt = unlines [ "preCompileBuildDriver = ''"-                  , "  PKG_CONFIG_PATH+=\":${cairo}/lib/pkgconfig\""+                  , "  PKG_CONFIG_PATH+=\":${lib.getDev cairo}/lib/pkgconfig\""                   , "  setupCompileFlags+=\" $(pkg-config --libs cairo-gobject)\""                   , "'';"                   ]@@ -358,7 +329,7 @@                 . over (libraryDepends . pkgconfig) (replace (pkg "opencv") (pkg "opencv3"))  hspecCoreOverrides :: Derivation -> Derivation   -- https://github.com/hspec/hspec/issues/330-hspecCoreOverrides = set phaseOverrides "testTarget = \"--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'\";"+hspecCoreOverrides = set testFlags [ "--skip", "'Test.Hspec.Core.Runner.hspecResult runs specs in parallel'" ]  cabal2nixOverrides :: Derivation -> Derivation cabal2nixOverrides = set phaseOverrides $ unlines@@ -389,8 +360,8 @@                           , "'';"                           ] -pandocOverrides :: Derivation -> Derivation-pandocOverrides = set phaseOverrides postInstall+pandocPre3110Overrides :: Derivation -> Derivation+pandocPre3110Overrides = set phaseOverrides postInstall   where     postInstall = unlines [ "postInstall = ''"                           , "  mkdir -p $out/share/man/man1"
src/Distribution/Nixpkgs/Haskell/PackageSourceSpec.hs view
@@ -16,6 +16,7 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as T import Data.Time+import Distribution.Nixpkgs.Color ( colorStderrLn, infoColor, errorColor ) import Distribution.Nixpkgs.Fetch import Distribution.Nixpkgs.Hashes import qualified Distribution.Nixpkgs.Haskell.Hackage as DB@@ -192,7 +193,7 @@           seq (length hash) $           urlDerivationSource url hash <$ writeFile cacheFile hash         Nothing -> do-          hPutStr stderr $ unlines+          colorStderrLn errorColor $ unlines             [ "*** cannot compute hash. (Not a hackage project?)"             , " If your project is not on hackage, please supply the path to the root directory of"             , " the project, not to the cabal file."@@ -226,7 +227,7 @@   useHpack <- liftIO $ shouldUseHpack dir   if useHpack     then do-      liftIO $ hPutStrLn stderr "*** found package.yaml. Using hpack..."+      colorStderrLn infoColor "*** found package.yaml. Using hpack..."       hpackDirectory dir     else onlyCabalFromDirectory dir "*** Found neither a .cabal file nor package.yaml. Exiting." @@ -269,7 +270,7 @@     , Hpack.decodeOptionsTarget = dir </> Hpack.packageConfig     }   case mPackage of-    Left err -> liftIO $ hPutStrLn stderr ("*** hpack error: " ++ show err ++ ". Exiting.") >> exitFailure+    Left err -> liftIO $ colorStderrLn errorColor ("*** hpack error: " ++ show err ++ ". Exiting.") >> exitFailure     Right r -> do       let hpackOutput =             let body = Hpack.renderPackage [] (Hpack.decodeResultPackage r)@@ -278,10 +279,10 @@           hash = printSHA256 $ digest (digestByName "sha256") hpackOutput       case runParseGenericPackageDescription "<hpack output>" hpackOutput of         Left msg -> liftIO $ do-          hPutStrLn stderr "*** hpack output:"+          colorStderrLn errorColor "*** hpack output:"           BS.hPutStrLn stderr hpackOutput-          hPutStrLn stderr "*** cannot parse hpack output:"-          hPutStrLn stderr msg+          colorStderrLn errorColor "*** cannot parse hpack output:"+          colorStderrLn errorColor msg           fail "*** Exiting."         Right pkg -> MaybeT $ return $ Just $ (,) True $ setCabalFileHash hash pkg @@ -290,13 +291,13 @@   -- hGetContents throws an error if it's used on files which contain sequences   -- that do not represent valid characters. To catch that exception, we need to   -- wrap the whole block in `catchIO`.-  MaybeT $ handleIO (\err -> Nothing <$ hPutStrLn stderr ("*** parsing cabal file: " ++ show err)) $ do+  MaybeT $ handleIO (\err -> Nothing <$ colorStderrLn errorColor ("*** parsing cabal file: " ++ show err)) $ do     buf <- BS.readFile file     let hash = printSHA256 (digest (digestByName "sha256") buf)     case runParseGenericPackageDescription file buf of       Left msg | failHard -> liftIO $ do-          hPutStrLn stderr $ "*** cannot parse " ++ show file ++ ":"-          hPutStrLn stderr msg+          colorStderrLn errorColor $ "*** cannot parse " ++ show file ++ ":"+          colorStderrLn errorColor msg           fail "*** Exiting."       Left _ -> return Nothing       Right pkg -> return $ Just $ setCabalFileHash hash pkg
+ test/golden-test-cases/gi-gst.cabal view
@@ -0,0 +1,266 @@+name:                 gi-gst+version:              1.0.30+synopsis:             GStreamer bindings+description:          Bindings for GStreamer, autogenerated by haskell-gi.+homepage:             https://github.com/haskell-gi/haskell-gi+license:              LGPL-2.1+license-file:         LICENSE+author:               Iñaki García Etxebarria+maintainer:           Iñaki García Etxebarria+category:             Bindings+build-type:           Custom+cabal-version:        2.0++extra-source-files: README.md ChangeLog.md stack.yaml Gst.overrides++custom-setup+      setup-depends: base >= 4.11 && < 5,+                     Cabal >= 1.24 && < 4,+                     haskell-gi >= 0.26.9 && < 0.27,+                     gi-gobject == 2.0.*,+                     gi-glib == 2.0.*++library+      default-language: Haskell2010+      default-extensions: NoImplicitPrelude, ScopedTypeVariables, CPP, OverloadedStrings, NegativeLiterals, ConstraintKinds, TypeFamilies, MultiParamTypeClasses, KindSignatures, FlexibleInstances, UndecidableInstances, DataKinds, FlexibleContexts, UndecidableSuperClasses, TypeOperators+      other-extensions: PatternSynonyms, ViewPatterns, TypeApplications+      ghc-options: -fno-warn-unused-imports -fno-warn-warnings-deprecations++      pkgconfig-depends: gstreamer-1.0+      build-depends: base >= 4.8 && <5,+                     haskell-gi-base >= 0.26 && < 0.27,+                     haskell-gi >= 0.26.9 && < 0.27,+                     haskell-gi-overloading < 1.1,+                     gi-gobject == 2.0.*,+                     gi-glib == 2.0.*,+                     bytestring >= 0.10 && < 1,+                     containers >= 0.5 && < 1,+                     text >= 1.0 && < 3,+                     transformers >= 0.4 && < 1++      -- Disable overloading when compiling under GHC 8.2.x+      -- see https://ghc.haskell.org/trac/ghc/ticket/14382+      if impl(ghc == 8.2.*)+              build-depends: haskell-gi-overloading == 0.0++      -- Note that the following list of exposed modules and autogen+      -- modules is for documentation purposes only, so that some+      -- documentation appears in hackage. The actual list of modules+      -- to be built will be built at configure time, based on the+      -- available introspection data.++      exposed-modules: GI.Gst.Config,+                       GI.Gst,+                       GI.Gst.Callbacks,+                       GI.Gst.Constants,+                       GI.Gst.Enums,+                       GI.Gst.Flags,+                       GI.Gst.Functions,+                       GI.Gst.Interfaces,+                       GI.Gst.Interfaces.ChildProxy,+                       GI.Gst.Interfaces.Preset,+                       GI.Gst.Interfaces.TagSetter,+                       GI.Gst.Interfaces.TocSetter,+                       GI.Gst.Interfaces.URIHandler,+                       GI.Gst.Objects,+                       GI.Gst.Objects.Allocator,+                       GI.Gst.Objects.Bin,+                       GI.Gst.Objects.Bitmask,+                       GI.Gst.Objects.BufferPool,+                       GI.Gst.Objects.Bus,+                       GI.Gst.Objects.Clock,+                       GI.Gst.Objects.ControlBinding,+                       GI.Gst.Objects.ControlSource,+                       GI.Gst.Objects.Device,+                       GI.Gst.Objects.DeviceMonitor,+                       GI.Gst.Objects.DeviceProvider,+                       GI.Gst.Objects.DeviceProviderFactory,+                       GI.Gst.Objects.DoubleRange,+                       GI.Gst.Objects.DynamicTypeFactory,+                       GI.Gst.Objects.Element,+                       GI.Gst.Objects.ElementFactory,+                       GI.Gst.Objects.FlagSet,+                       GI.Gst.Objects.Fraction,+                       GI.Gst.Objects.FractionRange,+                       GI.Gst.Objects.GhostPad,+                       GI.Gst.Objects.Int64Range,+                       GI.Gst.Objects.IntRange,+                       GI.Gst.Objects.Object,+                       GI.Gst.Objects.Pad,+                       GI.Gst.Objects.PadTemplate,+                       GI.Gst.Objects.ParamArray,+                       GI.Gst.Objects.ParamFraction,+                       GI.Gst.Objects.Pipeline,+                       GI.Gst.Objects.Plugin,+                       GI.Gst.Objects.PluginFeature,+                       GI.Gst.Objects.ProxyPad,+                       GI.Gst.Objects.Registry,+                       GI.Gst.Objects.SharedTaskPool,+                       GI.Gst.Objects.Stream,+                       GI.Gst.Objects.StreamCollection,+                       GI.Gst.Objects.SystemClock,+                       GI.Gst.Objects.Task,+                       GI.Gst.Objects.TaskPool,+                       GI.Gst.Objects.Tracer,+                       GI.Gst.Objects.TracerFactory,+                       GI.Gst.Objects.TracerRecord,+                       GI.Gst.Objects.TypeFindFactory,+                       GI.Gst.Objects.ValueArray,+                       GI.Gst.Objects.ValueList,+                       GI.Gst.Structs,+                       GI.Gst.Structs.AllocationParams,+                       GI.Gst.Structs.AtomicQueue,+                       GI.Gst.Structs.Buffer,+                       GI.Gst.Structs.BufferList,+                       GI.Gst.Structs.BufferPoolAcquireParams,+                       GI.Gst.Structs.ByteArrayInterface,+                       GI.Gst.Structs.Caps,+                       GI.Gst.Structs.CapsFeatures,+                       GI.Gst.Structs.ClockEntry,+                       GI.Gst.Structs.Context,+                       GI.Gst.Structs.CustomMeta,+                       GI.Gst.Structs.DateTime,+                       GI.Gst.Structs.DebugCategory,+                       GI.Gst.Structs.DebugMessage,+                       GI.Gst.Structs.Event,+                       GI.Gst.Structs.FormatDefinition,+                       GI.Gst.Structs.Iterator,+                       GI.Gst.Structs.MapInfo,+                       GI.Gst.Structs.Memory,+                       GI.Gst.Structs.Message,+                       GI.Gst.Structs.Meta,+                       GI.Gst.Structs.MetaInfo,+                       GI.Gst.Structs.MetaTransformCopy,+                       GI.Gst.Structs.MiniObject,+                       GI.Gst.Structs.PadProbeInfo,+                       GI.Gst.Structs.ParamSpecArray,+                       GI.Gst.Structs.ParamSpecFraction,+                       GI.Gst.Structs.ParentBufferMeta,+                       GI.Gst.Structs.ParseContext,+                       GI.Gst.Structs.PluginDesc,+                       GI.Gst.Structs.Poll,+                       GI.Gst.Structs.PollFD,+                       GI.Gst.Structs.Promise,+                       GI.Gst.Structs.ProtectionMeta,+                       GI.Gst.Structs.Query,+                       GI.Gst.Structs.ReferenceTimestampMeta,+                       GI.Gst.Structs.Sample,+                       GI.Gst.Structs.Segment,+                       GI.Gst.Structs.StaticCaps,+                       GI.Gst.Structs.StaticPadTemplate,+                       GI.Gst.Structs.Structure,+                       GI.Gst.Structs.TagList,+                       GI.Gst.Structs.TimedValue,+                       GI.Gst.Structs.Toc,+                       GI.Gst.Structs.TocEntry,+                       GI.Gst.Structs.TypeFind,+                       GI.Gst.Structs.Uri,+                       GI.Gst.Structs.ValueTable++      autogen-modules: GI.Gst.Config,+                       GI.Gst,+                       GI.Gst.Callbacks,+                       GI.Gst.Constants,+                       GI.Gst.Enums,+                       GI.Gst.Flags,+                       GI.Gst.Functions,+                       GI.Gst.Interfaces,+                       GI.Gst.Interfaces.ChildProxy,+                       GI.Gst.Interfaces.Preset,+                       GI.Gst.Interfaces.TagSetter,+                       GI.Gst.Interfaces.TocSetter,+                       GI.Gst.Interfaces.URIHandler,+                       GI.Gst.Objects,+                       GI.Gst.Objects.Allocator,+                       GI.Gst.Objects.Bin,+                       GI.Gst.Objects.Bitmask,+                       GI.Gst.Objects.BufferPool,+                       GI.Gst.Objects.Bus,+                       GI.Gst.Objects.Clock,+                       GI.Gst.Objects.ControlBinding,+                       GI.Gst.Objects.ControlSource,+                       GI.Gst.Objects.Device,+                       GI.Gst.Objects.DeviceMonitor,+                       GI.Gst.Objects.DeviceProvider,+                       GI.Gst.Objects.DeviceProviderFactory,+                       GI.Gst.Objects.DoubleRange,+                       GI.Gst.Objects.DynamicTypeFactory,+                       GI.Gst.Objects.Element,+                       GI.Gst.Objects.ElementFactory,+                       GI.Gst.Objects.FlagSet,+                       GI.Gst.Objects.Fraction,+                       GI.Gst.Objects.FractionRange,+                       GI.Gst.Objects.GhostPad,+                       GI.Gst.Objects.Int64Range,+                       GI.Gst.Objects.IntRange,+                       GI.Gst.Objects.Object,+                       GI.Gst.Objects.Pad,+                       GI.Gst.Objects.PadTemplate,+                       GI.Gst.Objects.ParamArray,+                       GI.Gst.Objects.ParamFraction,+                       GI.Gst.Objects.Pipeline,+                       GI.Gst.Objects.Plugin,+                       GI.Gst.Objects.PluginFeature,+                       GI.Gst.Objects.ProxyPad,+                       GI.Gst.Objects.Registry,+                       GI.Gst.Objects.SharedTaskPool,+                       GI.Gst.Objects.Stream,+                       GI.Gst.Objects.StreamCollection,+                       GI.Gst.Objects.SystemClock,+                       GI.Gst.Objects.Task,+                       GI.Gst.Objects.TaskPool,+                       GI.Gst.Objects.Tracer,+                       GI.Gst.Objects.TracerFactory,+                       GI.Gst.Objects.TracerRecord,+                       GI.Gst.Objects.TypeFindFactory,+                       GI.Gst.Objects.ValueArray,+                       GI.Gst.Objects.ValueList,+                       GI.Gst.Structs,+                       GI.Gst.Structs.AllocationParams,+                       GI.Gst.Structs.AtomicQueue,+                       GI.Gst.Structs.Buffer,+                       GI.Gst.Structs.BufferList,+                       GI.Gst.Structs.BufferPoolAcquireParams,+                       GI.Gst.Structs.ByteArrayInterface,+                       GI.Gst.Structs.Caps,+                       GI.Gst.Structs.CapsFeatures,+                       GI.Gst.Structs.ClockEntry,+                       GI.Gst.Structs.Context,+                       GI.Gst.Structs.CustomMeta,+                       GI.Gst.Structs.DateTime,+                       GI.Gst.Structs.DebugCategory,+                       GI.Gst.Structs.DebugMessage,+                       GI.Gst.Structs.Event,+                       GI.Gst.Structs.FormatDefinition,+                       GI.Gst.Structs.Iterator,+                       GI.Gst.Structs.MapInfo,+                       GI.Gst.Structs.Memory,+                       GI.Gst.Structs.Message,+                       GI.Gst.Structs.Meta,+                       GI.Gst.Structs.MetaInfo,+                       GI.Gst.Structs.MetaTransformCopy,+                       GI.Gst.Structs.MiniObject,+                       GI.Gst.Structs.PadProbeInfo,+                       GI.Gst.Structs.ParamSpecArray,+                       GI.Gst.Structs.ParamSpecFraction,+                       GI.Gst.Structs.ParentBufferMeta,+                       GI.Gst.Structs.ParseContext,+                       GI.Gst.Structs.PluginDesc,+                       GI.Gst.Structs.Poll,+                       GI.Gst.Structs.PollFD,+                       GI.Gst.Structs.Promise,+                       GI.Gst.Structs.ProtectionMeta,+                       GI.Gst.Structs.Query,+                       GI.Gst.Structs.ReferenceTimestampMeta,+                       GI.Gst.Structs.Sample,+                       GI.Gst.Structs.Segment,+                       GI.Gst.Structs.StaticCaps,+                       GI.Gst.Structs.StaticPadTemplate,+                       GI.Gst.Structs.Structure,+                       GI.Gst.Structs.TagList,+                       GI.Gst.Structs.TimedValue,+                       GI.Gst.Structs.Toc,+                       GI.Gst.Structs.TocEntry,+                       GI.Gst.Structs.TypeFind,+                       GI.Gst.Structs.Uri,+                       GI.Gst.Structs.ValueTable
+ test/golden-test-cases/gi-gst.nix.golden view
@@ -0,0 +1,18 @@+{ mkDerivation, base, bytestring, Cabal, containers, gi-glib+, gi-gobject, gstreamer, haskell-gi, haskell-gi-base+, haskell-gi-overloading, lib, text, transformers+}:+mkDerivation {+  pname = "gi-gst";+  version = "1.0.30";+  sha256 = "deadbeef";+  setupHaskellDepends = [ base Cabal gi-glib gi-gobject haskell-gi ];+  libraryHaskellDepends = [+    base bytestring containers gi-glib gi-gobject haskell-gi+    haskell-gi-base haskell-gi-overloading text transformers+  ];+  libraryPkgconfigDepends = [ gstreamer ];+  homepage = "https://github.com/haskell-gi/haskell-gi";+  description = "GStreamer bindings";+  license = lib.licenses.lgpl21Only;+}
+ test/golden-test-cases/gi-gstvideo.cabal view
@@ -0,0 +1,190 @@+name:                 gi-gstvideo+version:              1.0.29+synopsis:             GStreamerVideo bindings+description:          Bindings for GStreamerVideo, autogenerated by haskell-gi.+homepage:             https://github.com/haskell-gi/haskell-gi+license:              LGPL-2.1+license-file:         LICENSE+author:               Iñaki García Etxebarria+maintainer:           Iñaki García Etxebarria+category:             Bindings+build-type:           Custom+cabal-version:        2.0++extra-source-files: README.md ChangeLog.md stack.yaml GstVideo.overrides++custom-setup+      setup-depends: base >= 4.11 && < 5,+                     Cabal >= 1.24 && < 4,+                     haskell-gi >= 0.26.9 && < 0.27,+                     gi-gstbase == 1.0.*,+                     gi-gst == 1.0.*,+                     gi-gobject == 2.0.*,+                     gi-glib == 2.0.*++library+      default-language: Haskell2010+      default-extensions: NoImplicitPrelude, ScopedTypeVariables, CPP, OverloadedStrings, NegativeLiterals, ConstraintKinds, TypeFamilies, MultiParamTypeClasses, KindSignatures, FlexibleInstances, UndecidableInstances, DataKinds, FlexibleContexts, UndecidableSuperClasses, TypeOperators+      other-extensions: PatternSynonyms, ViewPatterns, TypeApplications+      ghc-options: -fno-warn-unused-imports -fno-warn-warnings-deprecations++      pkgconfig-depends: gstreamer-video-1.0+      build-depends: base >= 4.8 && <5,+                     haskell-gi-base >= 0.26 && < 0.27,+                     haskell-gi >= 0.26.9 && < 0.27,+                     haskell-gi-overloading < 1.1,+                     gi-gstbase == 1.0.*,+                     gi-gst == 1.0.*,+                     gi-gobject == 2.0.*,+                     gi-glib == 2.0.*,+                     bytestring >= 0.10 && < 1,+                     containers >= 0.5 && < 1,+                     text >= 1.0 && < 3,+                     transformers >= 0.4 && < 1++      -- Disable overloading when compiling under GHC 8.2.x+      -- see https://ghc.haskell.org/trac/ghc/ticket/14382+      if impl(ghc == 8.2.*)+              build-depends: haskell-gi-overloading == 0.0++      -- Note that the following list of exposed modules and autogen+      -- modules is for documentation purposes only, so that some+      -- documentation appears in hackage. The actual list of modules+      -- to be built will be built at configure time, based on the+      -- available introspection data.++      exposed-modules: GI.GstVideo.Config,+                       GI.GstVideo,+                       GI.GstVideo.Callbacks,+                       GI.GstVideo.Constants,+                       GI.GstVideo.Enums,+                       GI.GstVideo.Flags,+                       GI.GstVideo.Functions,+                       GI.GstVideo.Interfaces,+                       GI.GstVideo.Interfaces.ColorBalance,+                       GI.GstVideo.Interfaces.Navigation,+                       GI.GstVideo.Interfaces.VideoDirection,+                       GI.GstVideo.Interfaces.VideoOrientation,+                       GI.GstVideo.Interfaces.VideoOverlay,+                       GI.GstVideo.Objects,+                       GI.GstVideo.Objects.ColorBalanceChannel,+                       GI.GstVideo.Objects.VideoAggregator,+                       GI.GstVideo.Objects.VideoAggregatorConvertPad,+                       GI.GstVideo.Objects.VideoAggregatorPad,+                       GI.GstVideo.Objects.VideoAggregatorParallelConvertPad,+                       GI.GstVideo.Objects.VideoBufferPool,+                       GI.GstVideo.Objects.VideoDecoder,+                       GI.GstVideo.Objects.VideoEncoder,+                       GI.GstVideo.Objects.VideoFilter,+                       GI.GstVideo.Objects.VideoMultiviewFlagsSet,+                       GI.GstVideo.Objects.VideoSink,+                       GI.GstVideo.Structs,+                       GI.GstVideo.Structs.AncillaryMeta,+                       GI.GstVideo.Structs.VideoAFDMeta,+                       GI.GstVideo.Structs.VideoAffineTransformationMeta,+                       GI.GstVideo.Structs.VideoAlignment,+                       GI.GstVideo.Structs.VideoAncillary,+                       GI.GstVideo.Structs.VideoBarMeta,+                       GI.GstVideo.Structs.VideoCaptionMeta,+                       GI.GstVideo.Structs.VideoChromaResample,+                       GI.GstVideo.Structs.VideoCodecAlphaMeta,+                       GI.GstVideo.Structs.VideoCodecFrame,+                       GI.GstVideo.Structs.VideoCodecState,+                       GI.GstVideo.Structs.VideoColorPrimariesInfo,+                       GI.GstVideo.Structs.VideoColorimetry,+                       GI.GstVideo.Structs.VideoContentLightLevel,+                       GI.GstVideo.Structs.VideoConverter,+                       GI.GstVideo.Structs.VideoCropMeta,+                       GI.GstVideo.Structs.VideoDither,+                       GI.GstVideo.Structs.VideoFormatInfo,+                       GI.GstVideo.Structs.VideoFrame,+                       GI.GstVideo.Structs.VideoGLTextureUploadMeta,+                       GI.GstVideo.Structs.VideoInfo,+                       GI.GstVideo.Structs.VideoInfoDmaDrm,+                       GI.GstVideo.Structs.VideoMasteringDisplayInfo,+                       GI.GstVideo.Structs.VideoMasteringDisplayInfoCoordinates,+                       GI.GstVideo.Structs.VideoMeta,+                       GI.GstVideo.Structs.VideoMetaTransform,+                       GI.GstVideo.Structs.VideoOverlayComposition,+                       GI.GstVideo.Structs.VideoOverlayCompositionMeta,+                       GI.GstVideo.Structs.VideoOverlayRectangle,+                       GI.GstVideo.Structs.VideoRectangle,+                       GI.GstVideo.Structs.VideoRegionOfInterestMeta,+                       GI.GstVideo.Structs.VideoResampler,+                       GI.GstVideo.Structs.VideoSEIUserDataUnregisteredMeta,+                       GI.GstVideo.Structs.VideoScaler,+                       GI.GstVideo.Structs.VideoTileInfo,+                       GI.GstVideo.Structs.VideoTimeCode,+                       GI.GstVideo.Structs.VideoTimeCodeConfig,+                       GI.GstVideo.Structs.VideoTimeCodeInterval,+                       GI.GstVideo.Structs.VideoTimeCodeMeta,+                       GI.GstVideo.Structs.VideoVBIEncoder,+                       GI.GstVideo.Structs.VideoVBIParser++      autogen-modules: GI.GstVideo.Config,+                       GI.GstVideo,+                       GI.GstVideo.Callbacks,+                       GI.GstVideo.Constants,+                       GI.GstVideo.Enums,+                       GI.GstVideo.Flags,+                       GI.GstVideo.Functions,+                       GI.GstVideo.Interfaces,+                       GI.GstVideo.Interfaces.ColorBalance,+                       GI.GstVideo.Interfaces.Navigation,+                       GI.GstVideo.Interfaces.VideoDirection,+                       GI.GstVideo.Interfaces.VideoOrientation,+                       GI.GstVideo.Interfaces.VideoOverlay,+                       GI.GstVideo.Objects,+                       GI.GstVideo.Objects.ColorBalanceChannel,+                       GI.GstVideo.Objects.VideoAggregator,+                       GI.GstVideo.Objects.VideoAggregatorConvertPad,+                       GI.GstVideo.Objects.VideoAggregatorPad,+                       GI.GstVideo.Objects.VideoAggregatorParallelConvertPad,+                       GI.GstVideo.Objects.VideoBufferPool,+                       GI.GstVideo.Objects.VideoDecoder,+                       GI.GstVideo.Objects.VideoEncoder,+                       GI.GstVideo.Objects.VideoFilter,+                       GI.GstVideo.Objects.VideoMultiviewFlagsSet,+                       GI.GstVideo.Objects.VideoSink,+                       GI.GstVideo.Structs,+                       GI.GstVideo.Structs.AncillaryMeta,+                       GI.GstVideo.Structs.VideoAFDMeta,+                       GI.GstVideo.Structs.VideoAffineTransformationMeta,+                       GI.GstVideo.Structs.VideoAlignment,+                       GI.GstVideo.Structs.VideoAncillary,+                       GI.GstVideo.Structs.VideoBarMeta,+                       GI.GstVideo.Structs.VideoCaptionMeta,+                       GI.GstVideo.Structs.VideoChromaResample,+                       GI.GstVideo.Structs.VideoCodecAlphaMeta,+                       GI.GstVideo.Structs.VideoCodecFrame,+                       GI.GstVideo.Structs.VideoCodecState,+                       GI.GstVideo.Structs.VideoColorPrimariesInfo,+                       GI.GstVideo.Structs.VideoColorimetry,+                       GI.GstVideo.Structs.VideoContentLightLevel,+                       GI.GstVideo.Structs.VideoConverter,+                       GI.GstVideo.Structs.VideoCropMeta,+                       GI.GstVideo.Structs.VideoDither,+                       GI.GstVideo.Structs.VideoFormatInfo,+                       GI.GstVideo.Structs.VideoFrame,+                       GI.GstVideo.Structs.VideoGLTextureUploadMeta,+                       GI.GstVideo.Structs.VideoInfo,+                       GI.GstVideo.Structs.VideoInfoDmaDrm,+                       GI.GstVideo.Structs.VideoMasteringDisplayInfo,+                       GI.GstVideo.Structs.VideoMasteringDisplayInfoCoordinates,+                       GI.GstVideo.Structs.VideoMeta,+                       GI.GstVideo.Structs.VideoMetaTransform,+                       GI.GstVideo.Structs.VideoOverlayComposition,+                       GI.GstVideo.Structs.VideoOverlayCompositionMeta,+                       GI.GstVideo.Structs.VideoOverlayRectangle,+                       GI.GstVideo.Structs.VideoRectangle,+                       GI.GstVideo.Structs.VideoRegionOfInterestMeta,+                       GI.GstVideo.Structs.VideoResampler,+                       GI.GstVideo.Structs.VideoSEIUserDataUnregisteredMeta,+                       GI.GstVideo.Structs.VideoScaler,+                       GI.GstVideo.Structs.VideoTileInfo,+                       GI.GstVideo.Structs.VideoTimeCode,+                       GI.GstVideo.Structs.VideoTimeCodeConfig,+                       GI.GstVideo.Structs.VideoTimeCodeInterval,+                       GI.GstVideo.Structs.VideoTimeCodeMeta,+                       GI.GstVideo.Structs.VideoVBIEncoder,+                       GI.GstVideo.Structs.VideoVBIParser
+ test/golden-test-cases/gi-gstvideo.nix.golden view
@@ -0,0 +1,20 @@+{ mkDerivation, base, bytestring, Cabal, containers, gi-glib+, gi-gobject, gi-gst, gi-gstbase, gst-plugins-base, haskell-gi+, haskell-gi-base, haskell-gi-overloading, lib, text, transformers+}:+mkDerivation {+  pname = "gi-gstvideo";+  version = "1.0.29";+  sha256 = "deadbeef";+  setupHaskellDepends = [+    base Cabal gi-glib gi-gobject gi-gst gi-gstbase haskell-gi+  ];+  libraryHaskellDepends = [+    base bytestring containers gi-glib gi-gobject gi-gst gi-gstbase+    haskell-gi haskell-gi-base haskell-gi-overloading text transformers+  ];+  libraryPkgconfigDepends = [ gst-plugins-base ];+  homepage = "https://github.com/haskell-gi/haskell-gi";+  description = "GStreamerVideo bindings";+  license = lib.licenses.lgpl21Only;+}
test/golden-test-cases/hoogle.nix.golden view
@@ -23,7 +23,7 @@     warp-tls zlib   ];   executableHaskellDepends = [ base ];-  testTarget = "--test-option=--no-net";+  testFlags = [ "--no-net" ];   homepage = "http://hoogle.haskell.org/";   description = "Haskell API Search";   license = lib.licenses.bsd3;