Thursday, July 08, 2010

libgphoto2 / gphoto2 build from svn and install locally

Today I wanted to make a patch against gphoto2 (the command-line interface to libgphoto2) without overwriting the version installed by ubuntu.

So I needed to download libgphoto2 and gphoto2 from subversion and then install it to a local directory.

$ sudo apt-get install automake autoconf libtool gettext pkg-config subversion build-essential
$ mkdir gphoto-svn
$ cd gphoto-svn
$ svn checkout
$ cd libgphoto2
$ autoreconf -is
$ mkdir -p /tmp/gphoto2/local
$ ./configure --prefix=/tmp/gphoto2/local
$ make
$ make install
$ # neat, libgphoto2 installed to /tmp/gphoto2/local
$ cd ..
$ svn checkout
$ cd gphoto2
$ autoreconf -is
$ ./configure --prefix=/tmp/gphoto2/local --with-libgphoto2=/tmp/gphoto2/local
$ make
$ # make install is optional; I just ran ./gphoto2/gphoto2 directly
$ # edited files, then "make" to rebuild


Viridis said...

Hi, this is a great explanation, but I have found a problem and can't solve it in none of 2 systems. I want to use an additional option (libxml2 package), so that in the libgphoto2 configure I run:
./configure --prefix=/tmp/gphoto2/local --with-libxml2=yes

but then I find an output:
LIBXML2 to support Olympus ..: no

So why?? Any clues??

Anonymous said...

Sorry, no idea! I've found the gphoto2 developers to be quite helpful, though, so you might try their email list.

Anonymous said...


Try this:
sudo ln -s /usr/libxml2/libxml /usr/include/libxml

Anonymous said...

Sorry, I meant:

sudo ln -s /usr/include/libxml2/libxml /usr/include/libxml