--- a/dev-libs/libxml2/libxml2-2.9.7.ebuild 2018-01-13 12:42:37.000000000 +0100 +++ a/dev-libs/libxml2/libxml2-2.9.7.ebuild 2018-01-19 15:02:23.691845200 +0100 @@ -157,6 +157,12 @@ exampledir="${EPREFIX}"/usr/share/doc/${PF}/python/examples \ install python_foreach_impl python_optimize + + # On cygwin the module is named cygxml2mod.dll. This is generally + # correct, but python can only handle modules with lib prefix. + if use elibc_Cygwin; then + python_foreach_impl libxml2_py_cygwin_rename + fi fi } @@ -206,3 +212,8 @@ emake "$@" popd > /dev/null } + +libxml2_py_cygwin_rename() { + mv "${D}$(python_get_sitedir)"/{cyg,lib}xml2mod.dll \ + || die "$EPYTHON cygxml2mod.dll rename failed" +}