cabal2nix 1.72 → 1.73
raw patch · 10 files changed
+79/−20 lines, 10 filesdep +deepseqdep ~hackage-db
Dependencies added: deepseq
Dependency ranges changed: hackage-db
Files
- cabal2nix.cabal +6/−5
- src/Cabal2Nix/Flags.hs +1/−0
- src/Cabal2Nix/License.hs +4/−1
- src/Cabal2Nix/Name.hs +27/−2
- src/Cabal2Nix/PostProcess.hs +6/−3
- src/Distribution/NixOS/Derivation/Cabal.hs +17/−5
- src/Distribution/NixOS/Derivation/License.hs +6/−1
- src/Distribution/NixOS/Derivation/Meta.hs +5/−1
- src/Distribution/NixOS/Fetch.hs +4/−0
- src/hackage4nix.hs +3/−2
cabal2nix.cabal view
@@ -1,5 +1,5 @@ Name: cabal2nix-Version: 1.72+Version: 1.73 Copyright: Peter Simons, Andres Loeh License: BSD3 License-File: LICENSE@@ -39,8 +39,8 @@ . The only required argument is the path to the cabal file. For example: .- > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.72/cabal2nix.cabal- > cabal2nix cabal://cabal2nix-1.72+ > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.73/cabal2nix.cabal+ > cabal2nix cabal://cabal2nix-1.73 . If the @--sha256@ option has not been specified, cabal2nix calls @nix-prefetch-url@ to determine the hash automatically. This causes@@ -59,7 +59,7 @@ main-is: cabal2nix.hs hs-source-dirs: src Build-Depends: base >= 3 && < 5, regex-posix, pretty, Cabal >= 1.18,- filepath, directory, process, hackage-db, transformers+ filepath, directory, process, hackage-db >= 1.11, transformers, deepseq Extensions: PatternGuards, RecordWildCards, CPP Ghc-Options: -Wall other-modules: Cabal2Nix.CorePackages@@ -82,7 +82,8 @@ main-is: hackage4nix.hs hs-source-dirs: src Build-Depends: base >= 3 && < 5, regex-posix, pretty, Cabal >= 1.18,- mtl, containers, directory, filepath, hackage-db, transformers, process+ mtl, containers, directory, filepath, hackage-db >= 1.11,+ transformers, process, deepseq Extensions: PatternGuards, RecordWildCards, CPP Ghc-Options: -Wall other-modules: Cabal2Nix.CorePackages
src/Cabal2Nix/Flags.hs view
@@ -7,6 +7,7 @@ configureCabalFlags (PackageIdentifier (PackageName name) _) | name == "arithmoi" = [disable "llvm"] | name == "accelerate-examples"= [disable "opencl"]+ | name == "diagrams-builder" = [enable "cairo", enable "svg", enable "ps", enable "rasterific"] | name == "folds" = [disable "test-hlint"] | name == "git-annex" = [enable "Assistant" , enable "Production"] | name == "haskeline" = [enable "terminfo"]
src/Cabal2Nix/License.hs view
@@ -12,9 +12,12 @@ fromCabalLicense (LGPL (Just (Version [2,1] []))) = Known "self.stdenv.lib.licenses.lgpl21" fromCabalLicense (LGPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.lgpl2" fromCabalLicense (LGPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"+fromCabalLicense (AGPL Nothing) = Unknown (Just "AGPL") fromCabalLicense (AGPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.agpl3"+fromCabalLicense (AGPL (Just (Version [3,0] []))) = Known "self.stdenv.lib.licenses.agpl3"+fromCabalLicense (UnknownLicense "BSD2") = Known "self.stdenv.lib.licenses.bsd2" fromCabalLicense BSD3 = Known "self.stdenv.lib.licenses.bsd3"-fromCabalLicense BSD4 = Known "self.stdenv.lib.licenses.bsd4"+fromCabalLicense BSD4 = Unknown (Just "BSD4") fromCabalLicense MIT = Known "self.stdenv.lib.licenses.mit" fromCabalLicense PublicDomain = Known "self.stdenv.lib.licenses.publicDomain" fromCabalLicense AllRightsReserved = Known "self.stdenv.lib.licenses.unfree"
src/Cabal2Nix/Name.hs view
@@ -19,25 +19,36 @@ libNixName :: String -> [String] libNixName "adns" = return "adns" libNixName "alsa" = return "alsaLib"+libNixName "appindicator-0.1" = return "appindicator"+libNixName "appindicator3-0.1" = return "appindicator" libNixName "asound" = return "alsaLib"+libNixName "awesomium-1.6.5" = return "awesomium" libNixName "bz2" = return "bzip2" libNixName "cairo-pdf" = return "cairo" libNixName "cairo-ps" = return "cairo" libNixName "cairo" = return "cairo" libNixName "cairo-svg" = return "cairo"-libNixName "crypt" = [] -- provided by glibc+libNixName "CEGUIBase-0.7.7" = return "CEGUIBase"+libNixName "CEGUIOgreRenderer-0.7.7" = return "CEGUIOgreRenderer"+libNixName "clutter-1.0" = return "clutter" libNixName "crypto" = return "openssl"+libNixName "crypt" = [] -- provided by glibc+libNixName "c++" = [] -- What is that? libNixName "dl" = [] -- provided by glibc libNixName "gconf-2.0" = return "gconf" libNixName "gdk-2.0" = return "gtk" libNixName "gdk-pixbuf-2.0" = return "gdk_pixbuf"+libNixName "gdk-x11-2.0" = return "gdk_x11" libNixName "gio-2.0" = return "glib" libNixName "glib-2.0" = return "glib" libNixName "GL" = return "mesa" libNixName "GLU" = ["freeglut","mesa"] libNixName "glut" = ["freeglut","mesa"]+libNixName "gmime-2.4" = return "gmime" libNixName "gnome-keyring-1" = return "gnome_keyring" libNixName "gnome-keyring" = return "gnome_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 "gstreamer-0.10" = return "gstreamer" libNixName "gstreamer-audio-0.10" = return "gstreamer-audio"@@ -51,6 +62,8 @@ libNixName "gtk+-3.0" = return "gtk3" libNixName "gtkglext-1.0" = return "gtkglext" libNixName "gtksourceview-2.0" = return "gtksourceview"+libNixName "gtksourceview-3.0" = return "gtksourceview"+libNixName "gtk-x11-2.0" = return "gtk_x11" libNixName "icudata" = return "icu" libNixName "icui18n" = return "icu" libNixName "icuuc" = return "icu"@@ -62,27 +75,39 @@ libNixName "libglade-2.0" = return "libglade" libNixName "libgsasl" = return "gsasl" libNixName "librsvg-2.0" = return "librsvg"+libNixName "libsoup-gnome-2.4" = return "libsoup" libNixName "libusb-1.0" = return "libusb" libNixName "libxml-2.0" = return "libxml2" libNixName "libzip" = return "libzip" libNixName "libzmq" = return "zeromq" libNixName "m" = [] -- in stdenv+libNixName "mono-2.0" = return "mono" libNixName "ncursesw" = return "ncurses"+libNixName "notify" = return "libnotify" libNixName "panelw" = return "ncurses" libNixName "pangocairo" = return "pango"+libNixName "pcap" = return "libpcap" libNixName "pcre" = return "pcre"+libNixName "pfs-1.2" = return "pfstools" libNixName "png" = return "libpng" libNixName "poppler-glib" = return "popplerGlib" libNixName "portaudio-2.0" = return "portaudio" libNixName "pq" = return "postgresql" libNixName "pthread" = []+libNixName "python-3.3" = return "python3"+libNixName "ruby1.8" = return "ruby"+libNixName "sane-backends" = return "saneBackends"+libNixName "SDL2-2.0" = return "SDL2" libNixName "sdl2" = return "SDL2" libNixName "sndfile" = return "libsndfile" libNixName "sqlite3" = return "sqlite" libNixName "ssl" = return "openssl"-libNixName "stdc++" = [] -- in stdenv+libNixName "stdc++.dll" = [] -- What is that?+libNixName "stdc++" = [] -- What is that? libNixName "systemd-journal" = return "systemd"+libNixName "vte-2.90" = return "vte" libNixName "webkit-1.0" = return "webkit"+libNixName "webkitgtk-3.0" = return "webkitgtk" libNixName "X11" = return "libX11" libNixName "Xext" = return "libXext" libNixName "xft" = return "libXft"
src/Cabal2Nix/PostProcess.hs view
@@ -16,13 +16,14 @@ = deriv { buildTools = "perl":"happy":buildTools } | pname == "bindings-GLFW" = deriv { extraLibs = "libXext":"libXfixes":extraLibs } | pname == "bits-extras" = deriv { configureFlags = "--ghc-option=-lgcc_s":configureFlags, extraLibs = filter (/= "gcc_s") extraLibs }+ | pname == "Cabal" = deriv { phaseOverrides = "preCheck = \"unset GHC_PACKAGE_PATH; export HOME=$NIX_BUILD_TOP\";" } | pname == "cabal2nix" = deriv { doCheck = True, phaseOverrides = cabal2nixDoCheckHook }- | pname == "cabal-bounds" = deriv { buildTools = "cabalInstall":buildTools }+ | pname == "cabal-bounds" = deriv { buildTools = "cabalInstall":buildTools } | pname == "cabal-install" && version >= Version [0,14] [] = deriv { phaseOverrides = cabalInstallPostInstall } | pname == "cairo" = deriv { extraLibs = "pkgconfig":"libc":"cairo":"zlib":extraLibs } | pname == "cookie" = deriv { phaseOverrides = cookieDoCheckHook }- | pname == "cuda" = deriv { phaseOverrides = cudaConfigurePhase, extraLibs = "cudatoolkit":"nvidia_x11":"self.stdenv.gcc":extraLibs }+ | pname == "cuda" = deriv { phaseOverrides = cudaConfigurePhase, extraLibs = "cudatoolkit":"nvidia_x11":"self.stdenv.cc":extraLibs } | pname == "darcs" = deriv { phaseOverrides = darcsInstallPostInstall } | pname == "dns" = deriv { testTarget = "spec" } | pname == "doctest" = deriv { runHaddock = True, phaseOverrides = doctestNoHaddock }@@ -34,7 +35,7 @@ | pname == "ghc-parser" = deriv { buildTools = "cpphs":"happy":buildTools, phaseOverrides = ghcParserPatchPhase } | 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":"perl":buildTools }+ | pname == "git-annex" = deriv { phaseOverrides = gitAnnexOverrides, buildTools = "git":"rsync":"gnupg1":"curl":"wget":"lsof":"openssh":"which":"bup":"perl":buildTools } | pname == "github-backup" = deriv { buildTools = "git":buildTools } | pname == "glade" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, pkgConfDeps = "gtkC":delete "gtk" pkgConfDeps } | pname == "glib" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }@@ -71,6 +72,7 @@ | pname == "leksah-server" = deriv { buildDepends = "process-leksah":buildDepends } | pname == "lhs2tex" = deriv { extraLibs = "texLive":extraLibs, phaseOverrides = lhs2texPostInstall } | pname == "libffi" = deriv { extraLibs = delete "ffi" extraLibs }+ | pname == "liquid-fixpoint" = deriv { buildTools = "ocaml":buildTools } | pname == "llvm-base" = deriv { extraLibs = "llvm":extraLibs } | pname == "llvm-general" = deriv { doCheck = False } | pname == "llvm-general-pure"= deriv { doCheck = False }@@ -80,6 +82,7 @@ | pname == "mime-mail" = deriv { extraFunctionArgs = ["sendmail ? \"sendmail\""], phaseOverrides = mimeMailConfigureFlags } | pname == "mysql" = deriv { buildTools = "mysqlConfig":buildTools, extraLibs = "zlib":extraLibs } | pname == "ncurses" = deriv { phaseOverrides = ncursesPatchPhase }+ | pname == "Omega" = deriv { testDepends = delete "stdc++" testDepends } | pname == "OpenAL" = deriv { extraLibs = "openal":extraLibs } | pname == "OpenGL" = deriv { extraLibs = "mesa":"libX11":extraLibs } | pname == "pandoc" = deriv { buildDepends = "alex":"happy":buildDepends }
src/Distribution/NixOS/Derivation/Cabal.hs view
@@ -20,20 +20,21 @@ ) where +import Control.DeepSeq+import Data.Char+import Data.Function+import Data.List+import Data.Version import Distribution.NixOS.Derivation.Meta import Distribution.NixOS.Fetch import Distribution.NixOS.PrettyPrinting import Distribution.NixOS.Regex hiding ( empty ) import Distribution.Package-import Distribution.Text #ifdef __HADDOCK__ import Distribution.PackageDescription ( PackageDescription ) #endif import Distribution.PackageDescription ( FlagAssignment, FlagName(..) )-import Data.Version-import Data.List-import Data.Char-import Data.Function+import Distribution.Text -- | A represtation of Nix expressions for building Haskell packages. -- The data type correspond closely to the definition of@@ -72,6 +73,17 @@ instance Package Derivation where packageId deriv = PackageIdentifier (PackageName (pname deriv)) (version deriv)++instance NFData Derivation where+ rnf (MkDerivation a b c d e f g h i j k l m n o p q r t u v) =+ a `deepseq` b `deepseq` c `deepseq` d `deepseq` e `deepseq` f `deepseq` g `deepseq`+ h `deepseq` i `deepseq` j `deepseq` k `deepseq` l `deepseq` m `deepseqFlagAssignment` n `deepseq`+ o `deepseq` p `deepseq` q `deepseq` r `deepseq` t `deepseq` u `deepseq` v `deepseq` ()++-- FlagName has no NFData instance in old version of Cabal.+deepseqFlagAssignment :: FlagAssignment -> a -> a+deepseqFlagAssignment [] b = b+deepseqFlagAssignment ((FlagName n, v):as) b = n `deepseq` v `deepseq` as `deepseqFlagAssignment` b renderDerivation :: Derivation -> Doc renderDerivation deriv =
src/Distribution/NixOS/Derivation/License.hs view
@@ -13,9 +13,10 @@ module Distribution.NixOS.Derivation.License ( License(..) ) where +import Control.DeepSeq+import Data.Maybe import Distribution.NixOS.PrettyPrinting import Distribution.Text-import Data.Maybe -- | The representation for licenses used in Nix derivations. Known -- licenses are Nix expressions -- such as @stdenv.lib.licenses.bsd3@@@ -49,3 +50,7 @@ disp (Known x) = text x disp (Unknown x) = string (fromMaybe "unknown" x) parse = error "parsing Distribution.NixOS.Derivation.License is not supported yet"++instance NFData License where+ rnf (Known s) = rnf s+ rnf (Unknown s) = rnf s
src/Distribution/NixOS/Derivation/Meta.hs view
@@ -17,8 +17,9 @@ ) where -import Distribution.NixOS.PrettyPrinting+import Control.DeepSeq import Distribution.NixOS.Derivation.License+import Distribution.NixOS.PrettyPrinting import Distribution.Text -- | A representation of the @meta@ section used in Nix expressions.@@ -54,6 +55,9 @@ instance Text Meta where disp = renderMeta parse = error "parsing Distribution.NixOS.Derivation.Cabal.Meta is not supported yet"++instance NFData Meta where+ rnf (Meta a b c d e f) = a `deepseq` b `deepseq` c `deepseq` d `deepseq` e `deepseq` f `deepseq` () renderMeta :: Meta -> Doc renderMeta meta = vcat
src/Distribution/NixOS/Fetch.hs view
@@ -9,6 +9,7 @@ ) where import Control.Applicative+import Control.DeepSeq import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.Maybe@@ -35,6 +36,9 @@ , derivRevision :: String -- ^ Revision to use. Leave empty if the fetcher doesn't support revisions. , derivHash :: String -- ^ The hash of the source. } deriving (Show, Eq, Ord)++instance NFData DerivationSource where+ rnf (DerivationSource a b c d) = a `deepseq` b `deepseq` c `deepseq` d `deepseq` () fromDerivationSource :: DerivationSource -> Source fromDerivationSource DerivationSource{..} = Source derivUrl derivRevision $ Just derivHash
src/hackage4nix.hs view
@@ -72,7 +72,7 @@ (False,_) -> io (readDirectory dirOrFile) >>= mapM_ (discoverNixFiles yield . (dirOrFile </>)) regenerateDerivation :: Derivation -> String -> Bool-regenerateDerivation _ buf = not (buf =~ "(pre|post)Configure|(pre|post)Install|patchPhase|patches|broken")+regenerateDerivation _ buf = not (buf =~ "(pre|post)Configure|(pre|post)Install|patchPhase|patches|broken|editedCabalFile") parseNixFile :: FilePath -> String -> Hackage4Nix (Maybe Pkg) parseNixFile path buf@@ -241,7 +241,8 @@ , "haskell-platform/2011.2.0.1.nix", "haskell-platform/2011.4.0.0.nix" , "haskell-platform/2012.2.0.0.nix", "haskell-platform/2012.4.0.0.nix" , "haskell-platform/2013.2.0.0.nix", "compilers/flapjax/default.nix"- , "pkgs/games/uqm/3dovideo.nix"+ , "pkgs/games/uqm/3dovideo.nix", "haskell/ghcjs-prim/default.nix"+ , "system/journal-mailer/default.nix", "development/compilers/ghcjs/default.nix" -- Our primitive parser cannot handle these files. , "top-level/all-packages.nix", "top-level/haskell-packages.nix" -- This build is way too complicated to maintain it automatically.