git.iko.soy/typeable/cabal2nix
on master help sign in
Merge branch 'master' into feature-local-only
1f68b44Benno Fünfstück
README.md+2−2
@@ -115,7 +115,7 @@ packages available in Nix have been generated automatically from their
115Cabal files. There are only a handful of exceptions, which we cannot
115Cabal files. There are only a handful of exceptions, which we cannot
116generate because these packages aren't available on Hackage. The list of
116generate because these packages aren't available on Hackage. The list of
117those packages is hard-coded into the
117those packages is hard-coded into the
118−[`hackage4nix.hs`](http://github.com/NixOS/cabal2nix/blob/master/src/Hackage4Nix.hs)
118+[`hackage4nix.hs`](https://github.com/NixOS/cabal2nix/blob/master/src/hackage4nix.hs)
119binary in the function `badPackagePaths`.
119binary in the function `badPackagePaths`.
120
120
121Furthermore, Hackage4Nix will not re-generate packages that have been
121Furthermore, Hackage4Nix will not re-generate packages that have been
@@ -133,5 +133,5 @@ the tool [`package-list`](http://github.com/peti/package-list),
133and published at <http://cryp.to/haskell-in-nixpkgs.txt>. Hackage picks
133and published at <http://cryp.to/haskell-in-nixpkgs.txt>. Hackage picks
134it up from there and generates links on each package's homepage to the
134it up from there and generates links on each package's homepage to the
135corresponding page in Hydra automatically. See [ticket
135corresponding page in Hydra automatically. See [ticket
136−875](http://hackage.haskell.org/trac/hackage/ticket/875) for further
136+875](http://www.haskell.org/pipermail/cabal-devel/2011-August/007714.html) for further
137details.
137details.
cabal2nix.cabal+4−4
@@ -1,5 +1,5 @@
1Name: cabal2nix
1Name: cabal2nix
2−Version: 1.58
2+Version: 1.62
3Copyright: Peter Simons, Andres Loeh
3Copyright: Peter Simons, Andres Loeh
4License: BSD3
4License: BSD3
5License-File: LICENSE
5License-File: LICENSE
@@ -10,7 +10,7 @@ Category: Distribution
10Synopsis: Convert Cabal files into Nix build instructions
10Synopsis: Convert Cabal files into Nix build instructions
11Cabal-Version: >= 1.8
11Cabal-Version: >= 1.8
12Build-Type: Custom
12Build-Type: Custom
13−Tested-With: GHC >= 6.12.3 && <= 7.6.3
13+Tested-With: GHC >= 6.12.3 && <= 7.8.1
14Data-files: README.md
14Data-files: README.md
15Description:
15Description:
16 The @cabal2nix@ utility converts Cabal files into Nix build instructions. The
16 The @cabal2nix@ utility converts Cabal files into Nix build instructions. The
@@ -34,8 +34,8 @@ Description:
34 .
34 .
35 The only required argument is the path to the cabal file. For example:
35 The only required argument is the path to the cabal file. For example:
36 .
36 .
37− > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.58/cabal2nix.cabal
37+ > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.62/cabal2nix.cabal
38− > cabal2nix cabal://cabal2nix-1.58
38+ > cabal2nix cabal://cabal2nix-1.62
39 .
39 .
40 If the @--sha256@ option has not been specified, cabal2nix calls
40 If the @--sha256@ option has not been specified, cabal2nix calls
41 @nix-prefetch-url@ to determine the hash automatically. This causes
41 @nix-prefetch-url@ to determine the hash automatically. This causes
src/Cabal2Nix/Flags.hs+4−1
@@ -12,9 +12,12 @@ configureCabalFlags (PackageIdentifier (PackageName name) _)
12 , enable "Production", enable "TDFA"]
12 , enable "Production", enable "TDFA"]
13 | name == "haskeline" = [enable "terminfo"]
13 | name == "haskeline" = [enable "terminfo"]
14 | name == "hslua" = [enable "system-lua"]
14 | name == "hslua" = [enable "system-lua"]
15+ | name == "idris" = [enable "llvm", enable "gmp", enable "ffi"]
16+ | name == "io-streams" = [enable "NoInteractiveTests"]
15 | name == "reactive-banana-wx" = [disable "buildExamples"]
17 | name == "reactive-banana-wx" = [disable "buildExamples"]
16− | name == "xmobar" = [enable "with_xft", enable "with_iwlib"]
18+ | name == "xmobar" = [enable "with_xft", enable "with_iwlib", enable "with_alsa"]
17 | name == "xmonad-extras" = [disable "with_hlist", enable "with_split", enable "with_parsec"]
19 | name == "xmonad-extras" = [disable "with_hlist", enable "with_split", enable "with_parsec"]
20+ | name == "yi" = [enable "pango"]
18 | otherwise = []
21 | otherwise = []
19
22
20enable :: String -> (FlagName,Bool)
23enable :: String -> (FlagName,Bool)
src/Cabal2Nix/Generate.hs+1
@@ -20,6 +20,7 @@ cabal2nix cabal = normalize $ postProcess MkDerivation
20 , src = Nothing
20 , src = Nothing
21 , isLibrary = isJust (Cabal.library tpkg)
21 , isLibrary = isJust (Cabal.library tpkg)
22 , isExecutable = not (null (Cabal.executables tpkg))
22 , isExecutable = not (null (Cabal.executables tpkg))
23+ , extraFunctionArgs = []
23 , buildDepends = map unDep deps
24 , buildDepends = map unDep deps
24 , testDepends = map unDep tstDeps ++ concatMap Cabal.extraLibs tests
25 , testDepends = map unDep tstDeps ++ concatMap Cabal.extraLibs tests
25 , buildTools = map unDep tools
26 , buildTools = map unDep tools
src/Cabal2Nix/Hackage.hs+1−1
@@ -76,7 +76,7 @@ readCabalFile path
76
76
77fetchUrl :: String -> IO String
77fetchUrl :: String -> IO String
78fetchUrl url = do
78fetchUrl url = do
79− (_,rsp) <- Network.Browser.browse $ do
79+ (_,rsp) <- browse $ do
80 setCheckForProxy True
80 setCheckForProxy True
81 setDebugLog Nothing
81 setDebugLog Nothing
82 setOutHandler (\_ -> return ())
82 setOutHandler (\_ -> return ())
src/Cabal2Nix/License.hs+16−15
@@ -5,18 +5,19 @@ import Distribution.License ( License(..) )
5import Data.Version
5import Data.Version
6
6
7fromCabalLicense :: Distribution.License.License -> Distribution.NixOS.Derivation.License.License
7fromCabalLicense :: Distribution.License.License -> Distribution.NixOS.Derivation.License.License
8−fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
8+fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
9−fromCabalLicense (GPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.gpl2"
9+fromCabalLicense (GPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.gpl2"
10−fromCabalLicense (GPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
10+fromCabalLicense (GPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
11−fromCabalLicense (LGPL Nothing) = Unknown (Just "LGPL")
11+fromCabalLicense (LGPL Nothing) = Unknown (Just "LGPL")
12−fromCabalLicense (LGPL (Just (Version [2,1] []))) = Known "self.stdenv.lib.licenses.lgpl21"
12+fromCabalLicense (LGPL (Just (Version [2,1] []))) = Known "self.stdenv.lib.licenses.lgpl21"
13−fromCabalLicense (LGPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.lgpl2"
13+fromCabalLicense (LGPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.lgpl2"
14−fromCabalLicense (LGPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
14+fromCabalLicense (LGPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
15−fromCabalLicense BSD3 = Known "self.stdenv.lib.licenses.bsd3"
15+fromCabalLicense BSD3 = Known "self.stdenv.lib.licenses.bsd3"
16−fromCabalLicense BSD4 = Known "self.stdenv.lib.licenses.bsd4"
16+fromCabalLicense BSD4 = Known "self.stdenv.lib.licenses.bsd4"
17−fromCabalLicense MIT = Known "self.stdenv.lib.licenses.mit"
17+fromCabalLicense MIT = Known "self.stdenv.lib.licenses.mit"
18−fromCabalLicense PublicDomain = Known "self.stdenv.lib.licenses.publicDomain"
18+fromCabalLicense PublicDomain = Known "self.stdenv.lib.licenses.publicDomain"
19−fromCabalLicense AllRightsReserved = Known "self.stdenv.lib.licenses.proprietary"
19+fromCabalLicense AllRightsReserved = Known "self.stdenv.lib.licenses.unfree"
20+fromCabalLicense (Apache Nothing) = Known "self.stdenv.lib.licenses.asl20"
20−fromCabalLicense (Apache Nothing) = Known "self.stdenv.lib.licenses.asl20"
21+fromCabalLicense (Apache (Just (Version [2,0] []))) = Known "self.stdenv.lib.licenses.asl20"
21−fromCabalLicense OtherLicense = Unknown Nothing
22+fromCabalLicense OtherLicense = Unknown Nothing
22−fromCabalLicense l = error $ "Cabal2Nix.License.fromCabalLicense: unknown license " ++ show l
23+fromCabalLicense l = error $ "Cabal2Nix.License.fromCabalLicense: unknown license " ++ show l
src/Cabal2Nix/Name.hs+69−62
@@ -17,74 +17,81 @@ toNixName name = f name
17-- possibility of name clashes with Haskell libraries. I have included
17-- possibility of name clashes with Haskell libraries. I have included
18-- identity mappings to incicate that I have verified their correctness.
18-- identity mappings to incicate that I have verified their correctness.
19libNixName :: String -> [String]
19libNixName :: String -> [String]
20−libNixName "adns" = return "adns"
20+libNixName "adns" = return "adns"
21−libNixName "alsa" = return "alsaLib"
21+libNixName "alsa" = return "alsaLib"
22+libNixName "asound" = return "alsaLib"
22−libNixName "cairo-pdf" = return "cairo"
23+libNixName "cairo-pdf" = return "cairo"
23−libNixName "cairo-ps" = return "cairo"
24+libNixName "cairo-ps" = return "cairo"
24−libNixName "cairo" = return "cairo"
25+libNixName "cairo" = return "cairo"
25−libNixName "cairo-svg" = return "cairo"
26+libNixName "cairo-svg" = return "cairo"
26−libNixName "crypto" = return "openssl"
27+libNixName "crypto" = return "openssl"
28+libNixName "dl" = [] -- provided by glibc
27−libNixName "gconf-2.0" = return "gconf"
29+libNixName "gconf-2.0" = return "gconf"
30+libNixName "gdk-2.0" = return "gtk"
31+libNixName "gdk-pixbuf-2.0" = return "gdk_pixbuf"
28−libNixName "gio-2.0" = return "glib"
32+libNixName "gio-2.0" = return "glib"
29−libNixName "glib-2.0" = return "glib"
33+libNixName "glib-2.0" = return "glib"
30−libNixName "GL" = return "mesa"
34+libNixName "GL" = return "mesa"
31−libNixName "GLU" = ["freeglut","mesa"]
35+libNixName "GLU" = ["freeglut","mesa"]
32−libNixName "glut" = ["freeglut","mesa"]
36+libNixName "glut" = ["freeglut","mesa"]
33−libNixName "gnome-keyring-1" = return "gnome_keyring"
37+libNixName "gnome-keyring-1" = return "gnome_keyring"
34−libNixName "gnome-keyring" = return "gnome_keyring"
38+libNixName "gnome-keyring" = return "gnome_keyring"
35−libNixName "gobject-2.0" = return "glib"
39+libNixName "gobject-2.0" = return "glib"
36−libNixName "gstreamer-0.10" = return "gstreamer"
40+libNixName "gstreamer-0.10" = return "gstreamer"
37libNixName "gstreamer-audio-0.10" = return "gstreamer-audio"
41libNixName "gstreamer-audio-0.10" = return "gstreamer-audio"
38libNixName "gstreamer-base-0.10" = return "gstreamer-base"
42libNixName "gstreamer-base-0.10" = return "gstreamer-base"
39libNixName "gstreamer-controller-0.10" = return "gstreamer-controller"
43libNixName "gstreamer-controller-0.10" = return "gstreamer-controller"
40libNixName "gstreamer-dataprotocol-0.10" = return "gstreamer-dataprotocol"
44libNixName "gstreamer-dataprotocol-0.10" = return "gstreamer-dataprotocol"
41libNixName "gstreamer-net-0.10" = return "gstreamer-net"
45libNixName "gstreamer-net-0.10" = return "gstreamer-net"
42libNixName "gstreamer-plugins-base-0.10" = return "gstreamer-plugins-base"
46libNixName "gstreamer-plugins-base-0.10" = return "gstreamer-plugins-base"
43−libNixName "gthread-2.0" = return "glib"
47+libNixName "gthread-2.0" = return "glib"
44−libNixName "gtk+-2.0" = return "gtk"
48+libNixName "gtk+-2.0" = return "gtk"
45−libNixName "gtkglext-1.0" = return "gtkglext"
49+libNixName "gtkglext-1.0" = return "gtkglext"
46−libNixName "gtksourceview-2.0" = return "gtksourceview"
50+libNixName "gtksourceview-2.0" = return "gtksourceview"
47−libNixName "icudata" = return "icu"
51+libNixName "icudata" = return "icu"
48−libNixName "icui18n" = return "icu"
52+libNixName "icui18n" = return "icu"
49−libNixName "icuuc" = return "icu"
53+libNixName "icuuc" = return "icu"
50−libNixName "idn" = return "libidn"
54+libNixName "idn" = return "libidn"
51−libNixName "IL" = return "libdevil"
55+libNixName "IL" = return "libdevil"
52−libNixName "iw" = return "wirelesstools"
56+libNixName "iw" = return "wirelesstools"
53−libNixName "jpeg" = return "libjpeg"
57+libNixName "jpeg" = return "libjpeg"
54−libNixName "libglade-2.0" = return "libglade"
58+libNixName "libglade-2.0" = return "libglade"
55−libNixName "libgsasl" = return "gsasl"
59+libNixName "libgsasl" = return "gsasl"
56−libNixName "librsvg-2.0" = return "librsvg"
60+libNixName "librsvg-2.0" = return "librsvg"
57−libNixName "libusb-1.0" = return "libusb"
61+libNixName "libusb-1.0" = return "libusb"
58−libNixName "libxml-2.0" = return "libxml2"
62+libNixName "libxml-2.0" = return "libxml2"
59−libNixName "libzip" = return "libzip"
63+libNixName "libzip" = return "libzip"
64+libNixName "libzmq" = return "zeromq"
60−libNixName "m" = [] -- in stdenv
65+libNixName "m" = [] -- in stdenv
61−libNixName "ncursesw" = return "ncurses"
66+libNixName "ncursesw" = return "ncurses"
62−libNixName "panelw" = return "ncurses"
67+libNixName "panelw" = return "ncurses"
63−libNixName "pangocairo" = return "pango"
68+libNixName "pangocairo" = return "pango"
64−libNixName "pcre" = return "pcre"
69+libNixName "pcre" = return "pcre"
65−libNixName "png" = return "libpng"
70+libNixName "png" = return "libpng"
71+libNixName "poppler-glib" = return "popplerGlib"
66−libNixName "pq" = return "postgresql"
72+libNixName "pq" = return "postgresql"
67−libNixName "pthread" = []
73+libNixName "pthread" = []
68−libNixName "sndfile" = return "libsndfile"
74+libNixName "sndfile" = return "libsndfile"
69−libNixName "sqlite3" = return "sqlite"
75+libNixName "sqlite3" = return "sqlite"
70−libNixName "ssl" = return "openssl"
76+libNixName "ssl" = return "openssl"
71−libNixName "stdc++" = [] -- in stdenv
77+libNixName "stdc++" = [] -- in stdenv
72−libNixName "webkit-1.0" = return "webkit"
78+libNixName "webkit-1.0" = return "webkit"
73−libNixName "X11" = return "libX11"
79+libNixName "X11" = return "libX11"
74−libNixName "Xext" = return "libXext"
80+libNixName "Xext" = return "libXext"
75−libNixName "xft" = return "libXft"
81+libNixName "xft" = return "libXft"
82+libNixName "Xi" = return "libXi"
76−libNixName "xml2" = return "libxml2"
83+libNixName "xml2" = return "libxml2"
77−libNixName "Xrandr" = return "libXrandr"
84+libNixName "Xrandr" = return "libXrandr"
78−libNixName "Xss" = return "libXScrnSaver"
85+libNixName "Xss" = return "libXScrnSaver"
79−libNixName "Xtst" = return "libXtst"
86+libNixName "Xtst" = return "libXtst"
80−libNixName "zmq" = return "zeromq"
87+libNixName "zmq" = return "zeromq"
81−libNixName "z" = return "zlib"
88+libNixName "z" = return "zlib"
82−libNixName x = return x
89+libNixName x = return x
83
90
84-- | Map build tool names to Nix attribute names.
91-- | Map build tool names to Nix attribute names.
85buildToolNixName :: String -> [String]
92buildToolNixName :: String -> [String]
86−buildToolNixName "cabal" = return "cabalInstall"
93+buildToolNixName "cabal" = return "cabalInstall"
87−buildToolNixName "gtk2hsC2hs" = return "gtk2hsBuildtools"
94+buildToolNixName "gtk2hsC2hs" = return "gtk2hsBuildtools"
88−buildToolNixName "gtk2hsHookGenerator" = return "gtk2hsBuildtools"
95+buildToolNixName "gtk2hsHookGenerator" = return "gtk2hsBuildtools"
89−buildToolNixName "gtk2hsTypeGen" = return "gtk2hsBuildtools"
96+buildToolNixName "gtk2hsTypeGen" = return "gtk2hsBuildtools"
90−buildToolNixName x = return (toNixName x)
97+buildToolNixName x = return (toNixName x)
src/Cabal2Nix/PostProcess.hs+52−16
@@ -7,6 +7,9 @@ import Data.List
7
7
8postProcess :: Derivation -> Derivation
8postProcess :: Derivation -> Derivation
9postProcess deriv@(MkDerivation {..})
9postProcess deriv@(MkDerivation {..})
10+ | pname == "aeson" && version > Version [0,7] []
11+ = deriv { buildDepends = "blazeBuilder":buildDepends }
12+ | pname == "Agda" = deriv { buildTools = "emacs":buildTools, phaseOverrides = agdaPostInstall }
10 | pname == "alex" && version < Version [3,1] []
13 | pname == "alex" && version < Version [3,1] []
11 = deriv { buildTools = "perl":buildTools }
14 = deriv { buildTools = "perl":buildTools }
12 | pname == "alex" && version >= Version [3,1] []
15 | pname == "alex" && version >= Version [3,1] []
@@ -21,6 +24,7 @@ postProcess deriv@(MkDerivation {..})
21 | pname == "doctest" = deriv { runHaddock = True, phaseOverrides = doctestNoHaddock }
24 | pname == "doctest" = deriv { runHaddock = True, phaseOverrides = doctestNoHaddock }
22 | pname == "editline" = deriv { extraLibs = "libedit":extraLibs }
25 | pname == "editline" = deriv { extraLibs = "libedit":extraLibs }
23 | pname == "epic" = deriv { extraLibs = "gmp":"boehmgc":extraLibs, buildTools = "happy":buildTools }
26 | pname == "epic" = deriv { extraLibs = "gmp":"boehmgc":extraLibs, buildTools = "happy":buildTools }
27+ | pname == "either" = deriv { runHaddock = True, phaseOverrides = eitherNoHaddock }
24 | pname == "ghc-heap-view" = deriv { phaseOverrides = ghciPostInstall }
28 | pname == "ghc-heap-view" = deriv { phaseOverrides = ghciPostInstall }
25 | pname == "ghc-mod" = deriv { phaseOverrides = ghcModPostInstall, buildTools = "emacs":buildTools }
29 | pname == "ghc-mod" = deriv { phaseOverrides = ghcModPostInstall, buildTools = "emacs":buildTools }
26 | pname == "ghc-paths" = deriv { phaseOverrides = ghcPathsPatches }
30 | pname == "ghc-paths" = deriv { phaseOverrides = ghcPathsPatches }
@@ -29,6 +33,7 @@ postProcess deriv@(MkDerivation {..})
29 | pname == "github-backup" = deriv { buildTools = "git":buildTools }
33 | pname == "github-backup" = deriv { buildTools = "git":buildTools }
30 | pname == "glade" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, pkgConfDeps = "gtkC":delete "gtk" pkgConfDeps }
34 | pname == "glade" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, pkgConfDeps = "gtkC":delete "gtk" pkgConfDeps }
31 | pname == "glib" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
35 | pname == "glib" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
36+ | pname == "gloss-raster" = deriv { extraLibs = "llvm":extraLibs }
32 | pname == "GLUT" = deriv { extraLibs = "glut":"libSM":"libICE":"libXmu":"libXi":"mesa":extraLibs }
37 | pname == "GLUT" = deriv { extraLibs = "glut":"libSM":"libICE":"libXmu":"libXi":"mesa":extraLibs }
33 | pname == "gtk" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, buildDepends = delete "gio" buildDepends }
38 | pname == "gtk" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, buildDepends = delete "gio" buildDepends }
34 | pname == "gtksourceview2" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
39 | pname == "gtksourceview2" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
@@ -55,6 +60,8 @@ postProcess deriv@(MkDerivation {..})
55 | pname == "llvm-general-pure"= deriv { doCheck = False }
60 | pname == "llvm-general-pure"= deriv { doCheck = False }
56 | pname == "markdown-unlit" = deriv { runHaddock = True, phaseOverrides = markdownUnlitNoHaddock }
61 | pname == "markdown-unlit" = deriv { runHaddock = True, phaseOverrides = markdownUnlitNoHaddock }
57 | pname == "multiarg" = deriv { buildDepends = "utf8String":buildDepends }
62 | pname == "multiarg" = deriv { buildDepends = "utf8String":buildDepends }
63+ | pname == "mime-mail" = deriv { extraFunctionArgs = ["sendmail ? \"sendmail\""], phaseOverrides = mimeMailConfigureFlags }
64+ | pname == "mysql" = deriv { buildTools = "mysqlConfig":buildTools, extraLibs = "zlib":extraLibs }
58 | pname == "ncurses" = deriv { phaseOverrides = ncursesPatchPhase }
65 | pname == "ncurses" = deriv { phaseOverrides = ncursesPatchPhase }
59 | pname == "OpenAL" = deriv { extraLibs = "openal":extraLibs }
66 | pname == "OpenAL" = deriv { extraLibs = "openal":extraLibs }
60 | pname == "OpenGL" = deriv { extraLibs = "mesa":"libX11":extraLibs }
67 | pname == "OpenGL" = deriv { extraLibs = "mesa":"libX11":extraLibs }
@@ -62,15 +69,18 @@ postProcess deriv@(MkDerivation {..})
62 | pname == "pango" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
69 | pname == "pango" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
63 | pname == "pcap" = deriv { extraLibs = "libpcap":extraLibs }
70 | pname == "pcap" = deriv { extraLibs = "libpcap":extraLibs }
64 | pname == "persistent" = deriv { extraLibs = "sqlite3":extraLibs }
71 | pname == "persistent" = deriv { extraLibs = "sqlite3":extraLibs }
72+ | pname == "poppler" = deriv { extraLibs = "libc":extraLibs }
65 | pname == "repa-algorithms" = deriv { extraLibs = "llvm":extraLibs }
73 | pname == "repa-algorithms" = deriv { extraLibs = "llvm":extraLibs }
66 | pname == "repa-examples" = deriv { extraLibs = "llvm":extraLibs }
74 | pname == "repa-examples" = deriv { extraLibs = "llvm":extraLibs }
67 | pname == "SDL-image" = deriv { extraLibs = "SDL_image":extraLibs }
75 | pname == "SDL-image" = deriv { extraLibs = "SDL_image":extraLibs }
68 | pname == "SDL-mixer" = deriv { extraLibs = "SDL_mixer":extraLibs }
76 | pname == "SDL-mixer" = deriv { extraLibs = "SDL_mixer":extraLibs }
69 | pname == "SDL-ttf" = deriv { extraLibs = "SDL_ttf":extraLibs }
77 | pname == "SDL-ttf" = deriv { extraLibs = "SDL_ttf":extraLibs }
78+ | pname == "sloane" = deriv { phaseOverrides = sloanePostInstall }
79+ | pname == "structured-haskell-mode" = deriv { buildTools = "emacs":buildTools, phaseOverrides = structuredHaskellModePostInstall }
70 | pname == "svgcairo" = deriv { extraLibs = "libc":extraLibs }
80 | pname == "svgcairo" = deriv { extraLibs = "libc":extraLibs }
71 | pname == "terminfo" = deriv { extraLibs = "ncurses":extraLibs }
81 | pname == "terminfo" = deriv { extraLibs = "ncurses":extraLibs }
72 | pname == "threadscope" = deriv { configureFlags = "--ghc-options=-rtsopts":configureFlags }
82 | pname == "threadscope" = deriv { configureFlags = "--ghc-options=-rtsopts":configureFlags }
73− | pname == "trifecta" = deriv { phaseOverrides = trifectaPostPatch }
83+ | pname == "unix-time" = deriv { phaseOverrides = unixTimeConfigureFlags }
74 | pname == "vacuum" = deriv { extraLibs = "ghcPaths":extraLibs }
84 | pname == "vacuum" = deriv { extraLibs = "ghcPaths":extraLibs }
75 | pname == "wxc" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs, phaseOverrides = wxcPostInstall }
85 | pname == "wxc" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs, phaseOverrides = wxcPostInstall }
76 | pname == "wxcore" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs }
86 | pname == "wxcore" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs }
@@ -162,22 +172,24 @@ highlightingKatePostProcessing deriv@(MkDerivation {..}) = deriv
162xmonadPostInstall :: String
172xmonadPostInstall :: String
163xmonadPostInstall = unlines
173xmonadPostInstall = unlines
164 [ "postInstall = ''"
174 [ "postInstall = ''"
175+ , " shopt -s globstar"
165 , " mkdir -p $out/share/man/man1"
176 , " mkdir -p $out/share/man/man1"
166− , " mv $out/share/xmonad-*/man/*.1 $out/share/man/man1/"
177+ , " mv \"$out/\"**\"/man/\"*.1 $out/share/man/man1/"
167 , "'';"
178 , "'';"
168 ]
179 ]
169
180
170gitAnnexOverrides :: String
181gitAnnexOverrides :: String
171gitAnnexOverrides = unlines
182gitAnnexOverrides = unlines
172− [ "installPhase = ''"
183+ [ "preConfigure = ''"
173 , " export HOME=\"$NIX_BUILD_TOP/tmp\""
184 , " export HOME=\"$NIX_BUILD_TOP/tmp\""
174 , " mkdir \"$HOME\""
185 , " mkdir \"$HOME\""
175− , " ./Setup install"
176 , "'';"
186 , "'';"
187+ , "installPhase = \"./Setup install\";"
177 , "checkPhase = ''"
188 , "checkPhase = ''"
178 , " cp dist/build/git-annex/git-annex git-annex"
189 , " cp dist/build/git-annex/git-annex git-annex"
179 , " ./git-annex test"
190 , " ./git-annex test"
180 , "'';"
191 , "'';"
192+ , "propagatedUserEnvPkgs = [git lsof];"
181 ]
193 ]
182
194
183ghciPostInstall :: String
195ghciPostInstall :: String
@@ -215,21 +227,45 @@ lhs2texPostInstall = unlines
215ncursesPatchPhase :: String
227ncursesPatchPhase :: String
216ncursesPatchPhase = "patchPhase = \"find . -type f -exec sed -i -e 's|ncursesw/||' {} \\\\;\";"
228ncursesPatchPhase = "patchPhase = \"find . -type f -exec sed -i -e 's|ncursesw/||' {} \\\\;\";"
217
229
218−trifectaPostPatch :: String
219−trifectaPostPatch = unlines
220− [ "postPatch = ''"
221− , " substituteInPlace trifecta.cabal \\"
222− , " --replace \"blaze-html >= 0.5 && < 0.6,\" \"blaze-html >= 0.5 && < 0.7,\" \\"
223− , " --replace \"hashable >= 1.2 && < 1.3,\" \"hashable >= 1.1 && < 1.3,\" \\"
224− , " --replace \"fingertree >= 0.0.1 && < 0.1,\" \"fingertree >= 0.0.1 && < 0.2,\" \\"
225− , " --replace \"comonad == 3.*,\" \"comonad >= 3 && < 5,\" \\"
226− , " --replace \"comonad >= 3 && < 4,\" \"comonad >= 3 && < 5,\""
227− , "'';"
228− ]
229−
230doctestNoHaddock, markdownUnlitNoHaddock :: String
230doctestNoHaddock, markdownUnlitNoHaddock :: String
231markdownUnlitNoHaddock = "noHaddock = self.stdenv.lib.versionOlder self.ghc.version \"7.4\";"
231markdownUnlitNoHaddock = "noHaddock = self.stdenv.lib.versionOlder self.ghc.version \"7.4\";"
232doctestNoHaddock = markdownUnlitNoHaddock
232doctestNoHaddock = markdownUnlitNoHaddock
233
233
234cabal2nixDoCheckHook :: String
234cabal2nixDoCheckHook :: String
235cabal2nixDoCheckHook = "doCheck = self.stdenv.lib.versionOlder \"7.6\" self.ghc.version;"
235cabal2nixDoCheckHook = "doCheck = self.stdenv.lib.versionOlder \"7.6\" self.ghc.version;"
236+
237+eitherNoHaddock :: String
238+eitherNoHaddock = "noHaddock = self.stdenv.lib.versionOlder self.ghc.version \"7.6\";"
239+
240+agdaPostInstall :: String
241+agdaPostInstall = unlines
242+ [ "postInstall = ''"
243+ , " $out/bin/agda-mode compile"
244+ , "'';"
245+ ]
246+
247+structuredHaskellModePostInstall :: String
248+structuredHaskellModePostInstall = unlines
249+ [ "postInstall = ''"
250+ , " emacs -L elisp --batch -f batch-byte-compile \"elisp/\"*.el"
251+ , " install -d $out/share/emacs/site-lisp"
252+ , " install \"elisp/\"*.el \"elisp/\"*.elc $out/share/emacs/site-lisp"
253+ , "'';"
254+ ]
255+
256+unixTimeConfigureFlags :: String
257+unixTimeConfigureFlags =
258+ "configureFlags = self.stdenv.lib.optionalString self.enableSharedLibraries \"--ghc-option=-fPIC\";"
259+
260+sloanePostInstall :: String
261+sloanePostInstall = unlines
262+ [ "postInstall = ''"
263+ , " mkdir -p $out/share/man/man1"
264+ , " cp sloane.1 $out/share/man/man1/"
265+ , "'';"
266+ ]
267+
268+mimeMailConfigureFlags :: String
269+mimeMailConfigureFlags = unlines
270+ [ "configureFlags = \"--ghc-option=-DMIME_MAIL_SENDMAIL_PATH=\\\"${sendmail}\\\"\";"
271+ ]
src/Distribution/NixOS/Derivation/Cabal.hs+7−5
@@ -48,6 +48,7 @@ data Derivation = MkDerivation
48 , src :: Maybe FilePath
48 , src :: Maybe FilePath
49 , isLibrary :: Bool
49 , isLibrary :: Bool
50 , isExecutable :: Bool
50 , isExecutable :: Bool
51+ , extraFunctionArgs :: [String]
51 , buildDepends :: [String]
52 , buildDepends :: [String]
52 , testDepends :: [String]
53 , testDepends :: [String]
53 , buildTools :: [String]
54 , buildTools :: [String]
@@ -78,9 +79,9 @@ renderDerivation deriv = funargs (map text ("cabal" : inputs)) $$ vcat
78 , nest 2 $ vcat $
79 , nest 2 $ vcat $
79 [ attr "pname" $ string (pname deriv)
80 [ attr "pname" $ string (pname deriv)
80 , attr "version" $ doubleQuotes (disp (version deriv))
81 , attr "version" $ doubleQuotes (disp (version deriv))
81− ] ++ maybeToList (fmap (attr "sha256" . string) $ sha256 deriv)
82+ ] ++ maybeToList (fmap (attr "sha256" . string) $ sha256 deriv)
82 ++ maybeToList (fmap (attr "src" . text) $ src deriv)
83 ++ maybeToList (fmap (attr "src" . text) $ src deriv)
83− ++
84+ ++
84 [ boolattr "isLibrary" (not (isLibrary deriv) || isExecutable deriv) (isLibrary deriv)
85 [ boolattr "isLibrary" (not (isLibrary deriv) || isExecutable deriv) (isLibrary deriv)
85 , boolattr "isExecutable" (not (isLibrary deriv) || isExecutable deriv) (isExecutable deriv)
86 , boolattr "isExecutable" (not (isLibrary deriv) || isExecutable deriv) (isExecutable deriv)
86 , listattr "buildDepends" (buildDepends deriv)
87 , listattr "buildDepends" (buildDepends deriv)
@@ -101,7 +102,7 @@ renderDerivation deriv = funargs (map text ("cabal" : inputs)) $$ vcat
101 ]
102 ]
102 where
103 where
103 inputs = nub $ sortBy (compare `on` map toLower) $ filter (/="cabal") $ filter (not . isPrefixOf "self.") $
104 inputs = nub $ sortBy (compare `on` map toLower) $ filter (/="cabal") $ filter (not . isPrefixOf "self.") $
104− buildDepends deriv ++ testDepends deriv ++ buildTools deriv ++ extraLibs deriv ++ pkgConfDeps deriv
105+ buildDepends deriv ++ testDepends deriv ++ buildTools deriv ++ extraLibs deriv ++ pkgConfDeps deriv ++ extraFunctionArgs deriv
105 renderedFlags = [ text "-f" <> (if enable then empty else char '-') <> text f | (FlagName f, enable) <- cabalFlags deriv ]
106 renderedFlags = [ text "-f" <> (if enable then empty else char '-') <> text f | (FlagName f, enable) <- cabalFlags deriv ]
106 ++ map text (configureFlags deriv)
107 ++ map text (configureFlags deriv)
107
108
@@ -115,10 +116,10 @@ parseDerivation buf
115 , [name] <- buf `regsubmatch` "pname *= *\"([^\"]+)\""
116 , [name] <- buf `regsubmatch` "pname *= *\"([^\"]+)\""
116 , [vers'] <- buf `regsubmatch` "version *= *\"([^\"]+)\""
117 , [vers'] <- buf `regsubmatch` "version *= *\"([^\"]+)\""
117 , Just vers <- simpleParse vers'
118 , Just vers <- simpleParse vers'
118− , sha <- buf `regsubmatch` "sha256 *= *\"([^\"]+)\""
119+ , [sha] <- buf `regsubmatch` "sha256 *= *\"([^\"]+)\""
119 , sr <- buf `regsubmatch` "src *= *([^;]+);"
120 , sr <- buf `regsubmatch` "src *= *([^;]+);"
120− , plats <- buf `regsubmatch` "platforms *= *([^;]+);"
121 , hplats <- buf `regsubmatch` "hydraPlatforms *= *([^;]+);"
121 , hplats <- buf `regsubmatch` "hydraPlatforms *= *([^;]+);"
122+ , plats <- buf `regsubmatch` "platforms *= *([^;]+);"
122 , maint <- buf `regsubmatch` "maintainers *= *\\[([^\"]+)]"
123 , maint <- buf `regsubmatch` "maintainers *= *\\[([^\"]+)]"
123 , noHaddock <- buf `regsubmatch` "noHaddock *= *(true|false) *;"
124 , noHaddock <- buf `regsubmatch` "noHaddock *= *(true|false) *;"
124 , jailBreak <- buf `regsubmatch` "jailbreak *= *(true|false) *;"
125 , jailBreak <- buf `regsubmatch` "jailbreak *= *(true|false) *;"
@@ -130,6 +131,7 @@ parseDerivation buf
130 , src = listToMaybe sr
131 , src = listToMaybe sr
131 , isLibrary = False
132 , isLibrary = False
132 , isExecutable = False
133 , isExecutable = False
134+ , extraFunctionArgs = []
133 , buildDepends = []
135 , buildDepends = []
134 , testDepends = []
136 , testDepends = []
135 , buildTools = []
137 , buildTools = []
src/hackage4nix.hs+4−1
@@ -162,7 +162,7 @@ genCabal2NixCmdline (Pkg deriv path _) = unwords $ ["cabal2nix"] ++ opts ++ ['>'
162 | otherwise = [ "--platform=" ++ p | p <- platforms meta ]
162 | otherwise = [ "--platform=" ++ p | p <- platforms meta ]
163 hplats'
163 hplats'
164 | ["self.ghc.meta.platforms"] == platforms meta = []
164 | ["self.ghc.meta.platforms"] == platforms meta = []
165− | otherwise = [ "--hydra-platform=" ++ p | p <- platforms meta ]
165+ | otherwise = [ "--hydra-platform=" ++ p | p <- hydraPlatforms meta ]
166 path'
166 path'
167 | path =~ "/[0-9\\.]+\\.nix$" = replaceFileName path (display (version deriv) <.> "nix")
167 | path =~ "/[0-9\\.]+\\.nix$" = replaceFileName path (display (version deriv) <.> "nix")
168 | otherwise = path
168 | otherwise = path
@@ -228,4 +228,7 @@ badPackagePaths = [ -- These expression are not found on Hackage:
228 , "top-level/all-packages.nix", "top-level/haskell-packages.nix"
228 , "top-level/all-packages.nix", "top-level/haskell-packages.nix"
229 -- This build is way too complicated to maintain it automatically.
229 -- This build is way too complicated to maintain it automatically.
230 , "pkgs/development/compilers/pakcs/default.nix"
230 , "pkgs/development/compilers/pakcs/default.nix"
231+ -- Not registered on Hackage.
232+ , "pkgs/tools/networking/sproxy/default.nix"
233+ , "pkgs/tools/networking/sproxy-web/default.nix"
231 ]
234 ]