Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 435294 - media-gfx/cropgui - GUI for lossless jpeg cropping (new ebuild... sort of)
Summary: media-gfx/cropgui - GUI for lossless jpeg cropping (new ebuild... sort of)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Mikle Kolyada (RETIRED)
URL: http://emergent.unpythonic.net/012484...
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2012-09-17 04:47 UTC by Jared B.
Modified: 2012-11-27 08:50 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
media-gfx/cropgui-0.1.1.ebuild (see python version notes before using) (cropgui-0.1.1.ebuild,781 bytes, text/plain)
2012-09-17 04:47 UTC, Jared B.
Details
Improved ebuild for media-gfx/cropgui-0.1.1 (cropgui-0.1.1.ebuild,1011 bytes, text/plain)
2012-09-18 16:17 UTC, Sergey Popov
Details
missing rdep patch (cropgui-0.1.1-missing-rdep.patch,267 bytes, patch)
2012-11-25 16:37 UTC, Mikle Kolyada (RETIRED)
Details | Diff
missing rdep patch (cropgui-0.1.1-missing-rdep.patch,299 bytes, text/plain)
2012-11-26 12:47 UTC, Mikle Kolyada (RETIRED)
Details
*.desktop patch (cropgui.desktop.patch,528 bytes, patch)
2012-11-26 13:03 UTC, Mikle Kolyada (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jared B. 2012-09-17 04:47:03 UTC
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.
Comment 1 Sergey Popov gentoo-dev 2012-09-18 16:17:06 UTC
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)
Comment 2 Jared B. 2012-09-18 20:12:33 UTC
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.
Comment 3 Sergey Popov gentoo-dev 2012-09-22 02:06:08 UTC
(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
Comment 4 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2012-11-25 16:37:21 UTC
Created attachment 330550 [details, diff]
missing rdep patch

Some packages should be added as rdep
Comment 5 SpanKY gentoo-dev 2012-11-26 06:06:40 UTC
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
Comment 6 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2012-11-26 12:47:58 UTC
Created attachment 330612 [details]
missing rdep patch

updated. Added one missing rdep
Comment 7 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2012-11-26 13:03:34 UTC
Created attachment 330616 [details, diff]
*.desktop patch

patch for fixing warn about *.desktop file
Comment 8 Sergey Popov gentoo-dev 2012-11-27 08:50:14 UTC
+*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