やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

gimp-sharp(GIMP#)は動作しなかった

 スクリプトC#で書けるラッパ。

情報源

情報

 情報がない&古い。使い方がわからない。古くてバージョン差異により動作しないかもしれない。

手順

1. インストール

sudo apt -y install gtk-sharp2
sudo apt -y install gtk-sharp2-gapi
sudo apt -y install libgimp2.0-dev
git clone https://github.com/mrijk/gimp-sharp
cd gimp-sharp
autoreconf -i
./configure
make
sudo make install

 以下パスにインストールされた。

/usr/lib/gimp/2.0/plug-ins

2. 実行

  1. GIMP2.10.8起動
  2. メニュー Filters配下にPhotoshop Actionsなどの項目が増えているのを確認した
  3. クリックするとエラーになる
    • GIMPエラーコンソールGIMPエラーと表示される
    • 以下のように表示される
"PicturePackage" プラグインがクラッシュしました。
(/usr/lib/gimp/2.0/plug-ins/PicturePackage)

プラグインのクラッシュによって GIMP の内部状態が不安定になった可能性があります。作業中の画像を一旦保存して GIMP を再起動した方が良いでしょう。

失敗ログ

ログ

失敗1

git clone https://github.com/mrijk/gimp-sharp
cd gimp-sharp
autoreconf -i

 失敗した……。

...
Makefile.am: error: required file './README' not found
...

 READMEファイルがないらしい。いやある。名前が微妙に違った。README.mdをコピペしてリネームし再試行するとエラーなし。成功したっぽい。

失敗2

 失敗1後。/usr/local/lib/gimp/2.0/plug-insにインストールされるとあるが、plug-insは展開したディレクトリ配下にあった。これを~/.config/GIMP/2.10/plug-insにペーストすればインストールできそう。

cd ../
cp ./gimp-sharp/plug-ins ~/.config/GIMP/2.10/
  1. GIMP2.10.8を起動
  2. メニュー Filstersをみても以下にある項目が見つからない……
/Filters/Picture Package
/Filters/Photoshop Actions
/Filters/Artistic/Ministeck
/Filters/Artistic/Pointillize
/Filters/Blur/Average
/Filters/Distorts/Fragment
/Filters/Light and Shadow/Raindrops
/Filters/Render/Forge
/Filters/Render/NCP
/Filters/Render/QR
/Filters/Render/Sky
/Filters/Render/Splitter
/Filters/Render/Swirlies
/Filters/Web/Slice Tool
/Image/Trim

失敗3

 gitではなくzipファイルからやらねばダメかと思って、やってみた。

wget https://codeload.github.com/mrijk/gimp-sharp/zip/master
unzip master
cd gimp-sharp-master
./configure
make
sudo make install

 ./configureのとき以下エラー。

checking for gimptool-2.0... no
configure: error: You don't have gimptool-2.0. Please install the GIMP development package!
 $ apt search gimptool
libgimp2.0-dev/stable,stable 2.10.8-2 armhf
  Headers and other files for compiling plugins for GIMP

 どうやらlibgimp2.0-devが必要らしい。あと、autoreconf -iのあとに./configureする必要があったようだ。ビルド手順がよくわからん。

sudo apt -y install libgimp2.0-dev

 最初からやってみると以下。

sudo apt -y install libgimp2.0-dev
git clone https://github.com/mrijk/gimp-sharp
cd gimp-sharp
autoreconf -i
./configure
...
Building GIMP-SHARP with prefix=/usr/local
GIMP-SHARP Features:
  Unit Tests          : no
  Embedded Webserver  : no
  Paint.NET       : no
  Incomplete          : no
  ECW             : no (ECW library not found)
  Boo support         : no
  FSharp support      : no
  IronPython support  : no
  IronRuby support    : no
  Java support        : no
  Nemerle support     : no
  Oxygene support     : no
  Scala support       : no
  Visual Basic support: no

 ./congigureまでは成功。

 どうやら色々とオプションがあるらしい。以下で確認できる。

./configure --help

ログ

`configure' configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-static[=PKGS]  build static libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --disable-libtool-lock  avoid locking (might break parallel builds)

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                          both]
  --with-aix-soname=aix|svr4|both
                          shared library versioning (aka "SONAME") variant to
                          provide on AIX, [default=aix].
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                          compiler's sysroot if not specified).
  --with-unittest         build unittest plug-in (default-no)
  --with-webserver        build embedded webserver plug-in (default-no)
  --with-pdn              build Paint.NET plug-in (default-no)
  --without-ecw           do not build the ECW plug-in
  --with-incomplete       build incomplete plug-ins (default-no)
  --with-java             support for the Java language (default-no)
  --with-boo              support for Boo (default-no)
  --with-fsharp           support for F\# (default-no)
  --with-ironpython       support for IronPython (default-no)
  --with-ironruby         support for IronRuby (default-no)
  --with-nemerle          support for Nemerle (default-no)
  --with-oxygene          support for Oxygene (default-no)
  --with-scala            support for Scala (default-no)
  --with-vb               support for Visual Basic (default-no)

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  LT_SYS_LIBRARY_PATH
              User-defined run-time library search path.
  CPP         C preprocessor
  PKG_CONFIG  path to pkg-config utility
  PKG_CONFIG_PATH
              directories to add to pkg-config's search path
  PKG_CONFIG_LIBDIR
              path overriding pkg-config's built-in search path
  MONO_CFLAGS C compiler flags for MONO, overriding pkg-config
  MONO_LIBS   linker flags for MONO, overriding pkg-config
  MONO_DEPENDENCY_CFLAGS
              C compiler flags for MONO_DEPENDENCY, overriding pkg-config
  MONO_DEPENDENCY_LIBS
              linker flags for MONO_DEPENDENCY, overriding pkg-config

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to the package provider.

失敗4 make

make
...
Package gtk-sharp-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk-sharp-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk-sharp-2.0' found
...

 パッケージがないと怒られた。それらしいのを探してみる。

apt search gtk-sharp
gtk-sharp2/stable-raspbianbuster 2.12.45-0xamarin17+raspbian10b1 all
  GTK# 2.12 suite, CLI bindings for GTK+

gtk-sharp2-examples/stable-raspbianbuster 2.12.45-0xamarin17+raspbian10b1 all
  sample applications for the GTK# 2.12 toolkit

gtk-sharp2-gapi/stable-raspbianbuster 2.12.45-0xamarin17+raspbian10b1 armhf
  C source parser and C# code generator for GObject based APIs

gtk-sharp3/stable,stable 2.99.3-3 armhf
  GTK# 3.0 suite, CLI bindings for GTK+

gtk-sharp3-examples/stable,stable 2.99.3-3 all
  sample applications for the GTK# 3.0 toolkit

gtk-sharp3-gapi/stable,stable 2.99.3-3 armhf
  C source parser and C# code generator for GObject based APIs

libgtk-sharp-beans-cil/stable,stable 2.14.1-4 all
  Supplementary CLI bindings for GTK 2.14+

libgtk-sharp-beans2.0-cil-dev/stable,stable 2.14.1-4 all
  Supplementary CLI bindings for GTK 2.14+ - development package

libgtk2.0-cil/stable-raspbianbuster 2.12.45-0xamarin17+raspbian10b1 armhf
  CLI binding for the GTK+ toolkit 2.12

libgtk2.0-cil-dev/stable-raspbianbuster 2.12.45-0xamarin17+raspbian10b1 armhf
  CLI binding for the GTK+ toolkit 2.12

libgtk3.0-cil/stable,stable 2.99.3-3 armhf
  CLI binding for the GTK+ 3.0 toolkit

libgtk3.0-cil-dev/stable,stable 2.99.3-3 armhf
  CLI binding for the GTK+ toolkit 3.0

libwebkitgtk3.0-cil/stable,stable 2.0.0+git20151221-3 armhf
  CLI bindings for WebKitGTK+ 3.0 using GObject Introspection

 関係ありそうなのは以下か。

sudo apt -y install gtk-sharp2
sudo apt -y install gtk-sharp2-gapi

所感

 やはりPython2で頑張るしかないのか……。C#で書けたら良かったのになぁ……。残念。

対象環境

$ uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux