Currently, games-strategy/lightyears-1.2a ebuild installs just the *.py files.
However, I think the ebuild should byte-compile these files to *.pyc/*.pyo and
install them.
I did this at my ebuild for whichwayisup game. Look at bug #180187.
There are only 3 required changes to lightyears ebuild:
- Add "python" to inherit line.
- Add:
src_compile() {
python_mod_optimize code
}
- Change "doins" line to this:
doins code/*.py code/*.py[co] || die "doins code failed"
After chatting with marienz at #gentoo-dev-help, he told me the way I described
above is incorrect. The correct would be:
- Add python to inherit line
- Add the following functions:
pkg_postinst() {
python_version
python_mod_optimize "$(games_get_libdir)/${PN}"
}
pkg_postrm() {
python_version
python_mod_cleanup "$(games_get_libdir)/${PN}"
}