Created attachment 324068 [details] media-gfx/cropgui-0.1.1.ebuild (see python version notes before using) As noted in the summary, cropgui is a simple python/gtk application that provides a GUI for interactively cropping jpeg images using a lossless transformation. I've attached an ebuild that "works" (yes, the scare quotes are deserved), but it's a giant hack that really needs to be re-written. Problem is, this thing is written in python, and I just don't understand how python works, nor did I Have much luck trying to figure it out. I tried reviewing other python-related ebuilds, but there seems to be a lot of automagic configuration happening in most of those ebuilds that simply doesn't work here. They also seem to mostly rely on a setup.py, which also doesn't exist here. So, I got it working using a rather brute force approach: the ebuild calls the included install script to copy the files to the right location, then installs that. However, this required Python 2, and I cannot figure out how to make this work without first setting python-2 as the default system python interpreter. You can set it back to python-3 after installation, but for this ebuild to work the installation process is as follows: eselect python set 1 emerge cropgui eselect python set 2 Yes, that's retarded, but it's the best I've been able to come up with. I would love for someone that understands how python works on Gentoo to help me figure out a clean way of implementing this. Surely it can be done better. One last issue - I'm certain I'm missing some dependencies here. Again, I don't know python, so I don't even know how to look for dependencies, and there are none that are explicitly listed. I included python itself and dev-pythong/imaging, which I found though trial-and-error was needed. Everything else was already installed on my system, so I'm not sure what else is actually required to make this work.
Created attachment 324216 [details] Improved ebuild for media-gfx/cropgui-0.1.1 Now it support multiple ABIs. Package installation system is ugly, so install.sh is not used at all - all files installed directly from src_install. Note, that cropgui also has tk version(which is not installed in this ebuild, cause author says that it is deprecated). I have added missing pygtk dependency. Also, cropgui.desktop should be fixed, cause it contains deprecated content(see QA warning when installing ebuild)
Dude, Sergey, you rock. Thanks for cleaning this up. I just looked at your ebuild and I've never even heard of most of those functions, but can confirm that it works great. :-) Thanks for the amazingly fast turnaround. I was going to take a look at cleaning up the desktop file as you suggested, but I don't get any warning messages when installing it. I'm also not spotting any obvious issues just by manually reviewing the desktop file (ie., it doesn't specify an extension as part of the icon name, or any of the common issues along those lines that I've seen before). Maybe you're running a newer/different version of portage than I? I'm currently running stable amd64, 2.1.11.9. If you can post more details about the warnings you're receiving, I'll be happy to take a crack it fixing them.
(In reply to comment #2) > I was going to take a look at cleaning up the desktop file as you suggested, > but I don't get any warning messages when installing it. You should use desktop-file-validate from dev-util/desktop-file-utils
Created attachment 330550 [details, diff] missing rdep patch Some packages should be added as rdep
Comment on attachment 324216 [details] Improved ebuild for media-gfx/cropgui-0.1.1 > insinto "$(python_get_sitedir)"/"${PN}" one minor style nit: merge the quotes. insinto "$(python_get_sitedir)/${PN}" otherwise, looks as good (if not better) than many ebuilds in the tree
Created attachment 330612 [details] missing rdep patch updated. Added one missing rdep
Created attachment 330616 [details, diff] *.desktop patch patch for fixing warn about *.desktop file
+*cropgui-0.1.1 (27 Nov 2012) + + 27 Nov 2012; Sergey Popov <pinkbyte@gentoo.org> +cropgui-0.1.1.ebuild, + +metadata.xml: + Initial commit wrt bug #435294. Thanks to Jared B. and Mikle Kolyada for + their work on ebuild. The latter will maintain this package through proxy + maintainers