GNOME Bugzilla – Bug 382057
assumed paths in python files
Last modified: 2006-12-10 10:05:37 UTC
paths in the python programs bundled in gnome-games assumes files are installed prefix = /usr sys.path.append('/usr/share/glchess/') sys.path.append('/usr/share/gnome-sudoku/') suggest glchess.in and gnome-sudoko.in files with some sys.path.insert('@pythondir@') sed "s,@pythondir@,whateverpythoninstallpath,g" < $file.in > $(bindir)/$file
i guess it'd only need to be sys.path.insert('@prefix@/glchess/') sed 's,@prefix@,/opt/local,g' < glchess.in > $(bindir)/glchess
*** Bug 376696 has been marked as a duplicate of this bug. ***
Hello again Paul! This really needs to be fixed, so it's great if you could help us out with it. Could you please submit a patch?
Created attachment 77714 [details] [review] generate sys.path.append at build time hi, andreas i hope this patch is up to par my automake experiences are few and far between
Created attachment 77720 [details] [review] spaces vs. tabs ignore that last one, Makefile:623: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. XD
Paul, your patch is not working. Have you tested it using make install? The generated glchess and gnome-sudoku files are incorrect. Also, you shouldn't use sed to perform replacements.
There is also the file defaults.py.in for both Python games, which should be used instead.
I finally found out how to fix this bug based on your patch. Thanks a lot!
yeah, i just realized i overlooked the fact that i keep PYTHONPATH set in my shell environment but when unset, the newly installed glchess errors out with Traceback (most recent call last):
+ Trace 92925
from glchess.glchess import start_game
[4224 refs] because pyexecdir in the glchess file that's created by config.status expands to ${exec_prefix}/lib/python2.4/site-packages unfortunately, my system doesnt expand that ${exec_prefix} also, when builddir != srcdir, if i was to delete the funky one generated by config.status and let the makefile generate it... Makefile:626: warning: overriding commands for target `glchess' Makefile:318: warning: ignoring old commands for target `glchess' sed \ -e "s|\@pyexecdir\@|/opt/local/lib/python2.4/site-packages|" \ glchess.in > glchess sed: glchess.in: No such file or directory make[1]: *** [glchess] Error 1 so, i think that glchess/src/glchess and gnome-sudoku/src/gnome-sudoku need to be removed from AC_CONFIG_FILES in configure.in, along with glchess/src/Makefile.am and gnome-sudoku/src/Makefile.am needing $(srcdir) prefixed to the input file paths
also, gnome-sudoku with the proper pyexecdir still needs to load the datarootdir/gnome-sudoku directory for the glade files, else... Traceback (most recent call last):
+ Trace 92934
start_game()
return Unpickler(file).load()
dispatch[key](self)
raise EOFError EOFError [118762 refs]
i could be wrong on that last one
I applied the changes mentioned in comment #9. If you get any errors, please submit a patch. http://webcvs.freedesktop.org/gstreamer/gst-python/ can be a good starting point for more info.