git.iko.soy/typeable/cabal2nix
on master help sign in
Add helper for common case of haskell deps when post-processing
2e6458fJohn Ericson
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+10−7
@@ -41,13 +41,13 @@ hooks =
41 [ ("Agda < 2.5", set (executableDepends . tool . contains (pkg "emacs")) True . set phaseOverrides agdaPostInstall)
41 [ ("Agda < 2.5", set (executableDepends . tool . contains (pkg "emacs")) True . set phaseOverrides agdaPostInstall)
42 , ("Agda >= 2.5", set (executableDepends . tool . contains (pkg "emacs")) True . set phaseOverrides agda25PostInstall)
42 , ("Agda >= 2.5", set (executableDepends . tool . contains (pkg "emacs")) True . set phaseOverrides agda25PostInstall)
43 , ("alex < 3.1.5", set (testDepends . tool . contains (pkg "perl")) True)
43 , ("alex < 3.1.5", set (testDepends . tool . contains (pkg "perl")) True)
44− , ("alex", set (executableDepends . tool . contains (bind "self.happy")) True)
44+ , ("alex", set (executableDepends . tool . contains (self "happy")) True)
45 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux))) , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
45 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux))) , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
46 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
46 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
47 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux))) , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
47 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux))) , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
48 , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
48 , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
49 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
49 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
50− , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [bind "self.mtl", bind "self.parsec"]))) -- https://github.com/haskell/cabal/issues/5391
50+ , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
51 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
51 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
52 , ("cabal-install", set doCheck False . set phaseOverrides cabalInstallPostInstall)
52 , ("cabal-install", set doCheck False . set phaseOverrides cabalInstallPostInstall)
53 , ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)
53 , ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)
@@ -92,14 +92,14 @@ hooks =
92 , ("http-client-tls >= 0.2.2", set doCheck False) -- attempts to access the network
92 , ("http-client-tls >= 0.2.2", set doCheck False) -- attempts to access the network
93 , ("http-conduit", set doCheck False) -- attempts to access the network
93 , ("http-conduit", set doCheck False) -- attempts to access the network
94 , ("imagemagick", set (libraryDepends . pkgconfig . contains (pkg "imagemagick")) True) -- https://github.com/NixOS/cabal2nix/issues/136
94 , ("imagemagick", set (libraryDepends . pkgconfig . contains (pkg "imagemagick")) True) -- https://github.com/NixOS/cabal2nix/issues/136
95− , ("include-file <= 0.1.0.2", set (libraryDepends . haskell . contains (bind "self.random")) True) -- https://github.com/Daniel-Diaz/include-file/issues/1
95+ , ("include-file <= 0.1.0.2", set (libraryDepends . haskell . contains (self "random")) True) -- https://github.com/Daniel-Diaz/include-file/issues/1
96 , ("js-jquery", set doCheck False) -- attempts to access the network
96 , ("js-jquery", set doCheck False) -- attempts to access the network
97 , ("libconfig", over (libraryDepends . system) (replace "config = null" (pkg "libconfig")))
97 , ("libconfig", over (libraryDepends . system) (replace "config = null" (pkg "libconfig")))
98 , ("libxml", set (configureFlags . contains "--extra-include-dir=${libxml2.dev}/include/libxml2") True)
98 , ("libxml", set (configureFlags . contains "--extra-include-dir=${libxml2.dev}/include/libxml2") True)
99 , ("liquid-fixpoint", set (executableDepends . system . contains (pkg "ocaml")) True . set (testDepends . system . contains (pkg "z3")) True . set (testDepends . system . contains (pkg "nettools")) True . set (testDepends . system . contains (pkg "git")) True . set doCheck False)
99 , ("liquid-fixpoint", set (executableDepends . system . contains (pkg "ocaml")) True . set (testDepends . system . contains (pkg "z3")) True . set (testDepends . system . contains (pkg "nettools")) True . set (testDepends . system . contains (pkg "git")) True . set doCheck False)
100 , ("liquidhaskell", set (testDepends . system . contains (pkg "z3")) True)
100 , ("liquidhaskell", set (testDepends . system . contains (pkg "z3")) True)
101− , ("lzma-clib", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Windows)) . set (libraryDepends . haskell . contains (bind "self.only-buildable-on-windows")) False)
101+ , ("lzma-clib", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Windows)) . set (libraryDepends . haskell . contains (self "only-buildable-on-windows")) False)
102− , ("MFlow < 4.6", set (libraryDepends . tool . contains (bind "self.cpphs")) True)
102+ , ("MFlow < 4.6", set (libraryDepends . tool . contains (self "cpphs")) True)
103 , ("mwc-random", set doCheck False)
103 , ("mwc-random", set doCheck False)
104 , ("mysql", set (libraryDepends . system . contains (pkg "mysql")) True)
104 , ("mysql", set (libraryDepends . system . contains (pkg "mysql")) True)
105 , ("network-attoparsec", set doCheck False) -- test suite requires network access
105 , ("network-attoparsec", set doCheck False) -- test suite requires network access
@@ -122,7 +122,7 @@ hooks =
122 , ("target", set (testDepends . system . contains (pkg "z3")) True)
122 , ("target", set (testDepends . system . contains (pkg "z3")) True)
123 , ("terminfo", set (libraryDepends . system . contains (pkg "ncurses")) True)
123 , ("terminfo", set (libraryDepends . system . contains (pkg "ncurses")) True)
124 , ("text", set doCheck False) -- break infinite recursion
124 , ("text", set doCheck False) -- break infinite recursion
125− , ("thyme", set (libraryDepends . tool . contains (bind "self.cpphs")) True) -- required on Darwin
125+ , ("thyme", set (libraryDepends . tool . contains (self "cpphs")) True) -- required on Darwin
126 , ("twilio", set doCheck False) -- attempts to access the network
126 , ("twilio", set doCheck False) -- attempts to access the network
127 , ("tz", set phaseOverrides "preConfigure = \"export TZDIR=${pkgs.tzdata}/share/zoneinfo\";")
127 , ("tz", set phaseOverrides "preConfigure = \"export TZDIR=${pkgs.tzdata}/share/zoneinfo\";")
128 , ("udev", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux))) , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
128 , ("udev", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux))) , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
@@ -135,13 +135,16 @@ hooks =
135 , ("wxcore", set (libraryDepends . pkgconfig . contains (pkg "wxGTK")) True)
135 , ("wxcore", set (libraryDepends . pkgconfig . contains (pkg "wxGTK")) True)
136 , ("X11", over (libraryDepends . system) (Set.union (Set.fromList $ map bind ["pkgs.xorg.libXinerama","pkgs.xorg.libXext","pkgs.xorg.libXrender","pkgs.xorg.libXScrnSaver"])))
136 , ("X11", over (libraryDepends . system) (Set.union (Set.fromList $ map bind ["pkgs.xorg.libXinerama","pkgs.xorg.libXext","pkgs.xorg.libXrender","pkgs.xorg.libXScrnSaver"])))
137 , ("xmonad", set phaseOverrides xmonadPostInstall)
137 , ("xmonad", set phaseOverrides xmonadPostInstall)
138− , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (bind "self.zip") (pkg "zip")))
138+ , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (self "zip") (pkg "zip")))
139 , ("zip-archive >= 0.3.1 && < 0.3.2.3", over (testDepends . tool) (Set.union (Set.fromList [pkg "zip", pkg "unzip"]))) -- https://github.com/jgm/zip-archive/issues/35
139 , ("zip-archive >= 0.3.1 && < 0.3.2.3", over (testDepends . tool) (Set.union (Set.fromList [pkg "zip", pkg "unzip"]))) -- https://github.com/jgm/zip-archive/issues/35
140 ]
140 ]
141
141
142pkg :: Identifier -> Binding
142pkg :: Identifier -> Binding
143pkg i = binding # (i, path # ["pkgs",i])
143pkg i = binding # (i, path # ["pkgs",i])
144
144
145+self :: Identifier -> Binding
146+self i = binding # (i, path # ["self",i])
147+
145pkgs :: [Identifier] -> Set Binding
148pkgs :: [Identifier] -> Set Binding
146pkgs = Set.fromList . map pkg
149pkgs = Set.fromList . map pkg
147
150