LoginSignup
1

More than 5 years have passed since last update.

sys-devel/automake:1.11 の emerge 失敗を修正

Last updated at Posted at 2016-10-19

sys-devel/automake-1.11.6* の emerge が失敗する現象を修正しました。

3 行で

  • sys-deve/automake-1.11.6 の emerge に失敗する
  • info ファイルのソースの書き方が原因
  • パッチ と、それを使う portageツリー 作った

はじめに

sys-devel/automake には記事執筆時点で 1.4 ~ 1.15 (と 9999) のスロットがあります。
automake は、常に最新版が使われるわけではなく、パッケージによっては古いバージョンの automake が要求される場合があります。

先日、新規にインストールした Gentoo に各種パッケージをインストールしていたのですが、そこで automake:1.11 が要求され、その emerge に失敗してしまいました 1。後に確認したところ、この問題が発生するスロットは 1.11 のみでした (9999は未確認)。

エラー内容の抜粋:

...
Making install in doc
make[1]: Entering directory '/var/tmp/portage/sys-devel/automake-1.11.6-r1/work/automake-1.11.6/doc'
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
rm -rf $backupdir && mkdir $backupdir && \
if (/bin/sh /var/tmp/portage/sys-devel/automake-1.11.6-r1/work/automake-1.11.6/lib/missing --run makeinfo --version) >/dev/null 2>&1; then \
  for f in automake.info automake.info-[0-9] automake.info-[0-9][0-9] automake.i[0-9] automake.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
cd "$am__cwd"; \
if /bin/sh /var/tmp/portage/sys-devel/automake-1.11.6-r1/work/automake-1.11.6/lib/missing --run makeinfo   -I . \
 -o automake.info automake.texi; \
then \
  rc=0; \
  CDPATH="${ZSH_VERSION+.}:" && cd .; \
else \
  rc=$?; \
  CDPATH="${ZSH_VERSION+.}:" && cd . && \
  $restore $backupdir/* `echo "./automake.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
automake.texi:13092: @itemx must follow @item
automake.texi:13109: @itemx must follow @item
automake.texi:13115: @itemx must follow @item
Makefile:320: recipe for target 'automake.info' failed
make[1]: *** [automake.info] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-devel/automake-1.11.6-r1/work/automake-1.11.6/doc'
Makefile:534: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
...

どうやらドキュメントのインストールのタイミングでコケているようです2

原因

エラーメッセージ

automake.texi:13092: @itemx must follow @item

が出ているあたりのソースを見てみると以下のようになっています (行番号を付与してあります)。

automake.texi
        ...
 13085  Automake also has seen its guts rewritten.  Although this rewriting
 13086  took a lot of efforts, it is only apparent to the users in that some
 13087  constructions previously disallowed by the implementation now work
 13088  nicely.  Conditionals, Locations, Variable and Rule definitions,
 13089  Options: these items on which Automake works have been rewritten as
 13090  separate Perl modules, and documented.
 13091
 13092  @itemx 2004-01-11 Automake 1.8.1
 13093  @itemx 2004-01-12 Automake 1.8.2
 13094  @itemx 2004-03-07 Automake 1.8.3
 13095  @itemx 2004-04-25 Automake 1.8.4
 13096  @itemx 2004-05-16 Automake 1.8.5
 13097
 13098  @item 2004-07-28 Automake 1.9
 13099
 13100  This release tries to simplify the compilation rules it outputs to
 13101  reduce the size of the Makefile.  The complaint initially come from
 13102  the libgcj developers.  Their @file{Makefile.in} generated with
 13103  Automake 1.4 and custom build rules (1.4 did not support compiled
 13104  Java) is 250KB@.  The one generated by 1.8 was over 9MB@!  1.9 gets it
 13105  down to 1.2MB@.
        ...

ここに現れている @itemx は項目を列挙するためのコマンドです。同様のコマンドに @item というものもありますが、 @itemx は直前の項目との行間を空けないという特徴があります。
さて、 @itemx@item の直後か他の @itemx の直後にしか置けないという制限があります。しかし、エラーの出ている 13092 行目の @itemx の直前には @item がありません。実は抜粋した範囲よりさらに前に @item があるのですが、パラグラフが変わっているため、 @item の直後と見做されずエラーとなっているのです。

他の行についても同様に、@item の直後ではない @itemx があるためにエラーとなっています。

修正

パッチ

エラーの出ている @itemx コマンドを @item に書き換えます。

automake-1.11.6-texi-fixes.patch
diff -urN -x '*~' automake-1.11.6.orig/doc/automake.texi automake-1.11.6/doc/automake.texi
--- automake-1.11.6.orig/doc/automake.texi      2012-07-10 00:39:57.000000000 +0900
+++ automake-1.11.6/doc/automake.texi   2016-10-20 01:07:57.171078537 +0900
@@ -13089,7 +13089,7 @@
 Options: these items on which Automake works have been rewritten as
 separate Perl modules, and documented.

-@itemx 2004-01-11 Automake 1.8.1
+@item 2004-01-11 Automake 1.8.1
 @itemx 2004-01-12 Automake 1.8.2
 @itemx 2004-03-07 Automake 1.8.3
 @itemx 2004-04-25 Automake 1.8.4
@@ -13106,13 +13106,13 @@

 Aside from this it contains mainly minor changes and bug-fixes.

-@itemx 2004-08-11 Automake 1.9.1
+@item 2004-08-11 Automake 1.9.1
 @itemx 2004-09-19 Automake 1.9.2

 Automake has ten years.  This chapter of the manual was initially
 written for this occasion.

-@itemx 2007-10-29 Automake repository moves to @code{savannah.gnu.org} and uses
+@item 2007-10-29 Automake repository moves to @code{savannah.gnu.org} and uses
 git as primary repository.

 @end table

portage ツリー

作りました: https://github.com/yoh2/portage-yoh2-priv

これを git clone して、 /etc/portage/make.conf の PORTDIR_OVERLAY に指定するとツリーが使えるようになります。
なお、このツリーには、今回の修正のみではなく、他の私的修正・変更なんかも入れていく予定ですのでご注意を。


  1. 以前はきちんとインストールできていました。makeinfo の仕様が変わったのか automake のソースがこっそり変わったのか。 

  2. プログラム本体のビルドはきっちり成功しているだけに余計悔しい。 

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1