@@ -94,7 +94,7 @@ hooks =
9494 , ("mysql", set (libraryDepends . system . contains (pkg "mysql")) True)
9595 , ("network-attoparsec", set doCheck False) -- test suite requires network access
9696 , ("numeric-qq", set doCheck False) -- test suite doesn't finish even after 1+ days
97− , ("opencv", set phaseOverrides "hardeningDisable = [ \"bindnow\" ];")
97+ , ("opencv", opencvOverrides)
9898 , ("pandoc >= 1.16.0.2", set doCheck False) -- https://github.com/jgm/pandoc/issues/2709 and https://github.com/fpco/stackage/issues/1332
9999 , ("pandoc-citeproc", set doCheck False) -- https://github.com/jgm/pandoc-citeproc/issues/172
100100 , ("pandoc", set jailbreak False) -- jailbreak-cabal break the build
@@ -289,3 +289,9 @@ hfseventsOverrides
289289webkitgtk24xHook :: Derivation -> Derivation -- https://github.com/NixOS/cabal2nix/issues/145
290290webkitgtk24xHook = set (libraryDepends . pkgconfig . contains (pkg "webkitgtk24x")) True
291291 . over (libraryDepends . pkgconfig) (Set.filter (\b -> view localName b /= "webkitgtk24x"))
292+
293+opencvOverrides :: Derivation -> Derivation
294+opencvOverrides = set phaseOverrides "hardeningDisable = [ \"bindnow\" ];"
295+ . over (libraryDepends . pkgconfig) (replace (pkg "opencv") (pkg "opencv3"))
296+ . set (configureFlags . contains "--with-gcc=${stdenv.cc}/bin/c++") True
297+ . set (configureFlags . contains "--with-ld=${stdenv.cc}/bin/c++") True