Bug 180191 - games-strategy/lightyears-1.2a should byte-compile python files before installing them
Bug#: 180191 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: trivial Priority: P2
Resolution: FIXED Assigned To: games@gentoo.org Reported By: denilsonsa@gmail.com
Component: Games
URL:  http://biscuits.jwhitham.org.uk/LightYears/
Summary: games-strategy/lightyears-1.2a should byte-compile python files before installing them
Keywords:  
Status Whiteboard: 
Opened: 2007-05-29 07:54 0000
Description:   Opened: 2007-05-29 07:54 0000
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"

------- Comment #1 From Denilson 2007-05-29 08:31:45 0000 -------
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}"
}

------- Comment #2 From Tristan Heaven 2007-05-29 22:35:34 0000 -------
fixed, thanks