Just define PATCHES =( "${FILESDIR}/cmake.patch" ) and drop src_prepare. cmake-utils eclass will handle it.