@@ -13,6 +13,7 @@ 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
16import Distribution.Package
17import Distribution.Package
17import Distribution.System
18import Distribution.System
18import Distribution.Text
19import Distribution.Text
@@ -21,7 +22,7 @@ import Language.Nix
22postProcess :: Derivation -> Derivation
23postProcess :: Derivation -> Derivation
23postProcess deriv =
24postProcess deriv =
24− foldr (.) id [ f | (Dependency n vr, f) <- hooks, packageName deriv == n, packageVersion deriv `withinRange` vr ]
25+ foldr (.) id [ f | (Dependency n vr _, f) <- hooks, packageName deriv == n, packageVersion deriv `withinRange` vr ]
25 . fixGtkBuilds
26 . fixGtkBuilds
26 . fixBuildDependsForTools
27 . fixBuildDependsForTools
@@ -78,7 +79,7 @@ hooks =
78 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
79 , ("alsa-core", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
79 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
80 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [bind "pkgs.xorg.libXext", bind "pkgs.xorg.libXfixes"])))
80 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
81 , ("bindings-lxc", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
81− , ("bustle", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
82+ , ("bustle", bustleOverrides)
82 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
83 , ("Cabal", set doCheck False) -- test suite doesn't work in Nix
83 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
84 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
84 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
85 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
@@ -89,7 +90,7 @@ hooks =
89 , ("dns", set testTarget "spec") -- 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
90 , ("eventstore", over (metaSection . platforms) (Set.filter (\(Platform arch _) -> arch == X86_64)))
91 , ("eventstore", over (metaSection . platforms) (Set.filter (\(Platform arch _) -> arch == X86_64)))
91 , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))
92 , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))
92− , ("fltkhs", set (libraryDepends . system . contains (pkg "fltk14")) True . set (libraryDepends . pkgconfig . contains (pkg "libGLU_combined")) True) -- TODO: fltk14 belongs into the *setup* dependencies.
93+ , ("fltkhs", set (libraryDepends . system . contains (pkg "fltk14")) True . over (libraryDepends . pkgconfig) (Set.union (pkgs ["libGLU", "libGL"]))) -- TODO: fltk14 belongs into the *setup* dependencies.
93 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
94 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
94 , ("gi-cairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
95 , ("gi-cairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
95 , ("gi-gdk", set runHaddock True )
96 , ("gi-gdk", set runHaddock True )
@@ -148,7 +149,8 @@ hooks =
148 , ("numeric-qq", set doCheck False) -- test suite doesn't finish even after 1+ days
149 , ("numeric-qq", set doCheck False) -- test suite doesn't finish even after 1+ days
149 , ("opencv", opencvOverrides)
150 , ("opencv", opencvOverrides)
150 , ("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
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)
151− , ("pandoc", pandocOverrides)
153+ , ("pandoc >= 2.6", pandocOverrides)
152 , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/369
154 , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/369
153 , ("purescript", set doCheck False) -- test suite doesn't cope with Nix build env
155 , ("purescript", set doCheck False) -- test suite doesn't cope with Nix build env
154 , ("proto-lens-protobuf-types", set (libraryDepends . tool . contains (pkg "protobuf")) True)
156 , ("proto-lens-protobuf-types", set (libraryDepends . tool . contains (pkg "protobuf")) True)
@@ -182,6 +184,7 @@ hooks =
182 , ("xmonad >= 0.14.2", set phaseOverrides xmonadPostInstall)
184 , ("xmonad >= 0.14.2", set phaseOverrides xmonadPostInstall)
183 , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (self "zip") (pkg "zip")))
185 , ("zip-archive < 0.3.1", over (testDepends . tool) (replace (self "zip") (pkg "zip")))
184 , ("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
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
187+ , ("zip-archive >= 0.4", set (testDepends . tool . contains (pkg "which")) True)
187pkg :: Identifier -> Binding
190pkg :: Identifier -> Binding
@@ -227,13 +230,12 @@ gitAnnexHook = set phaseOverrides gitAnnexOverrides
228 gitAnnexOverrides = unlines
231 gitAnnexOverrides = unlines
229 [ "preConfigure = \"export HOME=$TEMPDIR; patchShebangs .\";"
232 [ "preConfigure = \"export HOME=$TEMPDIR; patchShebangs .\";"
230− , "installPhase = \"make PREFIX=$out BUILDER=: install\";"
233+ , "postBuild = ''"
232 , " ln -sf dist/build/git-annex/git-annex git-annex"
234 , " ln -sf dist/build/git-annex/git-annex git-annex"
233 , " ln -sf git-annex git-annex-shell"
235 , " ln -sf git-annex git-annex-shell"
234− , " export PATH+=\":$PWD\""
237+ , "installPhase = \"make PREFIX=$out BUILDER=: install install-completions\";"
238+ , "checkPhase = ''PATH+=\":$PWD\" git-annex test'';"
237 , "enableSharedExecutables = false;"
239 , "enableSharedExecutables = false;"
239 buildInputs = pkgs ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]
241 buildInputs = pkgs ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]
@@ -254,7 +256,7 @@ gfPhaseOverrides = unlines
254 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
256 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
255 -- Parallel compilation fails. Disable it.
257 -- Parallel compilation fails. Disable it.
257− , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build:$LD_LIBRARY_PATH'';"
259+ , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH'';"
258 -- The build step itself, after having built the library, needs to be able
260 -- The build step itself, after having built the library, needs to be able
259 -- to find the library it just built in order to compile grammar files.
261 -- to find the library it just built in order to compile grammar files.
@@ -290,8 +292,8 @@ darcsInstallPostInstall = unlines
290xmonadPostInstall :: String
292xmonadPostInstall :: String
291xmonadPostInstall = unlines
293xmonadPostInstall = unlines
292 [ "postInstall = ''"
294 [ "postInstall = ''"
293− , " install -D man/xmonad.1 $doc/share/man/man1/xmonad.1"
295+ , " install -D man/xmonad.1 ''${!outputDoc}/share/man/man1/xmonad.1"
294− , " install -D man/xmonad.hs $doc/share/doc/$name/sample-xmonad.hs"
296+ , " install -D man/xmonad.hs ''${!outputDoc}/share/doc/$name/sample-xmonad.hs"
@@ -382,11 +384,26 @@ gtkglextHook = over (libraryDepends . system) (Set.union (Set.fromList deps))
382 , "pkgs.xorg.libXmu"
384 , "pkgs.xorg.libXmu"
385−pandocOverrides :: Derivation -> Derivation
387+pandocPre26Overrides :: Derivation -> Derivation
386−pandocOverrides = set phaseOverrides postInstall
388+pandocPre26Overrides = set phaseOverrides postInstall
388 postInstall = unlines [ "postInstall = ''"
390 postInstall = unlines [ "postInstall = ''"
389 , " mkdir -p $out/share"
391 , " mkdir -p $out/share"
390 , " mv $data/*/*/man $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