@@ -13,7 +13,6 @@ import Data.Set ( Set )
1313import qualified Data.Set as Set
1414import Distribution.Nixpkgs.Haskell
1515import Distribution.Nixpkgs.Meta
16−import Distribution.Nixpkgs.License
1716import Distribution.Package
1817import Distribution.System
1918import Distribution.Text
@@ -22,7 +21,7 @@ import Language.Nix
2221
2322postProcess :: Derivation -> Derivation
2423postProcess deriv =
25− foldr (.) id [ f | (Dependency n vr _, f) <- hooks, packageName deriv == n, packageVersion deriv `withinRange` vr ]
24+ foldr (.) id [ f | (Dependency n vr, f) <- hooks, packageName deriv == n, packageVersion deriv `withinRange` vr ]
2625 . fixGtkBuilds
2726 . fixBuildDependsForTools
2827 $ deriv
@@ -56,7 +55,7 @@ fixGtkBuilds drv = drv & dependencies . pkgconfig %~ Set.filter (not . collidesW
5655-- for a while packages scraped from Hackage will continue to improperly use
5756-- `build-depends: package-for-tool` instead of `build-tool-depends` (which does
5857-- also work for Stack). Until that changes, we provide do this to work around
59−-- those package's brokenness.
58+-- those package's brokeness.
6059fixBuildDependsForTools :: Derivation -> Derivation
6160fixBuildDependsForTools = foldr (.) id
6261 [ fmap snd $ runState $ do
@@ -79,33 +78,25 @@ hooks =
7978 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
8079 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
8180 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
82− , ("bustle", bustleOverrides)
81+ , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
8382 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
8483 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
8584 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
8685 , ("cabal-install", set doCheck False . set phaseOverrides cabalInstallPostInstall)
87− , ("cabal2nix > 2", cabal2nixOverrides)
8886 , ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)
8987 , ("dbus", set doCheck False) -- don't execute tests that try to access the network
9088 , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
9189 , ("eventstore", over (metaSection . platforms) (Set.filter (\(Platform arch _) -> arch == X86_64)))
9290 , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))
93− , ("fltkhs", set (libraryDepends . system . contains (pkg "fltk14")) True . over (libraryDepends . pkgconfig) (Set.union (pkgs ["libGLU", "libGL"]))) -- TODO: fltk14 belongs into the *setup* dependencies.
9491 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
9592 , ("gi-cairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
96− , ("gi-gdk", set runHaddock True )
97− , ("gi-gio", set runHaddock True )
98− , ("gi-glib", set runHaddock True )
9993 , ("gi-gst", giGstLibOverrides "gstreamer") -- https://github.com/haskell-gi/haskell-gi/issues/36
10094 , ("gi-gstaudio", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
10195 , ("gi-gstbase", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
10296 , ("gi-gstvideo", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
103− , ("gi-gtk", set runHaddock True )
10497 , ("gi-javascriptcore < 4.0.0.0", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
10598 , ("gi-pango", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
106− , ("gi-pango", set runHaddock True )
10799 , ("gi-pangocairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
108− , ("gi-vte", set runHaddock True )
109100 , ("gi-webkit", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
110101 , ("gio", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
111102 , ("git", set doCheck False) -- https://github.com/vincenthz/hit/issues/33
@@ -116,7 +107,6 @@ hooks =
116107 , ("GlomeVec", set (libraryDepends . pkgconfig . contains (bind "self.llvmPackages.llvm")) True)
117108 , ("graphviz", set (testDepends . system . contains (pkg "graphviz")) True)
118109 , ("gtk3", gtk3Hook)
119− , ("gtkglext", gtkglextHook)
120110 , ("haddock", haddockHook) -- https://github.com/haskell/haddock/issues/511
121111 , ("hakyll", set (testDepends . tool . contains (pkg "utillinux")) True) -- test suite depends on "rev"
122112 , ("haskell-src-exts", set doCheck False)
@@ -148,10 +138,9 @@ hooks =
148138 , ("network-attoparsec", set doCheck False) -- test suite requires network access
149139 , ("numeric-qq", set doCheck False) -- test suite doesn't finish even after 1+ days
150140 , ("opencv", opencvOverrides)
151− , ("pandoc >= 1.16.0.2 && < 2.5", set doCheck False) -- https://github.com/jgm/pandoc/issues/2709 and https://github.com/fpco/stackage/issues/1332
152− , ("pandoc < 2.6", pandocPre26Overrides)
153− , ("pandoc >= 2.6", pandocOverrides)
154− , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/369
141+ , ("pandoc >= 1.16.0.2", set doCheck False) -- https://github.com/jgm/pandoc/issues/2709 and https://github.com/fpco/stackage/issues/1332
142+ , ("pandoc", set jailbreak False) -- jailbreak-cabal break the build
143+ , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/172
155144 , ("purescript", set doCheck False) -- test suite doesn't cope with Nix build env
156145 , ("proto-lens-protobuf-types", set (libraryDepends . tool . contains (pkg "protobuf")) True)
157146 , ("proto-lens-protoc", set (libraryDepends . tool . contains (pkg "protobuf")) True)
@@ -182,9 +171,9 @@ hooks =
182171 , ("wxcore", set (libraryDepends . pkgconfig . contains (pkg "wxGTK")) True)
183172 , ("X11", over (libraryDepends . system) (Set.union (Set.fromList $ map bind ["pkgs.xorg.libXinerama","pkgs.xorg.libXext","pkgs.xorg.libXrender","pkgs.xorg.libXScrnSaver"])))
184173 , ("xmonad >= 0.14.2", set phaseOverrides xmonadPostInstall)
174+ , ("yaml", set (libraryDepends . system . contains (pkg "libyaml")) True)
185175 , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (self "zip") (pkg "zip")))
186176 , ("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
187− , ("zip-archive >= 0.4", set (testDepends . tool . contains (pkg "which")) True)
188177 ]
189178
190179pkg :: Identifier -> Binding
@@ -230,12 +219,13 @@ gitAnnexHook = set phaseOverrides gitAnnexOverrides
230219 where
231220 gitAnnexOverrides = unlines
232221 [ "preConfigure = \"export HOME=$TEMPDIR; patchShebangs .\";"
233− , "postBuild = ''"
222+ , "installPhase = \"make PREFIX=$out BUILDER=: install\";"
223+ , "checkPhase = ''"
234224 , " ln -sf dist/build/git-annex/git-annex git-annex"
235225 , " ln -sf git-annex git-annex-shell"
226+ , " export PATH+=\":$PWD\""
227+ , " git-annex test"
236228 , "'';"
237− , "installPhase = \"make PREFIX=$out BUILDER=: install install-completions\";"
238− , "checkPhase = ''PATH+=\":$PWD\" git-annex test'';"
239229 , "enableSharedExecutables = false;"
240230 ]
241231 buildInputs = pkgs ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]
@@ -256,7 +246,7 @@ gfPhaseOverrides = unlines
256246 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
257247 -- Parallel compilation fails. Disable it.
258248 , "'';"
259− , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH'';"
249+ , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build:$LD_LIBRARY_PATH'';"
260250 -- The build step itself, after having built the library, needs to be able
261251 -- to find the library it just built in order to compile grammar files.
262252 ]
@@ -292,8 +282,8 @@ darcsInstallPostInstall = unlines
292282xmonadPostInstall :: String
293283xmonadPostInstall = unlines
294284 [ "postInstall = ''"
295− , " install -D man/xmonad.1 ''${!outputDoc}/share/man/man1/xmonad.1"
296− , " install -D man/xmonad.hs ''${!outputDoc}/share/doc/$name/sample-xmonad.hs"
285+ , " install -D man/xmonad.1 $doc/share/man/man1/xmonad.1"
286+ , " install -D man/xmonad.hs $doc/share/doc/$name/sample-xmonad.hs"
297287 , "'';"
298288 ]
299289
@@ -360,50 +350,8 @@ webkitgtk24xHook = set (libraryDepends . pkgconfig . contains (pkg "webkitgtk24x
360350opencvOverrides :: Derivation -> Derivation
361351opencvOverrides = set phaseOverrides "hardeningDisable = [ \"bindnow\" ];"
362352 . over (libraryDepends . pkgconfig) (replace (pkg "opencv") (pkg "opencv3"))
353+ . set (configureFlags . contains "--with-gcc=${stdenv.cc}/bin/c++") True
354+ . set (configureFlags . contains "--with-ld=${stdenv.cc}/bin/c++") True
363355
364356hspecCoreOverrides :: Derivation -> Derivation -- https://github.com/hspec/hspec/issues/330
365357hspecCoreOverrides = set phaseOverrides "testTarget = \"--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'\";"
366−
367−cabal2nixOverrides :: Derivation -> Derivation
368−cabal2nixOverrides = set phaseOverrides $ unlines
369− [ "preCheck = ''"
370− , " export PATH=\"$PWD/dist/build/cabal2nix:$PATH\""
371− , " export HOME=\"$TMPDIR/home\""
372− , "'';"
373− ]
374−
375−gtkglextHook :: Derivation -> Derivation
376−gtkglextHook = over (libraryDepends . system) (Set.union (Set.fromList deps))
377− where
378− deps :: [Binding]
379− deps = bind <$> [ "pkgs.gtk2"
380− , "pkgs.libGLU"
381− , "pkgs.xorg.libSM"
382− , "pkgs.xorg.libICE"
383− , "pkgs.xorg.libXt"
384− , "pkgs.xorg.libXmu"
385− ]
386−
387−pandocPre26Overrides :: Derivation -> Derivation
388−pandocPre26Overrides = set phaseOverrides postInstall
389− where
390− postInstall = unlines [ "postInstall = ''"
391− , " mkdir -p $out/share"
392− , " mv $data/*/*/man $out/share/"
393− , "'';"
394− ]
395−
396−pandocOverrides :: Derivation -> Derivation
397−pandocOverrides = set phaseOverrides postInstall
398− where
399− postInstall = unlines [ "postInstall = ''"
400− , " mkdir -p $out/share/man/man1"
401− , " mv \"man/\"*.1 $out/share/man/man1/"
402− , "'';"
403− ]
404−
405−bustleOverrides :: Derivation -> Derivation
406−bustleOverrides = set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True
407− . set (executableDepends . pkgconfig . contains "gio-unix = null") False
408− . set (metaSection . license) (Known "stdenv.lib.licenses.lgpl21Plus")
409− . set (metaSection . hydraPlatforms) allKnownPlatforms