MacPortsを使ってTracをインストール

いつも同じようなことをやっているような気もするが、今回はMacPortsを使ってTracをインストール。MacBook Pro (MacOS X, 10.5.6) へ新規に入れたMacPorts経由でTracをインストールしようとしたものの、何故かdb46のインストールに失敗してしまう。

[mymac:~] foo% sudo /opt/local/bin/port install db46

      • > Building db46

Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_db46/work/db-4.6.21/build_unix" && make all " returned error 2
Command output: /bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -c -O2 -I../dist/.. -I/opt/local/include ../dist/../db_dump185/db_dump185.c
/usr/bin/gcc-4.0 -c -O2 -I../dist/.. -I/opt/local/include ../dist/../db_dump185/db_dump185.c -fno-common -DPIC -o .libs/db_dump185.o
../dist/../db_dump185/db_dump185.c: In function 'main':
../dist/../db_dump185/db_dump185.c:211: warning: assignment makes pointer from integer without a cast
../dist/../db_dump185/db_dump185.c:213: warning: assignment makes pointer from integer without a cast
../dist/../db_dump185/db_dump185.c:228: error: 'struct __db' has no member named 'seq'
../dist/../db_dump185/db_dump185.c:228: error: 'R_NEXT' undeclared (first use in this function)
../dist/../db_dump185/db_dump185.c:228: error: (Each undeclared identifier is reported only once
../dist/../db_dump185/db_dump185.c:228: error: for each function it appears in.)
../dist/../db_dump185/db_dump185.c:233: error: 'struct __db' has no member named 'seq'
../dist/../db_dump185/db_dump185.c: In function 'db_hash':
../dist/../db_dump185/db_dump185.c:261: error: 'struct __db' has no member named 'internal'
../dist/../db_dump185/db_dump185.c:263: error: 'struct __db' has no member named 'internal'
../dist/../db_dump185/db_dump185.c: In function 'db_btree':
../dist/../db_dump185/db_dump185.c:288: error: 'struct __db' has no member named 'internal'
make: *** [db_dump185.lo] Error 1

Error: Status 1 encountered during processing.

調べてみたら引数の指定が足りないことが原因らしいと分かった。

Today, I needed to build something that again dependend on db44 and fortunately, through more diligent Googling I came upon this page that has a working solution, posted by Ralph Deguelle.

Simply install the port with variant darwin_8 and universal:

sudo port -v install db44 +darwin_8 +universal

That’ll work!

Building db44 using MacPorts

上記エントリのコメントには色々なオプション(?)が紹介されているが、下記のように"+universal"を付けるだけで上手くいった。

[mymac:~] foo% sudo /opt/local/bin/port install db46 +universal

      • > Fetching db46
      • > Verifying checksum(s) for db46
      • > Extracting db46
      • > Applying patches to db46
      • > Configuring db46
      • > Building db46
      • > Staging db46 into destroot
      • > Installing db46 @4.6.21_3+universal
      • > Activating db46 @4.6.21_3+universal
      • > Cleaning db46

引き続きTrac 0.11.2.1_0も無事にインストール出来た。貴重な情報に感謝。