Difference between revisions of "CompilingUbuntu"

From Inkscape Wiki
Jump to navigation Jump to search
(Move PPA instructions to "Installing Inkscape" page)
(32 intermediate revisions by 13 users not shown)
Line 1: Line 1:
== Hardy and Intrepid ==
== Consider using pre-built packages ==
=== Consider using stable ===
This is a short how to build the latest development version. '''If you don't want to change the source code, you can avoid this effort and use pre-built packages''', either the well-tested stable version, or the newest developer's version intended for testing. See [[Installing_Inkscape#Ubuntu_or_Debian_Linux]].
This is a short how to build the latest svn version. Please note that SVN version may be buggy and crash often. This is released for people who want to help testing or need the very latest features. If you are not of developer kind, you are suggested to install the stable version from the repositories using Synaptic or from command line:


<pre>
== Compiling unstable developement version ==
  sudo apt-get install inkscape
=== Installing dependencies ===
</pre>
If you are sure you can face Inkscape being unstable, then please continue reading. First you should install all the [[Tracking Dependencies|dependencies]].
* On Ubuntu 16.04 this can be done by:


=== Using prebuilt packages ===
For Ubuntu there is developers repository available with prebuilt Inkscape which is updated occassionally.
You should append the following lines to file /etc/apt/sources.list
<pre>
<pre>
deb http://ppa.launchpad.net/inkscape.testers/ubuntu hardy main
sudo apt-get install build-essential autoconf automake autopoint intltool libtool \
deb-src http://ppa.launchpad.net/inkscape.testers/ubuntu hardy main
libglib2.0-dev libpng12-dev libgc-dev libfreetype6-dev liblcms2-dev \
libgtkmm-2.4-dev libxslt1-dev libboost-dev libpopt-dev libgsl0-dev libaspell-dev
</pre>
</pre>


Run following commands to update the repository information and install all the latest programs available.
* On Ubuntu 18.04 the above do longer works. Please refer to either
<pre>  sudo apt-get update
** https://gitlab.com/inkscape/inkscape-ci-docker/blob/master/Dockerfile
  sudo apt-get upgrade
** or with the deb-src repo added: <pre>sudo apt-get build-dep inkscape</pre>
</pre>
To install Inkscape, do the usual
<pre>
  sudo apt-get install inkscape
</pre>


=== Compiling unstable developement version ===
Now you should have every dependency you need to build Inkscape.
==== Installing dependencies ====
If you are sure you can face Inkscape being unstable, then please continue reading. First you should install all the dependencies. This can be done by:


<pre>
  sudo apt-get install build-essential autoconf automake intltool \
libglib2.0-dev libpng12-dev libgc-dev libfreetype6-dev liblcms1-dev \
libgtkmm-2.4-dev libxslt1-dev libboost-dev libpopt-dev libgsl0-dev
</pre>


Now you should have every dependency you need to build Inkscape.
==== Additional dependencies ====
 
===== Additional dependencies =====
If you want to have pdf support you need to install poppler:
If you want to have pdf support you need to install poppler:


<pre>
<pre>
sudo apt-get install libpoppler-dev libpoppler-glib-dev
  sudo apt-get install libpoppler-dev libpoppler-glib-dev
</pre>
</pre>


Line 46: Line 30:


<pre>
<pre>
   sudo apt-get install libgnome-vfsmm-2.6-dev libssl-dev libmagick++9-dev libwpg-dev
   sudo apt-get install libgnome-vfsmm-2.6-dev libssl-dev libmagick++9-dev libwpg-dev libcdr-dev libvisio-dev
</pre>
 
==== Getting source from SVN ====
You have to fetch the source from subversion (SVN). If you have not subversion installed, install it:
 
<pre>
  sudo apt-get install subversion
</pre>
 
After this you can fetch the latest source. This creates a new directory named inkscape into your current working directory.
 
<pre>
  svn checkout https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape
</pre>
</pre>


If you want to learn more about subversion, feel free to do so: http://inkscape.org/wiki/index.php/WorkingWithSVN
Note: On Ubuntu 18.04 libmagick++9-dev is obsoleted by graphicsmagick-libmagick-dev-compat, and libgnome-vfsmm-2.6-dev no longer exists.


