diff --git a/pkgs/development/libraries/webkit2-sharp/default.nix b/pkgs/development/libraries/webkit2-sharp/default.nix
index b8a476b3b33..de10fff43da 100644
--- a/pkgs/development/libraries/webkit2-sharp/default.nix
+++ b/pkgs/development/libraries/webkit2-sharp/default.nix
@@ -33,6 +33,14 @@ stdenv.mkDerivation rec {
webkitgtk
];
+ postPatch = ''
+ # Workaround build failure with WebKitGTK 2.40.0
+ # https://github.com/hbons/webkit2-sharp/issues/6
+ substituteInPlace sources/webkit2-sharp-api.raw --replace \
+ '' \
+ ''
+ '';
+
ac_cv_path_MONODOCER = "no";
installFlagsArray = ["GAPIXMLDIR=/tmp/gapixml"];