packages feed

cabal2nix 1.53 → 1.54

raw patch · 4 files changed

+52/−18 lines, 4 files

Files

cabal2nix.cabal view
@@ -1,5 +1,5 @@ Name:                   cabal2nix-Version:                1.53+Version:                1.54 Copyright:              Peter Simons, Andres Loeh License:                BSD3 License-File:           LICENSE@@ -34,8 +34,8 @@   .   The only required argument is the path to the cabal file. For example:   .-  > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.53/cabal2nix.cabal-  > cabal2nix cabal://cabal2nix-1.53+  > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.54/cabal2nix.cabal+  > cabal2nix cabal://cabal2nix-1.54   .   If the @--sha256@ option has not been specified, cabal2nix calls   @nix-prefetch-url@ to determine the hash automatically. This causes
src/Cabal2Nix/Flags.hs view
@@ -13,7 +13,7 @@                                   , enable "Production", enable "TDFA"]  | name == "haskeline"          = [enable "terminfo"]  | name == "reactive-banana-wx" = [disable "buildExamples"]- | name == "xmobar"             = [enable "with_xft", enable "with_iwlib"]+ | name == "xmobar"             = [enable "with_xft"]  | name == "xmonad-extras"      = [disable "with_hlist", enable "with_split", enable "with_parsec"]  | otherwise                    = [] 
src/Cabal2Nix/PostProcess.hs view
@@ -17,6 +17,7 @@   | pname == "epic"             = deriv { extraLibs = "gmp":"boehmgc":extraLibs, buildTools = "happy":buildTools }   | pname == "ghc-heap-view"    = deriv { phaseOverrides = ghciPostInstall }   | pname == "ghc-mod"          = deriv { phaseOverrides = ghcModPostInstall, buildTools = "emacs":buildTools }+  | pname == "ghc-paths"        = deriv { phaseOverrides = ghcPathsPatches }   | pname == "ghc-vis"          = deriv { phaseOverrides = ghciPostInstall }   | pname == "git-annex"        = deriv { phaseOverrides = gitAnnexOverrides, buildTools = "git":"rsync":"gnupg1":"curl":"lsof":"openssh":"which":"bup":buildTools }   | pname == "glade"            = deriv { extraLibs = "pkgconfig":"libc":extraLibs, pkgConfDeps = "gtkC":delete "gtk" pkgConfDeps }@@ -30,6 +31,7 @@   | pname == "haskell-src"      = deriv { buildTools = "happy":buildTools }   | pname == "haskell-src-meta" = deriv { buildDepends = "uniplate":buildDepends }   | pname == "hflags"           = deriv { metaSection = metaSection { license = Unknown (Just "Apache-2.0") } }+  | pname == "HFuse"            = deriv { phaseOverrides = hfusePreConfigure }   | pname == "highlighting-kate"= highlightingKatePostProcessing deriv   | pname == "hmatrix"          = deriv { extraLibs = "gsl":"liblapack":"blas":extraLibs }   | pname == "hspec"            = deriv { doCheck = False }@@ -39,12 +41,14 @@   | pname == "language-c-quote" = deriv { buildTools = "alex":"happy":buildTools }   | pname == "language-java"    = deriv { buildDepends = "syb":buildDepends }   | pname == "leksah-server"    = deriv { buildDepends = "process-leksah":buildDepends }+  | pname == "lhs2tex"          = deriv { extraLibs = "texLive":extraLibs, phaseOverrides = lhs2texPostInstall }   | pname == "libffi"           = deriv { extraLibs = delete "ffi" extraLibs }   | pname == "llvm-base"        = deriv { extraLibs = "llvm":extraLibs }   | pname == "multiarg"         = deriv { buildDepends = "utf8String":buildDepends }   | pname == "OpenAL"           = deriv { extraLibs = "openal":extraLibs }   | pname == "OpenGL"           = deriv { extraLibs = "mesa":"libX11":extraLibs }   | pname == "pango"            = deriv { extraLibs = "pkgconfig":"libc":extraLibs }+  | pname == "pcap"             = deriv { extraLibs = "libpcap":extraLibs }   | pname == "persistent"       = deriv { extraLibs = "sqlite3":extraLibs }   | pname == "repa-algorithms"  = deriv { extraLibs = "llvm":extraLibs }   | pname == "repa-examples"    = deriv { extraLibs = "llvm":extraLibs }@@ -96,20 +100,20 @@ ghcModPostInstall :: String ghcModPostInstall = unlines   [ "postInstall = ''"-  , "    cd $out/share/$pname-$version"-  , "    make"-  , "    rm Makefile"-  , "    cd .."-  , "    ensureDir \"$out/share/emacs\""-  , "    mv $pname-$version emacs/site-lisp"-  , "  '';"+  , "  cd $out/share/$pname-$version"+  , "  make"+  , "  rm Makefile"+  , "  cd .."+  , "  ensureDir \"$out/share/emacs\""+  , "  mv $pname-$version emacs/site-lisp"+  , "'';"   ]  wxcPostInstall :: String wxcPostInstall = unlines   [ "postInstall = ''"-  , "    cp -v dist/build/libwxc.so.${self.version} $out/lib/libwxc.so"-  , "  '';"+  , "  cp -v dist/build/libwxc.so.${self.version} $out/lib/libwxc.so"+  , "'';"   ]  cabalInstallPostInstall :: String@@ -157,7 +161,31 @@ ghciPostInstall :: String ghciPostInstall = unlines   [ "postInstall = ''"-  , "    ensureDir \"$out/share/ghci\""-  , "    ln -s \"$out/share/$pname-$version/ghci\" \"$out/share/ghci/$pname\""-  , "  '';"+  , "  ensureDir \"$out/share/ghci\""+  , "  ln -s \"$out/share/$pname-$version/ghci\" \"$out/share/ghci/$pname\""+  , "'';"+  ]++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/LANGUAGE FlexibleContexts/LANGUAGE FlexibleContexts, RankNTypes/\" System/Fuse.hsc"+  , "  sed -i -e \"s/E(Exception/E(catch, Exception, IOException/\" System/Fuse.hsc"+  , "  sed -i -e \"s/IO(catch,/IO(/\" System/Fuse.hsc"+  , "  sed -i -e \"s/IO.catch/ E.catch/\" System/Fuse.hsc"+  , "  sed -i -e \"s/const exitFailure/\\\\\\\\(_ :: IOException) -> exitFailure/\" System/Fuse.hsc"+  , "'';"+  ]++ghcPathsPatches :: String+ghcPathsPatches = "patches = [ ./ghc-paths-nix.patch ];"++lhs2texPostInstall :: String+lhs2texPostInstall = unlines+  [ "postInstall = ''"+  , "  mkdir -p \"$out/share/doc/$name\""+  , "  cp doc/Guide2.pdf $out/share/doc/$name"+  , "  mkdir -p \"$out/nix-support\""+  , "'';"   ]
src/hackage4nix.hs view
@@ -29,6 +29,7 @@   { _msgDebug  :: String -> IO ()   , _msgInfo   :: String -> IO ()   , _hackageDb :: DB.Hackage+  , _force     :: Bool   }  defaultConfiguration :: Configuration@@ -36,6 +37,7 @@   { _msgDebug  = hPutStrLn stderr   , _msgInfo   = hPutStrLn stderr   , _hackageDb = DB.empty+  , _force     = False   }  type Hackage4Nix a = RWST Configuration () PkgSet IO a@@ -79,7 +81,9 @@   | any (`isSuffixOf`path) badPackagePaths                = msgDebug ("ignore known bad package " ++ path) >> return Nothing   | Just deriv <- parseDerivation buf-               = return (Just (Pkg deriv path (regenerateDerivation deriv buf)))+               = do forceReGen <- asks _force+                    let reGen = regenerateDerivation deriv buf+                    return (Just (Pkg deriv path (forceReGen || reGen)))   | otherwise = msgInfo ("failed to parse file " ++ path) >> return Nothing  selectLatestVersions :: PkgSet -> PkgSet@@ -163,7 +167,7 @@   | "self.stdenv.lib.maintainers." `isPrefixOf` x = drop 28 x   | otherwise                                     = x -data CliOption = PrintHelp | Verbose+data CliOption = PrintHelp | Verbose | ForceRegen   deriving (Eq)  main :: IO ()@@ -172,6 +176,7 @@       options =         [ Option "h" ["help"]     (NoArg PrintHelp)                 "show this help text"         , Option "v" ["verbose"]  (NoArg Verbose)                   "enable noisy debug output"+        , Option ""  ["force"]    (NoArg ForceRegen)                "re-generate all files in place"         ]        usage :: String@@ -198,6 +203,7 @@   let cfg = defaultConfiguration             { _msgDebug  = if Verbose `elem` opts then _msgDebug defaultConfiguration else const (return ())             , _hackageDb = hackage+            , _force     = ForceRegen `elem` opts             }   ((),_,()) <- runRWST (updateNixPkgs args) cfg Set.empty   return ()