==== Configuring and Compiling ====
=== Getting source from gitlab ===
Enter the newly created inkscape directory.


<pre>
<pre>git clone --recursive https://gitlab.com/inkscape/inkscape</pre>
  cd inkscape
</pre>


As you may have already noticed this folder contains some files with all CAPITAL letters like README, INSTALL, HACKING, COPYING and probably others. These contain the latest information about how to build the program. The README file says that if you have no configure script in the current directory you should run autogen script to create it:
or later on a checkout where submodules may be incomplete


<pre>
<pre>git submodule update --init --recursive</pre>
  ./autogen.sh
</pre>


Now run configure script which detects your system variables, installed software etc.:
=== Configuring and Compiling ===


<pre>
Please refer to https://inkscape.org/en/develop/getting-started/
  ./configure
</pre>


or, if you want to make it install to an alternate location so that you can keep the standard version installed and untouched


<code>
.
  ./configure --prefix=/home/''yourname''/opt/local
</code>
(replacing "yourname" with your actual directory user name, of course)
''All bug reporting testers may find it useful to install to use --prefix=/home/''yourname''/opt/inkscape-revision-19900 or --prefix=/opt/inkscape-19900 or something similar, replacing the revision number with correct one (this is shown when svn fetching finishes, also can be found in file .svn/entries). This way you can have several versions of inkscape installed at once.''


or, if you want to have inkboard enabled,
=== Testing ===


<pre>
In addition to the instructions above, developers should always run automated tests before committing any changes.  This is achieved by using the "make check" command.
  ./configure --enable-inkboard
</pre>


If the configure script ends with no error messages, you are the lucky one, all system requirements are met. Run make to compile.
=== Installing ===
 
<pre>
  make
</pre>
 
This may take some time, probably hours, depending on your machine's speed. On 1,4Ghz P3M with 512Mb clean build took 100 minutes.
 
==== Installing ====


If you used some --prefix=/... other than /usr, then you may install using usual 'make install' or 'sudo make install', depending on the location.
If you used some --prefix=/... other than /usr, then you may install using usual 'make install' or 'sudo make install', depending on the location.
Line 116: Line 65:
Happy inkscapeing.
Happy inkscapeing.


===== Fix no icons problem =====
==== Fix no icons problem ====


If you run this and you find that you have no tool icons it's because it's looking in the wrong place for them. To fix that you need to make a symbolic link to the correct location. Here is an example:
If you run this and you find that you have no tool icons it's because it's looking in the wrong place for them. To fix that you need to make a symbolic link to the correct location. Here is an example:
Line 124: Line 73:
</pre>
</pre>


==== Update your version ====
=== Update your version ===


If you want to update your already built inkscape to the very latest version, you need to run following commands in inkscape source directory. Please correct the configure line and use the same installation method as on first install.
If you want to update your already built inkscape to the very latest version, you need to run following commands in inkscape source directory.


<pre>
<pre>
     svn update
     git pull
    ./configure --prefix=/home/''yourname''/opt/local
     make
     make
     make install
     make install
</pre>
</pre>
== Dapper and Edgy ==
If you're going to build Inkscape, you'll need to have a full complement of build requirements.  This is very easy to do in Ubuntu Dapper and Edgy:
Note: the libgc-6.7 that is available in Edgy removes the need for the following:
<pre>
  sudo apt-get build-dep inkscape
  sudo apt-get install liblcms-dev build-essential
  echo "deb-src http://ftp.us.debian.org/debian/ unstable main" >> /etc/apt/sources.list
  sudo apt-get update
  sudo apt-get source libgc-dev
  sudo apt-get install fakeroot debhelper
  cd libgc*
  sudo fakeroot dpkg-buildpackage -uc -us
  sudo dpkg -i ../libgc*.deb
</pre>
If you want version 0.44 from Debian Unstable, you can compile it in the same way as libgc above:
<pre>
  apt-get source inkscape
  cd inkscape*
  fakeroot dpkg-buildpackage -uc -us
  sudo dpkg -i ../inkscape*.deb
</pre>
To build the SVN snapshots:
<pre>
  # Untar and navigate to the inkscape source folder
  ./configure
  make
  sudo make install
