CentOS で swfdec の install に挑戦 (多分、成功)

ごり押しでハマッたので、真面目にインストールする事にしました。
方針としては、必要なパッケージを先に /usr/local/ に入れて、それを参照させる事。
当たり前だけど…

問題は configure が /usr/bin/pkg-config を

% pkg-config  --exists --print-errors "glib-2.0 >= 2.17.3 gobject-2.0 gmodule-no-export-2.0"
Requested 'glib-2.0 >= 2.17.3' but version of GLib is 2.12.3

って感じでチェックするので、/usr/local で頑張っても /usr に入ってる
パッケージでバージョンチェックして跳ねられるんですよね。

pkg-config

pkg-config のデータが何処にあるかというと、

% ls /usr/lib/pkgconfig/
ImageMagick.pc            gnome-mime-data-2.0.pc          pango.pc
Wand.pc                   gnome-python-2.0.pc             pangocairo.pc
alsa.pc                   gnome-python-desktop-2.0.pc     pangoft2.pc
	<略>

こんななってて、pc ファイルの中は

% cat /usr/lib/pkgconfig/ImageMagick.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include

Name: ImageMagick
Description: ImageMagick - Convert, Edit, and Compose Images
Version: 6.2.8
Libs: -L${libdir} -lWand -lMagick
Cflags: -I${includedir}

こんなです。
手動で入れたパッケージに対応するファイルは、 /usr/local/lib/pkgconfig/ にあるので、
これを参照する pkg-config を /usr/local/bin に置けば解決っぽい。

0.21 が出てるっぽいけど http://pkg-config.freedesktop.org/releases/ にアクセスできないので、
riken から 0.20 をゲットして、普通に configure & make install

% /usr/local/bin/pkg-config --libs glib-2.0
  • L/usr/local/lib -lglib-2.0

これで、おk

対象バージョン

swfdec-0.8.0 でコンパイルする事にします。

必要なパッケージ一覧

% grep _VER= configure
GLIB_VER=2.16
PANGO_VER=1.16
GTK_VER=2.8.0
LIBOIL_VER=0.3.1
CAIRO_VER=1.6.0

2.19 は開発版らしいので、とりあえず 2.18。

どうでもいいけど、GNOME のトップからダウンロードページを探すのが大変なのですが…

プレイヤーを動かす気はないので GTK は要らないかな。
あと、gstreamer も面倒なので後回し。

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure \
    • disable-gtk --disable-gstreamer

cairo-1.8.0

]env PKG_CONFIG=/usr/local/bin/pkg-config ./configure
checking for cairo's image surface backend feature...
checking for pixman... no
no
checking whether cairo's image surface backend feature could be enabled... no
(requires pixman-1 >= 0.12.0 http://cairographics.org/releases/)
configure: error: mandatory image surface backend feature could not be enabled

怒られた…

pixman-0.12.0

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure

で make install

cairo-1.8.0 再び

今度は おk

liboil-0.3.15

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure

問題なし。順調。

cairo-1.8.0

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure
        <略>
configure: WARNING: Could not find libpng in the pkg-config search path
checking whether cairo's PNG functions feature could be enabled... no
configure: error: recommended PNG functions feature could not be enabled

/usr/local にも入れるか…

libpng-1.2.32

% ./configure

cairo-1.8.0 再び

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure
	<略>
configure: error: Cairo requires at least one native font backend.
Please install FreeType and fontconfig and try again.
ふーむw 

fontconfig-2.5.93

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure

cairo-1.8.0 三度

% env PKG_CONFIG=/usr/local/bin/pkg-config ./configure
	<略>
cairo (version 1.8.0 [release]) will be compiled with:

The following surface backends:
  Image:         yes (always builtin)
  Xlib:          yes
  Xlib Xrender:  yes
  Quartz:        no (requires CoreGraphics framework)
  Quartz-image:  no (disabled, use --enable-quartz-image to enable)
  XCB:           no (disabled, use --enable-xcb to enable)
  Win32:         no (requires a Win32 platform)
  OS2:           no (disabled, use --enable-os2 to enable)
  PostScript:    yes
  PDF:           yes
  SVG:           yes
  glitz:         no (disabled, use --enable-glitz to enable)
  BeOS:          no (disabled, use --enable-beos to enable)
  DirectFB:      no (disabled, use --enable-directfb to enable)

The following font backends:
  User:          yes (always builtin)
  FreeType:      yes
  Win32:         no (requires a Win32 platform)
  Quartz:        no (requires CoreGraphics framework)

The following functions:
  PNG functions: yes

And the following internal features:
  gcov support:  no
  test surfaces: no (disabled, use --enable-test-surfaces to enable)
  ps testing:    yes
  pdf testing:   no (requires poppler-glib >= 0.9.2)
  svg testing:   no (requires librsvg-2.0 >= 2.15.0)

ふむ。

pango-1.22.1

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure \

swfdec-0.8.0

env PKG_CONFIG=/usr/local/bin/pkg-config ./configure \
    • disable-gtk --disable-gstreamer
<略> checking for ALSA... configure: error: Package requirements (alsa >= 1.0) were not met: No package 'alsa' found

面倒なので手抜き

# ln -s /usr/lib/pkgconfig/alsa.pc  /usr/local/lib/pkgconfig/.

これで、おk

動作確認

tools 以下に生成された dump コマンドがそれっぽく動いてるので、成功してるっぽい。

% ./tools/dump  ~/flash/chara.swf
file:
  version: 6
  rate   : 30 fps
  size   : 800x545 pixels
objects:
1: SwfdecImage
  JPEG with global table 800 x 545
2: SwfdecShape
800x545 image 1 (no repeat, bilinear)
3: SwfdecFont
  _????
  11 characters
4: SwfdecTextField

マニュアル

なるほど、なるほど…