Here is an ebuild for Dragon Hunt, a simple graphical RPG written in Python. The ebuild makes some minor changes to the packages code using sed, just making it so as data files and saved games can be placed in appropiate places. Also this app requires >=dev-lang/tcl-8.4.6 and >=dev-lang/tk-8.4.6, both of which are keyworded as ~x86. It doesn't work with the versions currently marked as stable on x86. games-rpg/dragonhunt would seem a sensible place for this to go. Ebuild will follow in a minute, I've marked it ~x86 as I tested it on my athlon-xp machine. Alastair Murray
Created attachment 35218 [details] The ebuild
Created attachment 35510 [details] Version Bumped Ebuild There has been a minor release upstream, author added/changed: "Added hp bars, improved the scripting, and made the game easier." This version required a slightly tweaked ebuild, one additional file require some more sedding, again to allow files to be placed in appropiate places.
Created attachment 35731 [details] Version Bumped Ebuild With Formatting Revised Discovered the wonders of repoman, it pointed out some needless whitespace.
Created attachment 35806 [details] Ebuild with RDEPEND fixed. dev-python/Imaging has been renamed to dev-python/imaging. So we take account of that here.
Created attachment 35807 [details] Version bumped ebuild. Oops, should have check for an update before I submitted the RDEPEND fix 10 minutes ago. Here is a version bumped ebuild, some icons for the buttons have been added to the game so the way images were stored has been changed. This is taken account of by changing which files get 'sedded' and also a small change to src_install().
Created attachment 38298 [details] Version Bumped, Cleaner Ebuild The upstream author seems to be making this package work in a more modular fashion, allowing for several different games using the same engine. This means all data directories are relative to a global variable now, making this ebuild a bit cleaner. Also some improved graphics/text/etc in this version.
Version 3.26 is out, just rename the latest supplied ebuild to dragonhunt-3.26.ebuild and it works fine. Changes: "Inventory screen appears inside main window. Battle screen changes. Attack and defense training. Monster descriptions. (By Allison Marles)."
Created attachment 46509 [details] v3.29 ebuild After a long break here is a version bumped ebuild. The most notable change is that there is now a map editor (installed as dragonhunt-mapeditor). One thing to note about this is that where new maps are saved is hard-coded, so I've had to make maps be saved as ~/dh-map.txt as obviously it is not possible to have them saved directly in /usr/share/... where they are needed.
Forgot to say, the last v3.29 ebuild is keyworded as ~amd64 rather than ~x86 as I no longer have an x86 machine to test on (tough it shouldn't make any difference, being written in python).
Version 3.40 is out. Homepage has changed: http://emhsoft.net/dh.html Also check http://emhsoft.net for a few great games not available in portage
Created attachment 53101 [details] games-rpg/dragonhunt/dragonhunt-3.45.ebuild This is a 3.45 ebuild... the only thing I really changed was the HOMEPAGE and SRC_URI. Please check that it works properly and I'll add it to portage.
Some code review: I like to see games last on the inherit line for games fix the date in the header quote user-modifiable variables like ${S}, ${MODULE_DIR}, etc. error check sed dodir isn't needed in src_install for ${LIB_DIR} call games eclass functions in src_install and pkg_postinst error check cp in src_install no need to install GPL.txt Don't einfo "". use echo or just einfo instead sed is part of the system so no need to be explicit about it in DEPEND
Guess I shouldn't just rename someone else's ebuild or I'll get the QA monster after me... *grin* Alright, here's another one where I actually took the time to look it over. I was really looking for "does this work" since I don't have tcltk in my USE and didn't feel like recompiling python at the moment.
Created attachment 53183 [details] games-rpg/dragonhunt/dragonhunt-3.45.ebuild Here's a new QA-friendly version of the ebuild.
Created attachment 56475 [details, diff] Patch to cleaned up 3.45 ebuild so as it works. Thanks for cleaning up my ebuild Chris. I've been very busy of late so had no time for such things, just got round to testing it and found it didn't install, and once I fixed that it wouldn't run. Very minor issues though, so, the attached patch is against your cleaned up 3.45 ebuild and fixes these probs. Tested and works on amd64. It's still marked as ~x86, but I haven't tested that. Cheers, Alastair.
Version 3.47 has been out for some time, by the way... you might want to write an ebuild for that. http://emhsoft.net/dh.html
Created attachment 56486 [details] Ebuild for version 3.47 Here is a new ebuild based on the cleaned up + correct 3.47 ebuild, only difference is: a) The rename b) The dodoc line has changed and a dohtml line has been added, to take account of removed and added docs.
Bah... I'm trying to get this 3.47 ebuild into portage, yet it keeps failing... >>> Install dragonhunt-3.47 into /var/tmp/portage/dragonhunt-3.47/image/ category games-rpg * You need to recompile python with Tkinter support. * That means: USE='tcltk' emerge python !!! ERROR: games-rpg/dragonhunt-3.47 failed. !!! Function distutils_python_tkinter, Line 116, Exitcode 0 !!! missing tkinter support with installed python !!! If you need support, post the topmost build error, NOT this status message. wolf31o2@cgianelloni /usr/local/portage/games-rpg/dragonhunt $ emerge -vp python These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] dev-lang/python-2.3.5 -X -berkdb -bootstrap -build -debug -doc -gdbm -ipv6 +ncurses +readline +ssl +tcltk -ucs2 0 kB As you can see, I have python compiled with USE=tcltk... I'm adding python to CC so maybe one of them can help.
Looks like you need USE="X tcltk", so the -X was messing you up. I don't see why there is an X USE flag, since it seems to do nothing unless used with tcltk, but we'll re-write that message at the least.
Added X to python USE and everything merged fine. Now I get this: $ dragonhunt Traceback (most recent call last): File "rpg.py", line 105, in ? init_window() File "rpg.py", line 73, in init_window sel_mod(array_mods[0]) File "rpg.py", line 53, in sel_mod g.init_data() File "/usr/games/lib/dragonhunt/g.py", line 269, in init_data read_maps() File "/usr/games/lib/dragonhunt/scripting.py", line 224, in read_maps g.load_backgrounds() File "/usr/games/lib/dragonhunt/g.py", line 533, in load_backgrounds temp_images = read_images("/images/backgrounds/") File "/usr/games/lib/dragonhunt/g.py", line 594, in read_images image_dictionary[tilename] = \ File "/usr/lib/python2.3/site-packages/PIL/ImageTk.py", line 114, in __init__ self.paste(image) File "/usr/lib/python2.3/site-packages/PIL/ImageTk.py", line 179, in paste import _imagingtk ImportError: No module named _imagingtk
re-emerge dev-python/imaging with USE='X tcltk' I'd bet
Sorry, both my systems have +X set so didn't pick that up (could of done with more testing with respect to dependency errors I guess). Robs probally correct about the error. Could make the ebuild require X and tcltk USE flags to be set perhaps, and print a warning if they're not? I'm not sure what the standard approach to this problem is, but it's certainly not very desirable to put the ebuild into portage if this would happen.
Use built_with_use from eutils.eclass in pkg_setup.... it isn't the cleanest method, but it is the best we have now...
This is now in portage. Thanks for report