packageFromDir
Transform a path to a directory into a corresponding package name.
This should be a path to a directory, as every part of it will be included in the final package.
Path segments that cannot be directly represented by Kotlin package constraints will be transformed via toPackageName.