</pre>
Instead of doing "make install", on Debian-based distributions (such as Ubuntu) it is better to do
<pre>
  sudo checkinstall
</pre>
since checkinstall first builds the .deb package and then installs it, thus making the package system aware of the newly installed inkscape.
If you get the "command not found" message, do
<pre>
  sudo apt-get install checkinstall
</pre>
'''Notes:'''
build-dep gets all the dependencies for the version of Inkscape that comes with Ubuntu. We're not building the same version, but most of the dependencies are the same.
libcms-dev was required for ./configure to work
This was done on a recently installed Dapper (Ubuntu 6.06) system. I built Inkscape version 0.44.
The following packages are need to compile cvs inkscape under a default Ubuntu Hoary/Breezy/Dapper system:
<pre>
  apt-get install cvs build-essential intltool libtool libgtkmm-2.4-dev \
libglib2.0-dev libpng12-dev libxslt1-dev libsigc++-2.0-dev libpopt-dev libgc-dev
</pre>
Inkscape requires libgc-6.7.
Breezy uses 6.4, Dapper uses 6.6, Edgy uses 6.7
Hoary uses version 6.3, which is provided in the Repos.  (Is there somewhere to get a .deb for 6.4?)
To overwrite libgc-6.3 with libgc-6.4:
  Download gc6.4
  ./configure --prefix=/usr
  make
  sudo make install
== Old libgc 6.5 debs for Breezy ==
http://inkscape.modevia.com/ap/libgc-dev_6.5-1_i386.deb
http://inkscape.modevia.com/ap/libgc1_6.5-1_i386.deb


[[Category:Developer Documentation]]
[[Category:Developer Documentation]]

Revision as of 14:00, 19 January 2019

Consider using pre-built packages

This is a short how to build the latest development version. If you don't want to change the source code, you can avoid this effort and use pre-built packages, either the well-tested stable version, or the newest developer's version intended for testing. See Installing_Inkscape#Ubuntu_or_Debian_Linux.

Compiling unstable developement version

Installing dependencies

If you are sure you can face Inkscape being unstable, then please continue reading. First you should install all the dependencies.

  • On Ubuntu 16.04 this can be done by:
sudo apt-get install build-essential autoconf automake autopoint intltool libtool \
libglib2.0-dev libpng12-dev libgc-dev libfreetype6-dev liblcms2-dev \
libgtkmm-2.4-dev libxslt1-dev libboost-dev libpopt-dev libgsl0-dev libaspell-dev

Now you should have every dependency you need to build Inkscape.


Additional dependencies

If you want to have pdf support you need to install poppler:

   sudo apt-get install libpoppler-dev libpoppler-glib-dev

If you want to have optional features you may need to install some more packages:

   sudo apt-get install libgnome-vfsmm-2.6-dev libssl-dev libmagick++9-dev libwpg-dev libcdr-dev libvisio-dev

Note: On Ubuntu 18.04 libmagick++9-dev is obsoleted by graphicsmagick-libmagick-dev-compat, and libgnome-vfsmm-2.6-dev no longer exists.

Getting source from gitlab

git clone --recursive https://gitlab.com/inkscape/inkscape

or later on a checkout where submodules may be incomplete

git submodule update --init --recursive

Configuring and Compiling

Please refer to https://inkscape.org/en/develop/getting-started/


.

Testing

In addition to the instructions above, developers should always run automated tests before committing any changes. This is achieved by using the "make check" command.

Installing

If you used some --prefix=/... other than /usr, then you may install using usual 'make install' or 'sudo make install', depending on the location. If the the location prefix was /usr, then "sudo make install" is not recommended, as debian package manager would know nothing about new package. The better alternative is using checkinstall. If checkinstall is not installed, you can install it the usual way "sudo apt-get install checkinstall".

   sudo checkinstall

Happy inkscapeing.

Fix no icons problem

If you run this and you find that you have no tool icons it's because it's looking in the wrong place for them. To fix that you need to make a symbolic link to the correct location. Here is an example:

   sudo ln -s /usr/share/inkscape /usr/local/share/inkscape

Update your version

If you want to update your already built inkscape to the very latest version, you need to run following commands in inkscape source directory.

    git pull
    make
    make install