how to compile a cli-only version of bleachbit

Forums: 

I'd like to run bleachbit on a headless box. Is there a guide to compile a non-gtk version? Here is what I do to compile the version that depends on gtk.

pkgdir=/tmp/pkg
make prefix=/usr DESTDIR=$pkgdir PYTHON=python2 install

Should anything be modified? For example:

#########################
if 1 == len(sys.argv): # 1-> 0
import gtk
import bleachbit.GUI
gui = bleachbit.GUI.GUI()
gtk.main()
else:
import bleachbit.CLI
bleachbit.CLI.process_cmd_line()
#########################
The "1" in the first line to "0", then it will always execute the else block, even you run bleachbit without arguments(some usage info will showed).

BleachBit is written in Python, which is an interpreted language, so BleachBit is not compiled.

I have never tried to run it headless, but here's how I would start. It seems like you are installing from source rather than from a deb, rpm, or similar package, so it should be fine to install all the sources. Then invoke BleachBit using command line parameters as if you wanted the CLI from a GTK+ environment. That should be it.

The code you copied means that GTK+ will be used only if there are no command line arguments. The system won't even check whether GTK+ is installed! BleachBit uses the same technique to support multiple operating systems in the same source code without "recompiling."

---
Andrew, lead developer