Page 1 of 1

SOLVED ... Installing pix from source

Posted: Sun Jun 21, 2020 1:53 pm
by iain_33
I've been using geeqie as a picture browser for a while, but I prefer the interface of pix, except I don't like the scroll wheel behaviour - mouse scrolling zooms images / ctrl+scroll navigates back & forwards - but I'd rather have it the other way, as geeqie does (scroll navigates / ctrl+scroll zooms).

So - I'm having my first go at downloading the source, altering it and compiling / installing.

I found the source for pix on github, used git clone to download it, and (I think) I've made the changes to swap the scroll behaviour.

But now I'm stuck on the compiling - or more specifically, the dependencies. The README tells me:

Code: Select all

Compiling
=========

  In order to build this program you need a working GNOME environment
  version 2 or greater, with the development tools installed properly.
  The following is the detailed list of libraries you need:

	* glib	 		version >= 2.16.0
	* gtk 			version >= 2.18.0
	* gthread
 	* gmodule
	* gio-unix
	* intltool		version >= 0.35.0
	* unique		version >= 1.1.2
I got stuck at the first one. After some searching I found the glib package is to be found at libglib. apt search libglib brings back 32 results:

Code: Select all

i   libglib-object-introspection-perl           - Perl bindings for gobject-introspection libraries    
p   libglib-object-introspection-perl:i386      - Perl bindings for gobject-introspection libraries    
i   libglib-perl                                - interface to the GLib and GObject libraries          
p   libglib-perl:i386                           - interface to the GLib and GObject libraries          
i   libglib2.0-0                                - GLib library of C routines                           
i A libglib2.0-0:i386                           - GLib library of C routines                           
i   libglib2.0-bin                              - Programs for the GLib library                        
p   libglib2.0-bin:i386                         - Programs for the GLib library                        
p   libglib2.0-cil                              - CLI binding for the GLib utility library 2.12        
p   libglib2.0-cil:i386                         - CLI binding for the GLib utility library 2.12        
p   libglib2.0-cil-dev                          - CLI binding for the GLib utility library 2.12        
p   libglib2.0-cil-dev:i386                     - CLI binding for the GLib utility library 2.12        
i   libglib2.0-data                             - Common files for GLib library                        
v   libglib2.0-data:i386                        -                                                      
p   libglib2.0-dev                              - Development files for the GLib library               
p   libglib2.0-dev:i386                         - Development files for the GLib library               
p   libglib2.0-dev-bin                          - Development utilities for the GLib library           
p   libglib2.0-dev-bin:i386                     - Development utilities for the GLib library           
p   libglib2.0-doc                              - Documentation files for the GLib library             
v   libglib2.0-doc:i386                         -                                                      
p   libglib2.0-tests                            - GLib library of C routines - installed tests         
p   libglib2.0-tests:i386                       - GLib library of C routines - installed tests         
p   libglib3.0-cil                              - CLI binding for the GLib library of C routines       
p   libglib3.0-cil:i386                         - CLI binding for the GLib library of C routines       
p   libglib3.0-cil-dev                          - CLI binding for the GLib utility library 2.12        
p   libglib3.0-cil-dev:i386                     - CLI binding for the GLib utility library 2.12        
i   libglibmm-2.4-1v5                           - C++ wrapper for the GLib toolkit (shared libraries)  
p   libglibmm-2.4-1v5:i386                      - C++ wrapper for the GLib toolkit (shared libraries)  
p   libglibmm-2.4-dev                           - C++ wrapper for the GLib toolkit (development files) 
p   libglibmm-2.4-dev:i386                      - C++ wrapper for the GLib toolkit (development files) 
p   libglibmm-2.4-doc                           - C++ wrapper for the GLib toolkit (documentation)     
v   libglibmm-2.4-doc:i386                      -       
I guess I would ignore the libgib2.0 ones, given the readme says I need version >= 2.16.0, but which of the rest do I choose?

Moving on, apt search libgtk brings back 199 results, and apt search gthread finds nothing at all.

So, I'm stuck on the first few mandatory dependencies, not to mention the rest of them, and then the "not mandatory but useful" ones and then the "optional" ones... :?

Re: Installing pix from source

Posted: Sun Jun 21, 2020 2:10 pm
by smurphos
Hi iain_33,

See viewtopic.php?p=1766767#p1766767 for the general steps needed in an 'easy' way to get the source-code, install dependencies, modify and re-compile any application available from the regular repos. The post is specific to making a minor change to nemo, but the basic steps should be the same for pix,

Re: SOLVED ... Installing pix from source

Posted: Sun Jun 21, 2020 5:04 pm
by iain_33
Thanks Smurphos - and surprisingly my changes to the source worked first time 8)

A minor tweak this may be, but now I've learnt how to do it who knows what else I can get my hands on and change... really appreciating the "freedom" thing of Linux. I couldn't imagine taking some of the built-in apps on Windows, deciding "I'd like it better if it did this..." and being able to alter it so easily.

What happens with apps I've built from source when it comes to updates? Will updates overwrite my changes, or will I be "stuck" with the version I've just compiled?

Re: SOLVED ... Installing pix from source

Posted: Sun Jun 21, 2020 5:51 pm
by iain_33
For anyone who's interested - how to change the ctrl / scroll wheel behaviour

- Download the source as per Smurphos' link

- Open the file gth-browser.c

- Search for the function gth_browser_viewer_scroll_event_cb (on the version I've got - pix-2.4.6+tricia, it's line 5311)

- Change the line if (event->state & GDK_CONTROL_MASK) { to if (!(event->state & GDK_CONTROL_MASK)) {

- Save and close

- Open the filegth-image-viewer.c

- Search for the function gth_image_viewer_scroll_event (on mine, line 979)

- Change the line if (event->state & GDK_CONTROL_MASK) { to if (!(event->state & GDK_CONTROL_MASK)) {

- Save and close

- Recompile as per Smurphos' linked post

Re: SOLVED ... Installing pix from source

Posted: Sun Jun 21, 2020 6:18 pm
by absque fenestris
Hi iain

Thanks for sharing your software customization. I can empathize with you: it's such small but essential details that make a pleasant workflow possible ...

btw: does anyone know if Mirage has definitely died?