Monday, May 9, 2022

[SOLVED] Installing / Building the newest version of Inkscape (v 1.2) on Linux Ubuntu 20.04

Issue

I am trying to install Inkscape 1.2beta on Linux Ubuntu 20.04. The website currently only offers an AppImage and a source tarball. Since I would like to access the newest features of Inkscape via the command line, I need to build and install the source tarball.

INSTALL.md states that I need all submodules and dependencies before install.

How do I find these dependencies to successfully build and install Inkscape?


Solution

The details on how to build Inkscape (and the dependencies) could be found in the repository itself, or Inkscape website (For completness, the steps are copied from the website here):

  • To obtain the latest source code, use the following command (downloads into a subdirectory of your current working directory called "inkscape" by default):
git clone --recurse-submodules https://gitlab.com/inkscape/inkscape.git

To update this code later, change into the download folder and use:

git pull --recurse-submodules && git submodule update

By default, git will download every branch and every commit. If you are on a slow machine, have limited disk space, or limited internet bandwidth, you can use shallow clone and single branch clone options to limit the amount of data it will download:

git clone --depth=1 --single-branch --recurse-submodules --shallow-submodule https://gitlab.com/inkscape/inkscape.git

Building Inkscape on Linux

Open a terminal at the root of the folder into which you downloaded the source code in the previous step.

Install build dependencies

Download and run the script to install everything required for compiling Inkscape (check script to see if your distribution is supported):

wget -v https://gitlab.com/inkscape/inkscape-ci-docker/-/raw/master/install_dependencies.sh -O install_dependencies.sh
bash install_dependencies.sh --recommended

Compile

To compile with CMake, do the following:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/install_dir -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
make -j8
make install

Notes:

  • Using ccache is optional but speeds up compilation.
  • The optional -j8 argument to make tells it to run 8 jobs in parallel. Feel free to adjust this to the number of hardware threads (physical cores) available on your computer.
  • The recommended -DCMAKE_INSTALL_PREFIX argument allows to specify a custom isolated installation location (in the example above install_dir/ inside the build folder). It avoids installation into system locations (where it could conflict with other versions of Inkscape) and allows running multiple versions of Inkscape in parallel. It will still use all the files (including the preferences.xml) that reside in the ~/.config/inkscape directory.

Run

Run it from the build directory:

install_dir/bin/inkscape


Answered By - s.ouchene
Answer Checked By - David Marino (WPSolving Volunteer)