Skip to content

Commit

Permalink
Distribution.Nixpkgs.Haskell.FromCabal: don't depend on webkitgtk24x
Browse files Browse the repository at this point in the history
webkitgtk24x-gtk{2,3} have been removed from nixpkgs a while ago and
only continue to exist as aliases which throw, informing about the
removal. This is informative, but depends on evaluating with aliases
enabled which may not always be the case.

Instead we just remove this now essentially useless code from
cabal2nix. This will usually cause a dependency on the current version
of webkitgtk and the build to fail -- then we can mark the resulting
package as broken normally which was prevented before by eval
oddities (I presume at least).
  • Loading branch information
sternenseemann committed Sep 28, 2021
1 parent 749491a commit fb8fd9d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ libNixName "ImageMagick" = return "imagemagick"
libNixName "Imlib2" = return "imlib2"
libNixName "iw" = return "wirelesstools"
libNixName "jack" = return "libjack2"
libNixName "javascriptcoregtk-3.0" = return "webkitgtk24x-gtk3" -- These are the old APIs, of which 2.4 is the last provider, so map directly to that.
libNixName "javascriptcoregtk-4.0" = return "webkitgtk"
libNixName "jpeg" = return "libjpeg"
libNixName "jvm" = return "jdk"
Expand Down Expand Up @@ -176,7 +175,6 @@ libNixName "wayland-server" = return "wayland"
libNixName "webkit2gtk" = return "webkitgtk"
libNixName "webkit2gtk-4.0" = return "webkitgtk"
libNixName "webkit2gtk-web-extension-4.0" = return "webkitgtk"
libNixName "webkitgtk-3.0" = return "webkitgtk24x-gtk3" -- These are the old APIs, of which 2.4 is the last provider, so map directly to that
libNixName "X11" = return "libX11"
libNixName "x11" = return "xlibsWrapper"
libNixName "xau" = return "libXau"
Expand Down
8 changes: 0 additions & 8 deletions src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ hooks =
, ("gi-gstbase", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("gi-gstvideo", giGstLibOverrides "gst-plugins-base") -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("gi-gtk", set runHaddock True )
, ("gi-javascriptcore < 4.0.0.0", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("gi-pango", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("gi-pango", set runHaddock True )
, ("gi-pangocairo", giCairoPhaseOverrides) -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("gi-vte", set runHaddock True )
, ("gi-webkit", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("gio", set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True)
, ("git", set doCheck False) -- https://github.com/vincenthz/hit/issues/33
, ("git-annex >= 6.20170925 && < 6.20171214", set doCheck False) -- some versions of git-annex require their test suite to be run inside of a git checkout
Expand Down Expand Up @@ -176,8 +174,6 @@ hooks =
, ("twilio", set doCheck False) -- attempts to access the network
, ("tz", set phaseOverrides "preConfigure = \"export TZDIR=${pkgs.tzdata}/share/zoneinfo\";")
, ("udev", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Linux)))
, ("webkitgtk3", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("webkitgtk3-javascriptcore", webkitgtk24xHook) -- https://github.com/haskell-gi/haskell-gi/issues/36
, ("websockets", set doCheck False) -- https://github.com/jaspervdj/websockets/issues/104
, ("Win32", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Windows)))
, ("Win32-shortcut", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == Windows)))
Expand Down Expand Up @@ -356,10 +352,6 @@ hfseventsOverrides
. set (libraryDepends . system . contains (bind "pkgs.darwin.apple_sdk.frameworks.Cocoa")) True
. over (libraryDepends . haskell) (Set.union (Set.fromList (map bind ["self.base", "self.cereal", "self.mtl", "self.text", "self.bytestring"])))

webkitgtk24xHook :: Derivation -> Derivation -- https://github.com/NixOS/cabal2nix/issues/145
webkitgtk24xHook = set (libraryDepends . pkgconfig . contains (pkg "webkitgtk24x-gtk3")) True
. over (libraryDepends . pkgconfig) (Set.filter (\b -> view localName b /= "webkitgtk24x-gtk3"))

opencvOverrides :: Derivation -> Derivation
opencvOverrides = set phaseOverrides "hardeningDisable = [ \"bindnow\" ];"
. over (libraryDepends . pkgconfig) (replace (pkg "opencv") (pkg "opencv3"))
Expand Down

0 comments on commit fb8fd9d

Please sign in to comment.