@@ -51,21 +51,14 @@ hooks =
5151 , ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${pkgs.freenect}/lib"])))
5252 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
5353 , ("gi-cairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
54− , ("gi-gdk", giGdkPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
55− , ("gi-gdkpixbuf", giGdkPixBufPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
56− , ("gi-gio", giPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
57− , ("gi-glib", giPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
58− , ("gi-gobject", giPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
59− , ("gi-gst", gstLibOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
60− , ("gi-gstaudio", gstLibAudioOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
61− , ("gi-gstbase", gstLibAudioOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
62− , ("gi-gstvideo", gstLibAudioOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
63− , ("gi-gtk", giGtkPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
64− , ("gi-javascriptcore", giJavascriptCorePhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
54+ , ("gi-gst", giGstLibOverrides "gstreamer") -- https://github.com/haskell-gi/haskell-gi/issues/36
55+ , ("gi-gstaudio", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
56+ , ("gi-gstbase", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
57+ , ("gi-gstvideo", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
58+ , ("gi-javascriptcore < 4.0.0.0", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
6559 , ("gi-pango", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
66− , ("gi-pangocairo", giPangoCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
67− , ("gi-webkit2", giWebkit2PhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
68− , ("gi-webkit2webextension", giWebkit2PhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
60+ , ("gi-pangocairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
61+ , ("gi-webkit", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
6962 , ("gio", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
7063 , ("git", set doCheck False) -- https://github.com/vincenthz/hit/issues/33
7164 , ("git-annex", gitAnnexHook)
@@ -120,6 +113,8 @@ hooks =
120113 , ("thyme", set (libraryDepends . tool . contains (bind "self.cpphs")) True) -- required on Darwin
121114 , ("twilio", set doCheck False) -- attempts to access the network
122115 , ("tz", set phaseOverrides "preConfigure = \"export TZDIR=${pkgs.tzdata}/share/zoneinfo\";")
116+ , ("webkitgtk3", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
117+ , ("webkitgtk3-javascriptcore", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
123118 , ("websockets", set doCheck False) -- https://github.com/jaspervdj/websockets/issues/104
124119 , ("Win32", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Windows)))
125120 , ("Win32-shortcut", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Windows)))
@@ -261,52 +256,14 @@ stackOverrides = unlines
261256 , "'';"
262257 ]
263258
264−exportGirSearchPath :: [String] -> String
265−exportGirSearchPath packages =
266− "export HASKELL_GI_GIR_SEARCH_PATH="
267− ++ intercalate ":" [ "${" ++ package ++ "}/share/gir-1.0" | package <- packages]
268−
269−giPhaseOverrides :: Derivation -> Derivation
270−giPhaseOverrides
271− = set phaseOverrides ("preConfigure = ''" ++ exportGirSearchPath ["gobjectIntrospection.dev"] ++ "'';")
272− . set (libraryDepends . pkgconfig . contains (pkg "gobjectIntrospection")) True
273−
274−giGdkPhaseOverrides :: Derivation -> Derivation
275−giGdkPhaseOverrides
276− = set phaseOverrides ("preConfigure = ''" ++ exportGirSearchPath ["gtk3.dev"] ++ "'';")
277−
278−gstLibOverrides :: Derivation -> Derivation
279−gstLibOverrides
280− = over (libraryDepends . pkgconfig) (replace (pkg "gstreamer") "gstreamer = pkgs.gst_all_1.gstreamer")
281−
282−gstLibAudioOverrides :: Derivation -> Derivation
283−gstLibAudioOverrides
284− = over (libraryDepends . pkgconfig) (replace (pkg "gst_plugins_base") "gst_plugins_base = pkgs.gst_all_1.gst-plugins-base")
285− . set (libraryDepends . system . contains (pkg "gobjectIntrospection")) True
286−
287−giGdkPixBufPhaseOverrides :: Derivation -> Derivation
288−giGdkPixBufPhaseOverrides
289− = set phaseOverrides (unlines
290− [ "preConfigure = ''"
291− , " " ++ exportGirSearchPath ["gobjectIntrospection.dev", "gdk_pixbuf.dev"]
292− , " export GI_TYPELIB_PATH=${gdk_pixbuf.out}/lib/girepository-1.0"
293− , "'';"
294− ])
295− . set (libraryDepends . pkgconfig . contains (pkg "gobjectIntrospection")) True
296−
297−giGtkPhaseOverrides :: Derivation -> Derivation
298−giGtkPhaseOverrides
299− = set phaseOverrides ("preConfigure = ''" ++ exportGirSearchPath ["gtk3.dev"] ++ "'';")
300−
301−giJavascriptCorePhaseOverrides :: Derivation -> Derivation
302−giJavascriptCorePhaseOverrides
303− = set phaseOverrides ("preConfigure = ''" ++ exportGirSearchPath ["webkitgtk"] ++ "'';")
304− . set (libraryDepends . pkgconfig . contains (pkg "webkitgtk")) True
259+-- Replace a binding for <package> to one to pkgs.gst_all_1.<package>
260+giGstLibOverrides :: String -> Derivation -> Derivation
261+giGstLibOverrides package
262+ = over (libraryDepends . pkgconfig) (replace (pkg (ident # package)) (binding # (ident # package, path # ["pkgs","gst_all_1", ident # package])))
305263
306264giCairoPhaseOverrides :: Derivation -> Derivation
307−giCairoPhaseOverrides = over phaseOverrides (++'\n':txt)
265+giCairoPhaseOverrides = over phaseOverrides (++txt)
308266 . set (libraryDepends . pkgconfig . contains (pkg "cairo")) True
309− . giPhaseOverrides
310267 where
311268 txt = unlines [ "preCompileBuildDriver = ''"
312269 , " PKG_CONFIG_PATH+=\":${cairo}/lib/pkgconfig\""
@@ -314,26 +271,6 @@ giCairoPhaseOverrides = over phaseOverrides (++'\n':txt)
314271 , "'';"
315272 ]
316273
317−giPangoCairoPhaseOverrides :: Derivation -> Derivation
318−giPangoCairoPhaseOverrides = set phaseOverrides txt
319− . over (libraryDepends . pkgconfig) addPkgs
320− where
321− addPkgs = Set.union (Set.fromList [ "system-pango = pkgs.pango"
322− , "system-cairo = pkgs.cairo" ])
323− . Set.insert (pkg "gobjectIntrospection")
324− gir = [ "system-pango.dev" ]
325− txt = unlines [ "preConfigure = ''" ++ exportGirSearchPath gir ++ "'';"
326− , "preCompileBuildDriver = ''"
327− , " PKG_CONFIG_PATH+=\":${system-pango.dev}/lib/pkgconfig:${system-cairo.dev}/lib/pkgconfig\""
328− , " setupCompileFlags+=\" $(pkg-config --libs pangocairo cairo-gobject)\""
329− , "'';"
330− ]
331−
332−giWebkit2PhaseOverrides :: Derivation -> Derivation
333−giWebkit2PhaseOverrides
334− = set phaseOverrides ("preConfigure = ''" ++ exportGirSearchPath ["webkitgtk"] ++ "'';")
335− . set (libraryDepends . pkgconfig . contains (pkg "webkitgtk")) True
336−
337274hfseventsOverrides :: Derivation -> Derivation
338275hfseventsOverrides
339276 = set isLibrary True
@@ -341,3 +278,7 @@ hfseventsOverrides
341278 . set (libraryDepends . tool . contains (bind "pkgs.darwin.apple_sdk.frameworks.CoreServices")) True
342279 . set (libraryDepends . system . contains (bind "pkgs.darwin.apple_sdk.frameworks.Cocoa")) True
343280 . over (libraryDepends . haskell) (Set.union (Set.fromList (map bind ["self.base", "self.cereal", "self.mtl", "self.text", "self.bytestring"])))
281+
282+webkitgtk24xHook :: Derivation -> Derivation -- https://github.com/NixOS/cabal2nix/issues/145
283+webkitgtk24xHook = set (libraryDepends . pkgconfig . contains (pkg "webkitgtk24x")) True
284+ . over (libraryDepends . pkgconfig) (Set.filter (\b -> view localName b /= "webkitgtk24x"))