0
Help us understand the problem. What are the problem?

posted at

updated at

Inkscapeの環境構築

Ubuntu編

ビルド

  • Ubuntuでinkscapeのビルドを試みる。

  •     $ git clone https://gitlab.com/inkscape/inkscape
        $ cd inkscape
        $ mkdir build
        $ cmake .. 
        ```
    
      - ライブラリ不足でエラーが出た。
    
    

-- Checking for modules 'harfbuzz;pangocairo;pangoft2;fontconfig;gsl;gmodule-2.0;libsoup-2.4>=2.42'
-- No package 'pangocairo' found
-- No package 'pangoft2' found
-- No package 'gsl' found
-- No package 'libsoup-2.4' found
```

- 必要なライブラリのインストールを行う。

$ sudo apt install -y libsdl-pango-dev
$ sudo apt install -y libsoup2.4
$ sudo apt install -y libgsl-dev
$ sudo apt install -y libdouble-conversion-dev
$ sudo apt install -y libgc-dev
$ sudo apt install -y libpotrace-dev
$ sudo apt install -y libgtkmm-3.0-dev


  - もう一度 `cmake` を行う。

-  ```
-- Checking for modules 'gtkmm-3.0>=3.24;gdkmm-3.0>=3.24;gtk+-3.0>=3.24;gdk-3.0>=3.24;gdl-3.0>=3.6'
--   Requested 'gtkmm-3.0 >= 3.24' but version of gtkmm is 3.22.2
You may find new versions of gtkmm at http://www.gtkmm.org/
--   Requested 'gdkmm-3.0 >= 3.24' but version of gdkmm is 3.22.2
You may find new versions of gdkmm at http://www.gtkmm.org/
--   Requested 'gtk+-3.0 >= 3.24' but version of GTK+ is 3.22.30
--   Requested 'gdk-3.0 >= 3.24' but version of GDK is 3.22.30
--   No package 'gdl-3.0' found
- `apt`で入れるとバージョンが足りない模様。

Ubuntuのアップデート

  • Ubuntuのバージョンを20.04LTSにアップデートする。

    • もう一度cmake を実行。
  •          $ cd ~/Downloads
             $ chmod 755 install_dependencies.txt
             $ ./install_dependencies.txt --full
             $ mkdir ~/sushi && cd ~/sushi # クローン先のディレクトリへ移動
             $ git clone https://gitlab.com/inkscape/inkscape
             $ cd inkscape
             $ git submodule update --init --recursive # これ忘れてた
             $ mkdir build && cd build
             $ cmake -DCMAKE_INSTALL_PREFIX=(prefixを指定) ..
             $ make 
             $ make install
             ```
    
     - OSのアップデートによりビルドに成功。
         - `sudo apt update` しても `apt show libgtkmm-3.0-dev` の結果バージョンが異なる。(Ubuntu 20.04では3.24、18.04では3.22)
         - そもそも `apt -v` のバージョンが異なることが原因か。
    
    

mac編

ビルド

  • macでinkscapeのビルドを試みる。
    • 環境:macOS Catalina 10.15.7
  •     $ git clone https://gitlab.com/inkscape/inkscape
        $ cd inkscape
        $ mkdir build
        $ cmake .. 
        ```
    
      - cmakeに失敗。
      - GitLabの [INSALL.md](https://gitlab.com/inkscape/inkscape/-/blob/master/INSTALL.md)にある[macの環境構築ページ](https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX)を参照し、パッケージをインストールする。
      
    

$ sudo port install
adwaita-icon-theme
boehmgc
boost
cairo
ccache
cmake
double-conversion
gdl3
gettext
gsl
gtkmm3
gtk-osx-application-gtk3
lcms2
libsoup
libxslt
ninja
poppler
potrace
py-lxml
py-numpy
-x11 +quartz


   - 上記コマンドを入力

- ```shell
No broken ports found.
     --->  Some of the ports you installed have notes:
       OpenBLAS has the following notes:
         This version is built based on a base architecture for convenience, 
         which may not be optimized for your system. To build a version 
         customized for your machine, use the +native variant
       py38-cython has the following notes:
         To make the Python 3.8 version of Cython the one that is run when you execute the commands without a version suffix, e.g. 'cython', run:

         port select --set cython cython38
     ```
   - パッケージのインストール完了
   - ビルドを行う

- ```shell
$ git clone --recurse-submodules https://gitlab.com/inkscape/inkscape.git
$ And build inkscape
# use a clean MacPorts environment (optional)
$ LIBPREFIX="/opt/local"
$ export PATH="$LIBPREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# where to install
$ PREFIX="$PWD/install-prefix"
# where to build
$ mkdir build
$ cd build
$ cmake \
   -G Ninja \
   -DCMAKE_PREFIX_PATH="$LIBPREFIX" \
   -DCMAKE_INSTALL_PREFIX="(prefixを指定)" \
   -DCMAKE_C_COMPILER_LAUNCHER=ccache \
   -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
   -DWITH_OPENMP=OFF \
   -DCMAKE_BUILD_TYPE=Debug \
   ..
$ ninja
$ ninja install
 - ビルド成功
    - [CMAKEした時のログ](https://hackmd.io/uW1HBVRCQk-ttyTbDZ5fNw)
    - [ninja ログ](https://hackmd.io/zZNpPtdDTGqXUsbd6LkMrg)
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
0
Help us understand the problem. What are the problem?