sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.93k stars 132 forks source link

package the GUI as a separate binary #419

Open flokli opened 4 years ago

flokli commented 4 years ago

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.

CouldBeThis commented 3 years ago

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.

SeeSpotRun commented 3 years ago

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 commented 3 years ago

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)

AutomationD commented 3 years ago

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
SeeSpotRun commented 3 years ago

any tested alpine setup?

...have just set up a VM now.

I had to add to your list:

        build-base \
        librsvg \
        gtksourceview \
        py3-cairo
AutomationD commented 3 years ago

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