git.iko.soy/typeable/cabal2nix
on master help sign in
Merge branch 'master' into feature-local-only
commit1f68b44467c2ec11afc61362960f6a9cd00c1f19 authorBenno Fünfstück <benno.fuenfstueck@gmail.com> dateSat 12 Apr 2014, 13:14 (13 years ago) parent1b92b214455aa9
10 files changed+160−107
README.md+2−2 cabal2nix.cabal+4−4 src/Cabal2Nix/Flags.hs+4−1 src/Cabal2Nix/Generate.hs+1 src/Cabal2Nix/Hackage.hs+1−1 src/Cabal2Nix/License.hs+16−15 src/Cabal2Nix/Name.hs+69−62 src/Cabal2Nix/PostProcess.hs+52−16 src/Distribution/NixOS/Derivation/Cabal.hs+7−5 src/hackage4nix.hs+4−1
README.md+2−2
@@ -115,7 +115,7 @@ packages available in Nix have been generated automatically from their
115115Cabal files. There are only a handful of exceptions, which we cannot
116116generate because these packages aren't available on Hackage. The list of
117117those 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)
119119binary in the function `badPackagePaths`.
120120
121121Furthermore, Hackage4Nix will not re-generate packages that have been
@@ -133,5 +133,5 @@ the tool [`package-list`](http://github.com/peti/package-list),
133133and published at <http://cryp.to/haskell-in-nixpkgs.txt>. Hackage picks
134134it up from there and generates links on each package's homepage to the
135135corresponding 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
137137details.
cabal2nix.cabal+4−4
@@ -1,5 +1,5 @@
11Name: cabal2nix
2−Version: 1.58
2+Version: 1.62
33Copyright: Peter Simons, Andres Loeh
44License: BSD3
55License-File: LICENSE
@@ -10,7 +10,7 @@ Category: Distribution
1010Synopsis: Convert Cabal files into Nix build instructions
1111Cabal-Version: >= 1.8
1212Build-Type: Custom
13−Tested-With: GHC >= 6.12.3 && <= 7.6.3
13+Tested-With: GHC >= 6.12.3 && <= 7.8.1
1414Data-files: README.md
1515Description:
1616 The @cabal2nix@ utility converts Cabal files into Nix build instructions. The
@@ -34,8 +34,8 @@ Description:
3434 .
3535 The only required argument is the path to the cabal file. For example:
3636 .
37− > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.58/cabal2nix.cabal
38− > cabal2nix cabal://cabal2nix-1.58
37+ > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.62/cabal2nix.cabal
38+ > cabal2nix cabal://cabal2nix-1.62
3939 .
4040 If the @--sha256@ option has not been specified, cabal2nix calls
4141 @nix-prefetch-url@ to determine the hash automatically. This causes
src/Cabal2Nix/Flags.hs+4−1
@@ -12,9 +12,12 @@ configureCabalFlags (PackageIdentifier (PackageName name) _)
1212 , enable "Production", enable "TDFA"]
1313 | name == "haskeline" = [enable "terminfo"]
1414 | name == "hslua" = [enable "system-lua"]
15+ | name == "idris" = [enable "llvm", enable "gmp", enable "ffi"]
16+ | name == "io-streams" = [enable "NoInteractiveTests"]
1517 | 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"]
1719 | name == "xmonad-extras" = [disable "with_hlist", enable "with_split", enable "with_parsec"]
20+ | name == "yi" = [enable "pango"]
1821 | otherwise = []
1922
2023enable :: String -> (FlagName,Bool)
src/Cabal2Nix/Generate.hs+1
@@ -20,6 +20,7 @@ cabal2nix cabal = normalize $ postProcess MkDerivation
2020 , src = Nothing
2121 , isLibrary = isJust (Cabal.library tpkg)
2222 , isExecutable = not (null (Cabal.executables tpkg))
23+ , extraFunctionArgs = []
2324 , buildDepends = map unDep deps
2425 , testDepends = map unDep tstDeps ++ concatMap Cabal.extraLibs tests
2526 , buildTools = map unDep tools
src/Cabal2Nix/Hackage.hs+1−1
@@ -76,7 +76,7 @@ readCabalFile path
7676
7777fetchUrl :: String -> IO String
7878fetchUrl url = do
79− (_,rsp) <- Network.Browser.browse $ do
79+ (_,rsp) <- browse $ do
8080 setCheckForProxy True
8181 setDebugLog Nothing
8282 setOutHandler (\_ -> return ())
src/Cabal2Nix/License.hs+16−15
@@ -5,18 +5,19 @@ import Distribution.License ( License(..) )
55import Data.Version
66
77fromCabalLicense :: Distribution.License.License -> Distribution.NixOS.Derivation.License.License
8−fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
9−fromCabalLicense (GPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.gpl2"
10−fromCabalLicense (GPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
11−fromCabalLicense (LGPL Nothing) = Unknown (Just "LGPL")
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"
14−fromCabalLicense (LGPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
15−fromCabalLicense BSD3 = Known "self.stdenv.lib.licenses.bsd3"
16−fromCabalLicense BSD4 = Known "self.stdenv.lib.licenses.bsd4"
17−fromCabalLicense MIT = Known "self.stdenv.lib.licenses.mit"
18−fromCabalLicense PublicDomain = Known "self.stdenv.lib.licenses.publicDomain"
19−fromCabalLicense AllRightsReserved = Known "self.stdenv.lib.licenses.proprietary"
20−fromCabalLicense (Apache Nothing) = Known "self.stdenv.lib.licenses.asl20"
21−fromCabalLicense OtherLicense = Unknown Nothing
22−fromCabalLicense l = error $ "Cabal2Nix.License.fromCabalLicense: unknown license " ++ show l
8+fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
9+fromCabalLicense (GPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.gpl2"
10+fromCabalLicense (GPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
11+fromCabalLicense (LGPL Nothing) = Unknown (Just "LGPL")
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"
14+fromCabalLicense (LGPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
15+fromCabalLicense BSD3 = Known "self.stdenv.lib.licenses.bsd3"
16+fromCabalLicense BSD4 = Known "self.stdenv.lib.licenses.bsd4"
17+fromCabalLicense MIT = Known "self.stdenv.lib.licenses.mit"
18+fromCabalLicense PublicDomain = Known "self.stdenv.lib.licenses.publicDomain"
19+fromCabalLicense AllRightsReserved = Known "self.stdenv.lib.licenses.unfree"
20+fromCabalLicense (Apache Nothing) = Known "self.stdenv.lib.licenses.asl20"
21+fromCabalLicense (Apache (Just (Version [2,0] []))) = Known "self.stdenv.lib.licenses.asl20"
22+fromCabalLicense OtherLicense = Unknown Nothing
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
1717-- possibility of name clashes with Haskell libraries. I have included
1818-- identity mappings to incicate that I have verified their correctness.
1919libNixName :: String -> [String]
20−libNixName "adns" = return "adns"
21−libNixName "alsa" = return "alsaLib"
22−libNixName "cairo-pdf" = return "cairo"
23−libNixName "cairo-ps" = return "cairo"
24−libNixName "cairo" = return "cairo"
25−libNixName "cairo-svg" = return "cairo"
26−libNixName "crypto" = return "openssl"
27−libNixName "gconf-2.0" = return "gconf"
28−libNixName "gio-2.0" = return "glib"
29−libNixName "glib-2.0" = return "glib"
30−libNixName "GL" = return "mesa"
31−libNixName "GLU" = ["freeglut","mesa"]
32−libNixName "glut" = ["freeglut","mesa"]
33−libNixName "gnome-keyring-1" = return "gnome_keyring"
34−libNixName "gnome-keyring" = return "gnome_keyring"
35−libNixName "gobject-2.0" = return "glib"
36−libNixName "gstreamer-0.10" = return "gstreamer"
20+libNixName "adns" = return "adns"
21+libNixName "alsa" = return "alsaLib"
22+libNixName "asound" = return "alsaLib"
23+libNixName "cairo-pdf" = return "cairo"
24+libNixName "cairo-ps" = return "cairo"
25+libNixName "cairo" = return "cairo"
26+libNixName "cairo-svg" = return "cairo"
27+libNixName "crypto" = return "openssl"
28+libNixName "dl" = [] -- provided by glibc
29+libNixName "gconf-2.0" = return "gconf"
30+libNixName "gdk-2.0" = return "gtk"
31+libNixName "gdk-pixbuf-2.0" = return "gdk_pixbuf"
32+libNixName "gio-2.0" = return "glib"
33+libNixName "glib-2.0" = return "glib"
34+libNixName "GL" = return "mesa"
35+libNixName "GLU" = ["freeglut","mesa"]
36+libNixName "glut" = ["freeglut","mesa"]
37+libNixName "gnome-keyring-1" = return "gnome_keyring"
38+libNixName "gnome-keyring" = return "gnome_keyring"
39+libNixName "gobject-2.0" = return "glib"
40+libNixName "gstreamer-0.10" = return "gstreamer"
3741libNixName "gstreamer-audio-0.10" = return "gstreamer-audio"
3842libNixName "gstreamer-base-0.10" = return "gstreamer-base"
3943libNixName "gstreamer-controller-0.10" = return "gstreamer-controller"
4044libNixName "gstreamer-dataprotocol-0.10" = return "gstreamer-dataprotocol"
4145libNixName "gstreamer-net-0.10" = return "gstreamer-net"
4246libNixName "gstreamer-plugins-base-0.10" = return "gstreamer-plugins-base"
43−libNixName "gthread-2.0" = return "glib"
44−libNixName "gtk+-2.0" = return "gtk"
45−libNixName "gtkglext-1.0" = return "gtkglext"
46−libNixName "gtksourceview-2.0" = return "gtksourceview"
47−libNixName "icudata" = return "icu"
48−libNixName "icui18n" = return "icu"
49−libNixName "icuuc" = return "icu"
50−libNixName "idn" = return "libidn"
51−libNixName "IL" = return "libdevil"
52−libNixName "iw" = return "wirelesstools"
53−libNixName "jpeg" = return "libjpeg"
54−libNixName "libglade-2.0" = return "libglade"
55−libNixName "libgsasl" = return "gsasl"
56−libNixName "librsvg-2.0" = return "librsvg"
57−libNixName "libusb-1.0" = return "libusb"
58−libNixName "libxml-2.0" = return "libxml2"
59−libNixName "libzip" = return "libzip"
60−libNixName "m" = [] -- in stdenv
61−libNixName "ncursesw" = return "ncurses"
62−libNixName "panelw" = return "ncurses"
63−libNixName "pangocairo" = return "pango"
64−libNixName "pcre" = return "pcre"
65−libNixName "png" = return "libpng"
66−libNixName "pq" = return "postgresql"
67−libNixName "pthread" = []
68−libNixName "sndfile" = return "libsndfile"
69−libNixName "sqlite3" = return "sqlite"
70−libNixName "ssl" = return "openssl"
71−libNixName "stdc++" = [] -- in stdenv
72−libNixName "webkit-1.0" = return "webkit"
73−libNixName "X11" = return "libX11"
74−libNixName "Xext" = return "libXext"
75−libNixName "xft" = return "libXft"
76−libNixName "xml2" = return "libxml2"
77−libNixName "Xrandr" = return "libXrandr"
78−libNixName "Xss" = return "libXScrnSaver"
79−libNixName "Xtst" = return "libXtst"
80−libNixName "zmq" = return "zeromq"
81−libNixName "z" = return "zlib"
82−libNixName x = return x
47+libNixName "gthread-2.0" = return "glib"
48+libNixName "gtk+-2.0" = return "gtk"
49+libNixName "gtkglext-1.0" = return "gtkglext"
50+libNixName "gtksourceview-2.0" = return "gtksourceview"
51+libNixName "icudata" = return "icu"
52+libNixName "icui18n" = return "icu"
53+libNixName "icuuc" = return "icu"
54+libNixName "idn" = return "libidn"
55+libNixName "IL" = return "libdevil"
56+libNixName "iw" = return "wirelesstools"
57+libNixName "jpeg" = return "libjpeg"
58+libNixName "libglade-2.0" = return "libglade"
59+libNixName "libgsasl" = return "gsasl"
60+libNixName "librsvg-2.0" = return "librsvg"
61+libNixName "libusb-1.0" = return "libusb"
62+libNixName "libxml-2.0" = return "libxml2"
63+libNixName "libzip" = return "libzip"
64+libNixName "libzmq" = return "zeromq"
65+libNixName "m" = [] -- in stdenv
66+libNixName "ncursesw" = return "ncurses"
67+libNixName "panelw" = return "ncurses"
68+libNixName "pangocairo" = return "pango"
69+libNixName "pcre" = return "pcre"
70+libNixName "png" = return "libpng"
71+libNixName "poppler-glib" = return "popplerGlib"
72+libNixName "pq" = return "postgresql"
73+libNixName "pthread" = []
74+libNixName "sndfile" = return "libsndfile"
75+libNixName "sqlite3" = return "sqlite"
76+libNixName "ssl" = return "openssl"
77+libNixName "stdc++" = [] -- in stdenv
78+libNixName "webkit-1.0" = return "webkit"
79+libNixName "X11" = return "libX11"
80+libNixName "Xext" = return "libXext"
81+libNixName "xft" = return "libXft"
82+libNixName "Xi" = return "libXi"
83+libNixName "xml2" = return "libxml2"
84+libNixName "Xrandr" = return "libXrandr"
85+libNixName "Xss" = return "libXScrnSaver"
86+libNixName "Xtst" = return "libXtst"
87+libNixName "zmq" = return "zeromq"
88+libNixName "z" = return "zlib"
89+libNixName x = return x
8390
8491-- | Map build tool names to Nix attribute names.
8592buildToolNixName :: String -> [String]
86−buildToolNixName "cabal" = return "cabalInstall"
87−buildToolNixName "gtk2hsC2hs" = return "gtk2hsBuildtools"
88−buildToolNixName "gtk2hsHookGenerator" = return "gtk2hsBuildtools"
89−buildToolNixName "gtk2hsTypeGen" = return "gtk2hsBuildtools"
90−buildToolNixName x = return (toNixName x)
93+buildToolNixName "cabal" = return "cabalInstall"
94+buildToolNixName "gtk2hsC2hs" = return "gtk2hsBuildtools"
95+buildToolNixName "gtk2hsHookGenerator" = return "gtk2hsBuildtools"
96+buildToolNixName "gtk2hsTypeGen" = return "gtk2hsBuildtools"
97+buildToolNixName x = return (toNixName x)
src/Cabal2Nix/PostProcess.hs+52−16
@@ -7,6 +7,9 @@ import Data.List
77
88postProcess :: Derivation -> Derivation
99postProcess deriv@(MkDerivation {..})
10+ | pname == "aeson" && version > Version [0,7] []
11+ = deriv { buildDepends = "blazeBuilder":buildDepends }
12+ | pname == "Agda" = deriv { buildTools = "emacs":buildTools, phaseOverrides = agdaPostInstall }
1013 | pname == "alex" && version < Version [3,1] []
1114 = deriv { buildTools = "perl":buildTools }
1215 | pname == "alex" && version >= Version [3,1] []
@@ -21,6 +24,7 @@ postProcess deriv@(MkDerivation {..})
2124 | pname == "doctest" = deriv { runHaddock = True, phaseOverrides = doctestNoHaddock }
2225 | pname == "editline" = deriv { extraLibs = "libedit":extraLibs }
2326 | pname == "epic" = deriv { extraLibs = "gmp":"boehmgc":extraLibs, buildTools = "happy":buildTools }
27+ | pname == "either" = deriv { runHaddock = True, phaseOverrides = eitherNoHaddock }
2428 | pname == "ghc-heap-view" = deriv { phaseOverrides = ghciPostInstall }
2529 | pname == "ghc-mod" = deriv { phaseOverrides = ghcModPostInstall, buildTools = "emacs":buildTools }
2630 | pname == "ghc-paths" = deriv { phaseOverrides = ghcPathsPatches }
@@ -29,6 +33,7 @@ postProcess deriv@(MkDerivation {..})
2933 | pname == "github-backup" = deriv { buildTools = "git":buildTools }
3034 | pname == "glade" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, pkgConfDeps = "gtkC":delete "gtk" pkgConfDeps }
3135 | pname == "glib" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
36+ | pname == "gloss-raster" = deriv { extraLibs = "llvm":extraLibs }
3237 | pname == "GLUT" = deriv { extraLibs = "glut":"libSM":"libICE":"libXmu":"libXi":"mesa":extraLibs }
3338 | pname == "gtk" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, buildDepends = delete "gio" buildDepends }
3439 | pname == "gtksourceview2" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
@@ -55,6 +60,8 @@ postProcess deriv@(MkDerivation {..})
5560 | pname == "llvm-general-pure"= deriv { doCheck = False }
5661 | pname == "markdown-unlit" = deriv { runHaddock = True, phaseOverrides = markdownUnlitNoHaddock }
5762 | 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 }
5865 | pname == "ncurses" = deriv { phaseOverrides = ncursesPatchPhase }
5966 | pname == "OpenAL" = deriv { extraLibs = "openal":extraLibs }
6067 | pname == "OpenGL" = deriv { extraLibs = "mesa":"libX11":extraLibs }
@@ -62,15 +69,18 @@ postProcess deriv@(MkDerivation {..})
6269 | pname == "pango" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
6370 | pname == "pcap" = deriv { extraLibs = "libpcap":extraLibs }
6471 | pname == "persistent" = deriv { extraLibs = "sqlite3":extraLibs }
72+ | pname == "poppler" = deriv { extraLibs = "libc":extraLibs }
6573 | pname == "repa-algorithms" = deriv { extraLibs = "llvm":extraLibs }
6674 | pname == "repa-examples" = deriv { extraLibs = "llvm":extraLibs }
6775 | pname == "SDL-image" = deriv { extraLibs = "SDL_image":extraLibs }
6876 | pname == "SDL-mixer" = deriv { extraLibs = "SDL_mixer":extraLibs }
6977 | 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 }
7080 | pname == "svgcairo" = deriv { extraLibs = "libc":extraLibs }
7181 | pname == "terminfo" = deriv { extraLibs = "ncurses":extraLibs }
7282 | pname == "threadscope" = deriv { configureFlags = "--ghc-options=-rtsopts":configureFlags }
73− | pname == "trifecta" = deriv { phaseOverrides = trifectaPostPatch }
83+ | pname == "unix-time" = deriv { phaseOverrides = unixTimeConfigureFlags }
7484 | pname == "vacuum" = deriv { extraLibs = "ghcPaths":extraLibs }
7585 | pname == "wxc" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs, phaseOverrides = wxcPostInstall }
7686 | pname == "wxcore" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs }
@@ -162,22 +172,24 @@ highlightingKatePostProcessing deriv@(MkDerivation {..}) = deriv
162172xmonadPostInstall :: String
163173xmonadPostInstall = unlines
164174 [ "postInstall = ''"
175+ , " shopt -s globstar"
165176 , " 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/"
167178 , "'';"
168179 ]
169180
170181gitAnnexOverrides :: String
171182gitAnnexOverrides = unlines
172− [ "installPhase = ''"
183+ [ "preConfigure = ''"
173184 , " export HOME=\"$NIX_BUILD_TOP/tmp\""
174185 , " mkdir \"$HOME\""
175− , " ./Setup install"
176186 , "'';"
187+ , "installPhase = \"./Setup install\";"
177188 , "checkPhase = ''"
178189 , " cp dist/build/git-annex/git-annex git-annex"
179190 , " ./git-annex test"
180191 , "'';"
192+ , "propagatedUserEnvPkgs = [git lsof];"
181193 ]
182194
183195ghciPostInstall :: String
@@ -215,21 +227,45 @@ lhs2texPostInstall = unlines
215227ncursesPatchPhase :: String
216228ncursesPatchPhase = "patchPhase = \"find . -type f -exec sed -i -e 's|ncursesw/||' {} \\\\;\";"
217229
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−
230230doctestNoHaddock, markdownUnlitNoHaddock :: String
231231markdownUnlitNoHaddock = "noHaddock = self.stdenv.lib.versionOlder self.ghc.version \"7.4\";"
232232doctestNoHaddock = markdownUnlitNoHaddock
233233
234234cabal2nixDoCheckHook :: String
235235cabal2nixDoCheckHook = "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
4848 , src :: Maybe FilePath
4949 , isLibrary :: Bool
5050 , isExecutable :: Bool
51+ , extraFunctionArgs :: [String]
5152 , buildDepends :: [String]
5253 , testDepends :: [String]
5354 , buildTools :: [String]
@@ -78,9 +79,9 @@ renderDerivation deriv = funargs (map text ("cabal" : inputs)) $$ vcat
7879 , nest 2 $ vcat $
7980 [ attr "pname" $ string (pname deriv)
8081 , attr "version" $ doubleQuotes (disp (version deriv))
81− ] ++ maybeToList (fmap (attr "sha256" . string) $ sha256 deriv)
82+ ] ++ maybeToList (fmap (attr "sha256" . string) $ sha256 deriv)
8283 ++ maybeToList (fmap (attr "src" . text) $ src deriv)
83− ++
84+ ++
8485 [ boolattr "isLibrary" (not (isLibrary deriv) || isExecutable deriv) (isLibrary deriv)
8586 , boolattr "isExecutable" (not (isLibrary deriv) || isExecutable deriv) (isExecutable deriv)
8687 , listattr "buildDepends" (buildDepends deriv)
@@ -101,7 +102,7 @@ renderDerivation deriv = funargs (map text ("cabal" : inputs)) $$ vcat
101102 ]
102103 where
103104 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
105106 renderedFlags = [ text "-f" <> (if enable then empty else char '-') <> text f | (FlagName f, enable) <- cabalFlags deriv ]
106107 ++ map text (configureFlags deriv)
107108
@@ -115,10 +116,10 @@ parseDerivation buf
115116 , [name] <- buf `regsubmatch` "pname *= *\"([^\"]+)\""
116117 , [vers'] <- buf `regsubmatch` "version *= *\"([^\"]+)\""
117118 , Just vers <- simpleParse vers'
118− , sha <- buf `regsubmatch` "sha256 *= *\"([^\"]+)\""
119+ , [sha] <- buf `regsubmatch` "sha256 *= *\"([^\"]+)\""
119120 , sr <- buf `regsubmatch` "src *= *([^;]+);"
120− , plats <- buf `regsubmatch` "platforms *= *([^;]+);"
121121 , hplats <- buf `regsubmatch` "hydraPlatforms *= *([^;]+);"
122+ , plats <- buf `regsubmatch` "platforms *= *([^;]+);"
122123 , maint <- buf `regsubmatch` "maintainers *= *\\[([^\"]+)]"
123124 , noHaddock <- buf `regsubmatch` "noHaddock *= *(true|false) *;"
124125 , jailBreak <- buf `regsubmatch` "jailbreak *= *(true|false) *;"
@@ -130,6 +131,7 @@ parseDerivation buf
130131 , src = listToMaybe sr
131132 , isLibrary = False
132133 , isExecutable = False
134+ , extraFunctionArgs = []
133135 , buildDepends = []
134136 , testDepends = []
135137 , buildTools = []
src/hackage4nix.hs+4−1
@@ -162,7 +162,7 @@ genCabal2NixCmdline (Pkg deriv path _) = unwords $ ["cabal2nix"] ++ opts ++ ['>'
162162 | otherwise = [ "--platform=" ++ p | p <- platforms meta ]
163163 hplats'
164164 | ["self.ghc.meta.platforms"] == platforms meta = []
165− | otherwise = [ "--hydra-platform=" ++ p | p <- platforms meta ]
165+ | otherwise = [ "--hydra-platform=" ++ p | p <- hydraPlatforms meta ]
166166 path'
167167 | path =~ "/[0-9\\.]+\\.nix$" = replaceFileName path (display (version deriv) <.> "nix")
168168 | otherwise = path
@@ -228,4 +228,7 @@ badPackagePaths = [ -- These expression are not found on Hackage:
228228 , "top-level/all-packages.nix", "top-level/haskell-packages.nix"
229229 -- This build is way too complicated to maintain it automatically.
230230 , "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"
231234 ]