gpsim, Ubuntu and the case of the missing GUI

Update 13/1/2015

Following an upgrade to Ubuntu 12.04 I wanted to install gpsim again. I was pleased to see that it was included in the standard repositories and so I duly installed the stock packages. However, as soon as tried to use it the problems started. After a bit of fiddling around it became obvious that gpsim was compiled for the stock package with the GUI disabled and so a recompile was in order.

Soon it also became obvious why the GUI was disabled. One of the gpsim dependencies, the gtk+extra library package, had been deprecated and was no longer included in the standard ditribution.

Before attempting the gpsim recompile the missing gtk+extra libraries had to be installed first:

wget http://sourceforge.net/projects/gtkextra/files/2.1.2/gtk+extra-2.1.2.tar.gz
tar xvzf ~/Downloads/gtk+extra-2.1.2.tar.gz
cd ../gtk+extra-2.1.2/
cp ./gtkextra/gtkitementry.c ./gtkextra/gtkitementry.c.ori
nano ./gtkextra/gtkitementry.c

Remove the static keyword from lines 134 and 1757, as indicated in the diff output:

diff -u ./gtkextra/gtkitementry.c ./gtkextra/gtkitementry.c.ori
--- ./gtkextra/gtkitementry.c	2013-05-14 15:40:42.250520446 +0100
+++ ./gtkextra/gtkitementry.c.ori	2013-05-14 15:39:06.552604439 +0100
@@ -131,7 +131,7 @@
 static PangoLayout *gtk_entry_ensure_layout            (GtkEntry       *entry,
                                                         gboolean        include_preedit);
 static void         gtk_entry_queue_draw               (GtkEntry       *entry);
-void         gtk_entry_reset_im_context         (GtkEntry       *entry);
+static void         gtk_entry_reset_im_context         (GtkEntry       *entry);
 static void         gtk_entry_recompute                (GtkEntry       *entry);
 static void         gtk_entry_get_cursor_locations     (GtkEntry       *entry,
 							CursorType      type,
@@ -1754,7 +1754,7 @@
     gdk_window_invalidate_rect (entry->text_area, NULL, FALSE);
 }
 
-void
+static void
 gtk_entry_reset_im_context (GtkEntry *entry)
 {
   if (entry->need_im_reset)

(You can also use the diff above with patch to fix the file, instead of editing it directly.)

The libraries should now compile:

./configure 
make
sudo make install
sudo ldconfig
cd ..

On my system many extra libraries and their include files are already installed; if you have any unresolved symbol complaints, the corresponding library and dev packages are probably not installed. Install them and then try again.

We can now move on to compiling gpsim itself without disabling the GUI:

wget http://downloads.sourceforge.net/project/gpsim/gpsim/0.26.0/gpsim-0.26.1.tar.gz
cd ../gpsim-0.26.1/
./configure 
make

If the build completes successfully you may remove the stock gpsim packages:

sudo apt-get remove gpsim gpsim-doc gpsim-dev

Then install your shiny new version:

sudo make install
sudo ldconfig
cd ..

If you now start gpsim it should display its GUI as it had in the past.

3 thoughts on “gpsim, Ubuntu and the case of the missing GUI”

  1. Thanks! Now I managed to install gpsim!

    Now let me look for tutorials to start learning!

    Salutations from Brazil.

  2. Thank you! – I used gpsim on earlier versions of Debian and without the GUI it is crippled. This worked perfectly. Superb work!

  3. FYI,
    I also discovered (again) that gpsim was built without the gui. I went looking for a quick solution and ended up building gputils, gtkextra and gpsim from scratch. Since this has been a problem for years now, I figured out how to upload them to my PPA so others in this situation can just point at it rather than building by hand
    the PPA is here:
    https://launchpad.net/~pblue/+archive/gpsim-gui

    Hopefully this will save the next person some time.
    I also included a modern gputils, since the one in Trusty is woefully out of date.

Leave a Reply

Your email address will not be published. Required fields are marked *