Fix libraries patching to a more generic d.o patch for profile inheritance