@@ -21,6 +21,7 @@ module Distribution.NixOS.Derivation.Cabal
2121
2222import Distribution.NixOS.Derivation.Meta
2323import Distribution.NixOS.PrettyPrinting
24+import Distribution.NixOS.Regex hiding ( empty )
2425import Distribution.Text
2526import Distribution.Package
2627#ifdef __HADDOCK__
@@ -31,7 +32,6 @@ import Data.Version
3132import Data.List
3233import Data.Char
3334import Data.Function
34−import Text.Regex.Posix hiding ( empty )
3535
3636-- | A represtation of Nix expressions for building Haskell packages.
3737-- The data type correspond closely to the definition of
@@ -84,11 +84,11 @@ renderDerivation deriv =
8484 , attr "sha256" $ string (sha256 deriv)
8585 , boolattr "isLibrary" (not (isLibrary deriv) || isExecutable deriv) (isLibrary deriv)
8686 , boolattr "isExecutable" (not (isLibrary deriv) || isExecutable deriv) (isExecutable deriv)
87− , listattr "buildDepends" (buildDepends deriv)
88− , listattr "testDepends" (testDepends deriv)
89− , listattr "buildTools" (buildTools deriv)
90− , listattr "extraLibraries" (extraLibs deriv)
91− , listattr "pkgconfigDepends" (pkgConfDeps deriv)
87+ , listattr "buildDepends" empty (buildDepends deriv)
88+ , listattr "testDepends" empty (testDepends deriv)
89+ , listattr "buildTools" empty (buildTools deriv)
90+ , listattr "extraLibraries" empty (extraLibs deriv)
91+ , listattr "pkgconfigDepends" empty (pkgConfDeps deriv)
9292 , onlyIf renderedFlags $ attr "configureFlags" $ doubleQuotes (sep renderedFlags)
9393 , boolattr "noHaddock" (not (runHaddock deriv)) (not (runHaddock deriv))
9494 , boolattr "jailbreak" (jailbreak deriv) (jailbreak deriv)
@@ -120,7 +120,7 @@ parseDerivation buf
120120 , [sha] <- buf `regsubmatch` "sha256 *= *\"([^\"]+)\""
121121 , hplats <- buf `regsubmatch` "hydraPlatforms *= *([^;]+);"
122122 , plats <- buf `regsubmatch` "platforms *= *([^;]+);"
123− , maint <- buf `regsubmatch` "maintainers *= *\\[([^\"]+)]"
123+ , maint <- buf `regsubmatch` "maintainers *= *(with [^;]+;)? \\[([^\"]+)]"
124124 , noHaddock <- buf `regsubmatch` "noHaddock *= *(true|false) *;"
125125 , jailBreak <- buf `regsubmatch` "jailbreak *= *(true|false) *;"
126126 , docheck <- buf `regsubmatch` "doCheck *= *(true|false) *;"
@@ -149,14 +149,9 @@ parseDerivation buf
149149 { homepage = ""
150150 , description = ""
151151 , license = Unknown Nothing
152− , maintainers = concatMap words maint
152+ , maintainers = if null maint then [] else concatMap words (tail maint)
153153 , platforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) plats)
154154 , hydraPlatforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) hplats)
155155 }
156156 }
157157 | otherwise = Nothing
158−
159−regsubmatch :: String -> String -> [String]
160−regsubmatch buf patt = let (_,_,_,x) = f in x
161− where f :: (String,String,String,[String])
162− f = match (makeRegexOpts compExtended execBlank patt) buf