@@ -13,7 +13,6 @@ import Data.Set ( Set )
13import qualified Data.Set as Set
13import qualified Data.Set as Set
14import Distribution.Nixpkgs.Haskell
14import Distribution.Nixpkgs.Haskell
15import Distribution.Nixpkgs.Meta
15import Distribution.Nixpkgs.Meta
16−import Distribution.Nixpkgs.License
17import Distribution.Package
16import Distribution.Package
18import Distribution.System
17import Distribution.System
19import Distribution.Text
18import Distribution.Text
@@ -22,7 +21,7 @@ import Language.Nix
23postProcess :: Derivation -> Derivation
22postProcess :: Derivation -> Derivation
24postProcess deriv =
23postProcess 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 ]
26 . fixGtkBuilds
25 . fixGtkBuilds
27 . fixBuildDependsForTools
26 . fixBuildDependsForTools
@@ -56,7 +55,7 @@ fixGtkBuilds drv = drv & dependencies . pkgconfig %~ Set.filter (not . collidesW
56-- for a while packages scraped from Hackage will continue to improperly use
55-- for a while packages scraped from Hackage will continue to improperly use
57-- `build-depends: package-for-tool` instead of `build-tool-depends` (which does
56-- `build-depends: package-for-tool` instead of `build-tool-depends` (which does
58-- also work for Stack). Until that changes, we provide do this to work around
57-- also work for Stack). Until that changes, we provide do this to work around
59−-- those package's brokenness.
58+-- those package's brokeness.
60fixBuildDependsForTools :: Derivation -> Derivation
59fixBuildDependsForTools :: Derivation -> Derivation
61fixBuildDependsForTools = foldr (.) id
60fixBuildDependsForTools = foldr (.) id
62 [ fmap snd $ runState $ do
61 [ fmap snd $ runState $ do
@@ -79,33 +78,25 @@ hooks =
79 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
78 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
80 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
79 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
81 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
80 , ("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)
83 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
82 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
84 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
83 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
85 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
84 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
86 , ("cabal-install", set doCheck False . set phaseOverrides cabalInstallPostInstall)
85 , ("cabal-install", set doCheck False . set phaseOverrides cabalInstallPostInstall)
87− , ("cabal2nix > 2", cabal2nixOverrides)
88 , ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)
86 , ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)
89 , ("dbus", set doCheck False) -- don't execute tests that try to access the network
87 , ("dbus", set doCheck False) -- don't execute tests that try to access the network
90 , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
88 , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
91 , ("eventstore", over (metaSection . platforms) (Set.filter (\(Platform arch _) -> arch == X86_64)))
89 , ("eventstore", over (metaSection . platforms) (Set.filter (\(Platform arch _) -> arch == X86_64)))
92 , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))
90 , ("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.
94 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
91 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
95 , ("gi-cairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
92 , ("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 )
99 , ("gi-gst", giGstLibOverrides "gstreamer") -- https://github.com/haskell-gi/haskell-gi/issues/36
93 , ("gi-gst", giGstLibOverrides "gstreamer") -- https://github.com/haskell-gi/haskell-gi/issues/36
100 , ("gi-gstaudio", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
94 , ("gi-gstaudio", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
101 , ("gi-gstbase", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
95 , ("gi-gstbase", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
102 , ("gi-gstvideo", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
96 , ("gi-gstvideo", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
103− , ("gi-gtk", set runHaddock True )
104 , ("gi-javascriptcore < 4.0.0.0", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
97 , ("gi-javascriptcore < 4.0.0.0", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
105 , ("gi-pango", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
98 , ("gi-pango", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
106− , ("gi-pango", set runHaddock True )
107 , ("gi-pangocairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
99 , ("gi-pangocairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
108− , ("gi-vte", set runHaddock True )
109 , ("gi-webkit", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
100 , ("gi-webkit", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
110 , ("gio", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
101 , ("gio", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
111 , ("git", set doCheck False) -- https://github.com/vincenthz/hit/issues/33
102 , ("git", set doCheck False) -- https://github.com/vincenthz/hit/issues/33
@@ -116,7 +107,6 @@ hooks =
116 , ("GlomeVec", set (libraryDepends . pkgconfig . contains (bind "self.llvmPackages.llvm")) True)
107 , ("GlomeVec", set (libraryDepends . pkgconfig . contains (bind "self.llvmPackages.llvm")) True)
117 , ("graphviz", set (testDepends . system . contains (pkg "graphviz")) True)
108 , ("graphviz", set (testDepends . system . contains (pkg "graphviz")) True)
118 , ("gtk3", gtk3Hook)
109 , ("gtk3", gtk3Hook)
119− , ("gtkglext", gtkglextHook)
120 , ("haddock", haddockHook) -- https://github.com/haskell/haddock/issues/511
110 , ("haddock", haddockHook) -- https://github.com/haskell/haddock/issues/511
121 , ("hakyll", set (testDepends . tool . contains (pkg "utillinux")) True) -- test suite depends on "rev"
111 , ("hakyll", set (testDepends . tool . contains (pkg "utillinux")) True) -- test suite depends on "rev"
122 , ("haskell-src-exts", set doCheck False)
112 , ("haskell-src-exts", set doCheck False)
@@ -148,10 +138,9 @@ hooks =
148 , ("network-attoparsec", set doCheck False) -- test suite requires network access
138 , ("network-attoparsec", set doCheck False) -- test suite requires network access
149 , ("numeric-qq", set doCheck False) -- test suite doesn't finish even after 1+ days
139 , ("numeric-qq", set doCheck False) -- test suite doesn't finish even after 1+ days
150 , ("opencv", opencvOverrides)
140 , ("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
141+ , ("pandoc >= 1.16.0.2", set doCheck False) -- https://github.com/jgm/pandoc/issues/2709 and https://github.com/fpco/stackage/issues/1332
152− , ("pandoc < 2.6", pandocPre26Overrides)
142+ , ("pandoc", set jailbreak False) -- jailbreak-cabal break the build
153− , ("pandoc >= 2.6", pandocOverrides)
154− , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/369
143+ , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/172
155 , ("purescript", set doCheck False) -- test suite doesn't cope with Nix build env
144 , ("purescript", set doCheck False) -- test suite doesn't cope with Nix build env
156 , ("proto-lens-protobuf-types", set (libraryDepends . tool . contains (pkg "protobuf")) True)
145 , ("proto-lens-protobuf-types", set (libraryDepends . tool . contains (pkg "protobuf")) True)
157 , ("proto-lens-protoc", set (libraryDepends . tool . contains (pkg "protobuf")) True)
146 , ("proto-lens-protoc", set (libraryDepends . tool . contains (pkg "protobuf")) True)
@@ -181,10 +170,9 @@ hooks =
181 , ("wxc", wxcHook)
170 , ("wxc", wxcHook)
182 , ("wxcore", set (libraryDepends . pkgconfig . contains (pkg "wxGTK")) True)
171 , ("wxcore", set (libraryDepends . pkgconfig . contains (pkg "wxGTK")) True)
183 , ("X11", over (libraryDepends . system) (Set.union (Set.fromList $ map bind ["pkgs.xorg.libXinerama","pkgs.xorg.libXext","pkgs.xorg.libXrender","pkgs.xorg.libXScrnSaver"])))
172 , ("X11", over (libraryDepends . system) (Set.union (Set.fromList $ map bind ["pkgs.xorg.libXinerama","pkgs.xorg.libXext","pkgs.xorg.libXrender","pkgs.xorg.libXScrnSaver"])))
184− , ("xmonad >= 0.14.2", set phaseOverrides xmonadPostInstall)
173+ , ("xmonad", set phaseOverrides xmonadPostInstall)
185 , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (self "zip") (pkg "zip")))
174 , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (self "zip") (pkg "zip")))
186 , ("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
175 , ("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)
190pkg :: Identifier -> Binding
178pkg :: Identifier -> Binding
@@ -230,12 +218,13 @@ gitAnnexHook = set phaseOverrides gitAnnexOverrides
231 gitAnnexOverrides = unlines
219 gitAnnexOverrides = unlines
232 [ "preConfigure = \"export HOME=$TEMPDIR; patchShebangs .\";"
220 [ "preConfigure = \"export HOME=$TEMPDIR; patchShebangs .\";"
233− , "postBuild = ''"
221+ , "installPhase = \"make PREFIX=$out BUILDER=: install\";"
234 , " ln -sf dist/build/git-annex/git-annex git-annex"
223 , " ln -sf dist/build/git-annex/git-annex git-annex"
235 , " ln -sf git-annex git-annex-shell"
224 , " ln -sf git-annex git-annex-shell"
225+ , " export PATH+=\":$PWD\""
237− , "installPhase = \"make PREFIX=$out BUILDER=: install install-completions\";"
238− , "checkPhase = ''PATH+=\":$PWD\" git-annex test'';"
239 , "enableSharedExecutables = false;"
228 , "enableSharedExecutables = false;"
241 buildInputs = pkgs ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]
230 buildInputs = pkgs ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]
@@ -256,7 +245,7 @@ gfPhaseOverrides = unlines
256 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
245 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
257 -- Parallel compilation fails. Disable it.
246 -- Parallel compilation fails. Disable it.
259− , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH'';"
248+ , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build:$LD_LIBRARY_PATH'';"
260 -- The build step itself, after having built the library, needs to be able
249 -- The build step itself, after having built the library, needs to be able
261 -- to find the library it just built in order to compile grammar files.
250 -- to find the library it just built in order to compile grammar files.
@@ -292,8 +281,10 @@ darcsInstallPostInstall = unlines
292xmonadPostInstall :: String
281xmonadPostInstall :: String
293xmonadPostInstall = unlines
282xmonadPostInstall = unlines
294 [ "postInstall = ''"
283 [ "postInstall = ''"
295− , " install -D man/xmonad.1 ''${!outputDoc}/share/man/man1/xmonad.1"
284+ , " shopt -s globstar"
296− , " install -D man/xmonad.hs ''${!outputDoc}/share/doc/$name/sample-xmonad.hs"
285+ , " mkdir -p $doc/share/man/man1"
286+ , " mv \"$data/\"**\"/man/\"*[0-9] $doc/share/man/man1/"
287+ , " rm \"$data/\"**\"/man/\"*"
@@ -360,50 +351,8 @@ webkitgtk24xHook = set (libraryDepends . pkgconfig . contains (pkg "webkitgtk24x
360opencvOverrides :: Derivation -> Derivation
351opencvOverrides :: Derivation -> Derivation
361opencvOverrides = set phaseOverrides "hardeningDisable = [ \"bindnow\" ];"
352opencvOverrides = set phaseOverrides "hardeningDisable = [ \"bindnow\" ];"
362 . over (libraryDepends . pkgconfig) (replace (pkg "opencv") (pkg "opencv3"))
353 . over (libraryDepends . pkgconfig) (replace (pkg "opencv") (pkg "opencv3"))
354+ . set (configureFlags . contains "--with-gcc=${stdenv.cc}/bin/c++") True
355+ . set (configureFlags . contains "--with-ld=${stdenv.cc}/bin/c++") True
364hspecCoreOverrides :: Derivation -> Derivation -- https://github.com/hspec/hspec/issues/330
357hspecCoreOverrides :: Derivation -> Derivation -- https://github.com/hspec/hspec/issues/330
365hspecCoreOverrides = set phaseOverrides "testTarget = \"--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'\";"
358hspecCoreOverrides = set phaseOverrides "testTarget = \"--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'\";"
367−cabal2nixOverrides :: Derivation -> Derivation
368−cabal2nixOverrides = set phaseOverrides $ unlines
370− , " export PATH=\"$PWD/dist/build/cabal2nix:$PATH\""
371− , " export HOME=\"$TMPDIR/home\""
375−gtkglextHook :: Derivation -> Derivation
376−gtkglextHook = over (libraryDepends . system) (Set.union (Set.fromList deps))
379− deps = bind <$> [ "pkgs.gtk2"
382− , "pkgs.xorg.libICE"
384− , "pkgs.xorg.libXmu"
387−pandocPre26Overrides :: Derivation -> Derivation
388−pandocPre26Overrides = set phaseOverrides postInstall
390− postInstall = unlines [ "postInstall = ''"
391− , " mkdir -p $out/share"
392− , " mv $data/*/*/man $out/share/"
396−pandocOverrides :: Derivation -> Derivation
397−pandocOverrides = set phaseOverrides postInstall
399− postInstall = unlines [ "postInstall = ''"
400− , " mkdir -p $out/share/man/man1"
401− , " mv \"man/\"*.1 $out/share/man/man1/"
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