git.iko.soy/typeable/cabal2nix
on master help sign in
Hackage4Nix.hs: drop the notion of a "patched package"
c83c8abPeter Simons
README.md+10−19
@@ -108,32 +108,23 @@ performing updates!
108
108
109## Current State of Affairs
109## Current State of Affairs
110
110
111−The tool-chain is stable. As of today, 2011-08-30, almost all Haskell
111+The tool-chain is stable. As of today, 2013-04-12, virtually all Haskell
112packages available in Nix have been generated automatically from their
112packages available in Nix have been generated automatically from their
113−Cabal files. The exceptions are:
113+Cabal files. There are only a handful of exceptions, which we cannot
114−
114+generate because these packages aren't available on Hackage. The list of
115−* "Bad packages" that cannot be generated automatically because there
116− is no proper Cabal file for them, or because their builds are so
117− complicated that the `cabal.nix` build doesn't suffice to do the
118− trick. The list of bad packages is hard-coded into
115+those packages is hard-coded into the
119− [`hackage4nix.hs`](http://github.com/NixOS/cabal2nix/blob/master/src/Hackage4Nix.hs),
116+[`hackage4nix.hs`](http://github.com/NixOS/cabal2nix/blob/master/src/Hackage4Nix.hs)
120− in the functions `badPackagePaths` and `patchedPackages`. Any
117+binary in the function `badPackagePaths`.
121− package list in there is going to be ignored by `hackage4nix`.
118+
122−
119+Furthermore, Hackage4Nix will not re-generate packages that have been
123−* "Patched packages" cannot be generated automatically, because their
124− build instructions need patches that `cabal2nix` doesn't (yet) know
125− about. There is a hard-coded list of patched packages in
126− [`hackage4nix`](http://github.com/NixOS/cabal2nix/blob/master/src/Hackage4Nix.hs).
127− Furthermore, all build expressions that define any of the attributes
120+patched, i.e. that define any of the following attributes:
128
121
129 (pre|post)Configure
122 (pre|post)Configure
130 (pre|post)Install
123 (pre|post)Install
131 patchPhase
124 patchPhase
132 patches
125 patches
133
126
134− are considered "patched". That list of attributes is hard-coded in
127+These packages are considered for updates, however.
135− [`hackage4nix.hs`](http://github.com/NixOS/cabal2nix/blob/master/src/Hackage4Nix.hs)
136− in the function `regenerateDerivation`.
137
128
138The complete list of Haskell packages available in Nix is generated by
129The complete list of Haskell packages available in Nix is generated by
139the tool [`package-list`](http://github.com/peti/package-list),
130the tool [`package-list`](http://github.com/peti/package-list),
src/Hackage4Nix.hs+1−8
@@ -71,8 +71,7 @@ discoverNixFiles yield dirOrFile = do
71 (False,_) -> io (readDirectory dirOrFile) >>= mapM_ (discoverNixFiles yield . (dirOrFile </>))
71 (False,_) -> io (readDirectory dirOrFile) >>= mapM_ (discoverNixFiles yield . (dirOrFile </>))
72
72
73regenerateDerivation :: Derivation -> String -> Bool
73regenerateDerivation :: Derivation -> String -> Bool
74−regenerateDerivation deriv buf = (pname deriv `notElem` patchedPackages) &&
75− not (buf =~ "(pre|post)Configure|(pre|post)Install|patchPhase|patches")
74+regenerateDerivation deriv buf = not (buf =~ "(pre|post)Configure|(pre|post)Install|patchPhase|patches")
76
75
77parseNixFile :: FilePath -> String -> Hackage4Nix (Maybe Pkg)
76parseNixFile :: FilePath -> String -> Hackage4Nix (Maybe Pkg)
78parseNixFile path buf
77parseNixFile path buf
@@ -208,9 +207,3 @@ badPackagePaths = [ "haskell-platform/2009.2.0.2.nix", "haskell-platform/2010.1.
208 , "haskell-platform/2012.2.0.0.nix", "haskell-platform/2012.4.0.0.nix"
207 , "haskell-platform/2012.2.0.0.nix", "haskell-platform/2012.4.0.0.nix"
209 , "top-level/all-packages.nix", "top-level/haskell-packages.nix"
208 , "top-level/all-packages.nix", "top-level/haskell-packages.nix"
210 ]
209 ]
211−
212−-- Packages that we cannot regenerate automatically yet. This list
213−-- should be empty.
214−
215−patchedPackages :: [String]
216−patchedPackages = []