apply patch to build (from RT#64110)

uses pkg-config
patch to fix compilation errors (RT#32713)