rmlint icon indicating copy to clipboard operation
rmlint copied to clipboard

package the GUI as a separate binary

Open flokli opened this issue 5 years ago • 9 comments

Motivated by https://github.com/NixOS/nixpkgs/pull/90267.

The way rmlint currently starts its GUI is somewhat weird.

It writes a .shredder-bootstrap.py.XXXXXX file in /tmp containing some python code manually appending things to sys.path, then running

import shredder
shredder.run_gui()

This causes hard-to-debug problems for platforms where shredder isn't installed into PYTHONPATH, like https://github.com/sahib/rmlint/issues/253.

Also, it makes it quite complicated for packagers to move the GUI bits into a separate package output.

Instead, what about shipping shredder as a separate binary, with entrypoints managed via setuptools?

rmlint --gui could still be supported, by executing shredder from $PATH.

flokli avatar Jun 17 '20 17:06 flokli

I installed via debian apt-get and noticed there is one package for rmlint, one for rmlint-gui and another for rmlint-doc.

A menu item is added to the GUI: Applications > System Tools > Shredder

Just mentioning cause this issue is still open.

CouldBeThis avatar Apr 19 '21 13:04 CouldBeThis

Hey thanks @CouldBeThis and @flokli

We dropped the rmlint ball a bit last year and @sahib asked me to take over maintenance at the start of this year. I'm working my way back through open issues now and hadn't gotten back to this one.

So are we envisaging something like pip install shredder, and then shredder.py calls rmlint from $PATH?

I'm thinking that to keep shredder and rmlint in sync, it might be better if rmlint's scons install installs adds a shredder script to /bin or /usr/bin. Something like #493.

SeeSpotRun avatar Apr 20 '21 21:04 SeeSpotRun

This issue is now partially resolved; there is no longer a python bootstrap in /tmp, and there's a slightly-hacky workaround in /bin/shredder to reverse-engineer PYTHONPATH.

I'm not planning anything further at this stage I think there's still a case for fully splitting the package so that rmlint installs (without gui) via

$ scons install rmlint

and shredder installs via

$ python setup.py install

(or possibly via pip install)

SeeSpotRun avatar May 27 '21 21:05 SeeSpotRun

Thanks for tremendous work! Is there any tested alpine setup? So far I got to the shredder, but can't find GtkSource.

Here's the list of package I'm installing:

apk add	scons \
	glib \
	glib-dev \
	json-glib \
	json-glib-dev \
	libelf \
	libstdc++ \
	py3-sphinx \
	elfutils-dev \
	py3-gobject3 \
	gobject-introspection \
	gobject-introspection-dev \
	py3-gobject3-dev \
	gtk+3.0-dev \
	gdk-pixbuf \
	gdk-pixbuf-dev

DimmKirr avatar Jun 27 '21 18:06 DimmKirr

any tested alpine setup?

...have just set up a VM now.

I had to add to your list:

        build-base \
        librsvg \
        gtksourceview \
        py3-cairo

SeeSpotRun avatar Jun 27 '21 22:06 SeeSpotRun

Hey, @SeeSpotRun , Thanks, I got it working too! So far one of the best solutions for remote-only datahoarders who want a GUI, running via X...

For anyone wondering, the full list of deps for alpine would be:

apk add	scons \
	glib \
	glib-dev \
	json-glib \
	json-glib-dev \
	libelf \
	libstdc++ \
	py3-sphinx \
	elfutils-dev \
	py3-gobject3 \
	gobject-introspection \
	gobject-introspection-dev \
	py3-gobject3-dev \
	gtk+3.0-dev \
	gdk-pixbuf \
	gdk-pixbuf-dev
        build-base \
        librsvg \
        gtksourceview \
        py3-cairo

DimmKirr avatar Jun 28 '21 05:06 DimmKirr