ラベル ports の投稿を表示しています。 すべての投稿を表示
ラベル ports の投稿を表示しています。 すべての投稿を表示

2010-08-27

MacPorts を 1.8.x から 1.9.x へアップグレードした場合の注意点

port がアンインストールできない

きっかけは、Ruby 1.9.2p0 のインストール(とアンインストール)。ターゲットマシンは Mac mini と iMac だ。

どちらの Mac でも ports を使ったインストールには問題なかった。ちょっと試したいことがあったため、mini の方から一度アンインストールすることにした。ところが、ここでつまづいた。アンインストールが失敗したのだ(↓)。

[mini] mnbiwa% sudo port uninstall ruby19                           [~]
--->  Deactivating ruby19 @1.9.2-p0_1+mactk
--->  Uninstalling ruby19 @1.9.2-p0_1+mactk
Error: port uninstall failed: list element in braces followed by \
"/cdesc-dig" instead of space

同じことを iMac でやってみると、不思議なことにこちらは成功する。Mac mini と iMac になんの違いがあるのか? どちらも、Snow Leopard だし、ports のバージョンも同じ 1.9.1 だ。違いと言えば、iMac は最近使い始めたマシンだということぐらい。

実は、そこに答えが隠れていた。

原因は MacPorts のアップグレードが完全じゃなかったため

あれこれと試すうち、/opt/local/var/macports/receipts に違いがありそうだとわかってきた。というのも、mini ではこのディレクトリにはインストールずみの port の情報が記録されているのだが、iMac ではディレクトリが空なのだ。

このディレクトリを頼りにググってみたところ、答え(↓)を見つけた。

(談話室 - MacPorts-JP にある「1.9.0 リリース時のChangeLog の抄訳」より)
sqlite ベースの registry2.0 コードが統合されました。macports.conf 中の portdbformat 変数を 'sqlite' に設定することで有効になります。既存のフラットな レシートは、充分な権限下にて初回 port(1) が実行された際に変換されます。 オリジナルのコードは sfiera によるもので、r63398 以降 jmr によって修正・統合 されました。#13054 (dependencies from old port versions stick around across upgrades) や #14123 (files whose paths differ only in case are left behind when uninstalling) といった、古いフォーマットで悩まされていた問題の多くは、 新しいフォーマットでは発生しません。

同じ場所に、この抄訳の訳者による注意書きもあった。曰く、selfupdate しただけでは registry 2.0 の恩恵を受けられないため手動で macports.conf を更新すると良い、と。まったく、その通りだった。「たちゃな」さん(ChangeLog の訳者の人)、感謝します。

2010-08-23

port で aria2 をインストール

以下が、port からのインストールの様子。

[imac] mnbi% time sudo port install aria2                         [~]
--->  Computing dependencies for aria2
--->  Dependencies to be installed: gnutls libtasn1 lzo autoconf \
      help2man p5-locale-gettext m4 automake libtool opencdk \
      libgcrypt libgpg-error readline libxml2
[...snip...]
--->  Verifying checksum(s) for aria2
--->  Extracting aria2
--->  Configuring aria2
--->  Building aria2
--->  Staging aria2 into destroot
--->  Installing aria2 @1.10.0_0
--->  Activating aria2 @1.10.0_0
--->  Cleaning aria2
sudo port install aria2  481.04s user 138.41s system 161% \
cpu 6:23.26 total
[imac] mnbi% rehash                                               [~]
[imac] mnbi% which aria2c                                         [~]
/opt/local/bin/aria2c
[imac] mnbi% aria2c -v                                            [~]
aria2 バージョン 1.10.0
Copyright (C) 2006, 2010 Tatsuhiro Tsujikawa

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

** Configuration **
Enabled Features: BitTorrent, Firefox3 Cookie, GZip, HTTPS, \
Message Digest, Metalink, XML-RPC
Hash Algorithms: md5, sha-1, sha-256

バグレポートはこちらへ: t-tujikawa@users.sourceforge.net
Visit http://aria2.sourceforge.net/

aria2 のコマンド名は aria2c になっている。

aria2c の実行結果を以下に示す(長い行は適宜バックスラッシュのところで折り返し、長い URI やファイル名は省略してある)。ダウンロードしたのは Sage という数学ソフトウェア。先にブラウザから落としてあった metalink ファイルを指定している。

[imac] mnbi% aria2c -d ~/Downloads ~/Downloads/sage[...snip...].metalink

2010-08-21 10:35:48.516462 WARN - HTTPS サーバーの証明証検証エラー\
が発生するかもしれません. 詳しくは --ca-certificate と \
--check-certificate オプションを参照してください.

2010-08-21 10:35:49.366867 NOTICE - ダウンロード完了: [...snip...].torrent

2010-08-21 10:35:49.367686 ERROR - Exception caught while loading \
DHT routing table from /Users/mnbi/.aria2/dht.dat
Exception: [DHTSetup.cc:106] Could not open file

2010-08-21 10:35:49.367812 NOTICE - DHT: listening to port 6897
[#2 SIZE:0B/407.5MiB(0%) CN:0 SEED:0 SPD:0Bs] [FileAlloc:#2 0B/407.5MiB(0%)]    
2010-08-21 10:35:52.717943 NOTICE - BitTorrent: listening to port 6949
[#2 SIZE:0B/407.5MiB(0%) CN:5 SEED:0 SPD:0Bs]                                   
2010-08-21 10:35:54.848347 ERROR - CUID#20 - Download aborted. \
URI=http://mirrors.[...snip...].dmg
Exception: [AbstractCommand.cc:265] \
URI=http://mirrors.[...snip...].dmg
  -> [HttpSkipResponseCommand.cc:180] リソースが見つかりませんでした

2010-08-21 10:35:55.072457 ERROR - CUID#23 - Download aborted. \
URI=http://mirror.[...snip...].dmg
Exception: [AbstractCommand.cc:265] \
URI=http://mirror.[...snip...].dmg
  -> [HttpSkipResponseCommand.cc:180] リソースが見つかりませんでした
 *** Download Progress Summary as of Sat Aug 21 10:36:48 2010 ***               
================================================================================
[#2 SIZE:280.2MiB/407.5MiB(68%) CN:5 SEED:0 SPD:5.4MiBs ETA:23s]
FILE: /Users/mnbi/Downloads/sage-4.5.2-OSX-64bit-10.6-i386-Darwin.dmg
--------------------------------------------------------------------------------

[...snip...]
 *** Download Progress Summary as of Sat Aug 21 10:38:49 2010 ***               
================================================================================
[#2 SIZE:395.2MiB/407.5MiB(96%) CN:1 SEED:0 SPD:213.7KiBs ETA:59s]
FILE: /Users/mnbi/Downloads/sage-4.5.2-OSX-64bit-10.6-i386-Darwin.dmg
--------------------------------------------------------------------------------

 *** Download Progress Summary as of Sat Aug 21 10:39:50 2010 ***               
================================================================================
[#2 SEEDING(ratio:0.0) CN:0 SEED:0]
FILE: /Users/mnbi/Downloads/sage-4.5.2-OSX-64bit-10.6-i386-Darwin.dmg
--------------------------------------------------------------------------------

[...snip...]
[#2 SEEDING(ratio:0.0) CN:0 SEED:0]                                             
2010-08-21 10:45:20.927224 NOTICE - シャットダウン中です... \
緊急時に即座にシャットダウンしたい場合は Ctrl-C をもう一度押してください.
[#2 SEEDING(ratio:0.0) CN:0 SEED:0]                                             
ダウンロード結果:
gid|stat|avg speed  |path/URI
===+====+===========+===========================================================
  1|  OK|  36.3KiB/s|[MEMORY]sage-4.5.2-OSX-64bit-10.6-i386-Darwin.dmg.torrent
  2|  OK|   1.9MiB/s|/Users/mnbi/Downloads/sage-4.5.2-OSX-64bit-10.6-i386-Darwin.dmg

凡例:
 (OK):download completed.

ダウンロードが終わっても aria2 の実行が終了しなかったのは、BitTorrent で共有状態が始まっていたからか? ↑のログで SEEDING となっているところ。しばらく放置していたが何も起きなかったので、Ctrl + C を叩いたところ、「シャットダウン中です...」となり、ダウンロード結果が表示されて終了した。

関連リンク

  • aria2 project (SourceForge.net)
  • Sage (オープンソースな数学ソフトウェア)

関連記事

2009-12-06

Gauche 0.9 をインストール

Mac mini (Snow Leopard Server) に Gauche の最新版を インストールしてみた。Ports が少し古いバージョン対応のものなので、Portfiles をちょいちょいと書き換えて、インチキ ports としてインストール。Gauche 用の Portfiles は /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/gauche にある。

Portfiles の変更点はこんな感じ(↓):

  1. Version を 0.9 に。
  2. checksums を再計算した値に。
  3. patchfiles は不要なので、行ごと削除

ちなみに、checksum の再計算は以下のように実行する (MacPorts Guide より)。md5 は md5 で、あとの 2 つは openssl に計算のタイプを指定して行う。

[mini:~] mnbi% md5 Gauche-0.9.tgz 
MD5 (Gauche-0.9.tgz) = 1ab7e09da8436950989efd55b5dc270a
[mini:~] mnbi% openssl sha1 Gauche-0.9.tgz 
SHA1(Gauche-0.9.tgz)= ebc18917c36201d6c3fda29dfdc52fce2d856a5f
[mini:~] mnbi% openssl rmd160 Gauche-0.9.tgz
RIPEMD160(Gauche-0.9.tgz)= 3e0dfc1d498849b0d647e13f49addd0a56cc56fe

configure のオプションはともかくとして、patch の適用の有無はさすがに不安なので、port とは関係なしに、configuremakemake test して確認した。そのときの configure がこれ (行を "\" で折り返してある)。

./configure --mandir=/opt/local/share/man \
            --infodir=/opt/local/share/info \
            --with-local=/opt/local \
            --enable-multibyte=utf-8 \
            --with-iconv=/opt/local \
            --with-slib=/opt/local/lib/slib \
            --enable-threads=pthreads \
            --enable-ipv6

オリジナルの Portfiles にあった設定そのままを手動で実行したことになる。 この設定で make の後、make test をした結果がこれ(↓)。全テスト合格。

Total: 10076 tests, 10076 passed,     0 failed,     0 aborted.

インチキ ports を使ったインストールの実行結果は以下のとおり。

[mini:~] mnbi% time sudo port install gauche
--->  Computing dependencies for gauche
[...snip...]
--->  Installing gauche @0.9_0
--->  Activating gauche @0.9_0
--->  Cleaning gauche
126.559u 33.476s 1:58.65 134.8% 0+0k 233+860io 0pf+0w
[mini:~] mnbi% rehash
[mini:~] mnbi% which gosh
/opt/local/bin/gosh
[mini:~] mnbi% gosh -V
Gauche scheme shell, version 0.9 [utf-8,pthreads], i386-apple-darwin10.2.0

Gauche 0.9 に付いてくる configure を見ると、Portfiles で指定されている gdbmlibiconvslib に加えて、zlib にも依存している。依存関係に追加すべきか迷ったが、Snow Leopard 標準の zlib も、ports のものもバージョンが同じようだったので、気にしないことにした。

関連リンク

  • MacPorts Guide (チェックサムの計算については、4.2 Creating a Portfile のステップ 13 を参照)

参考文献

プログラミングGauche
プロジェクト
オライリージャパン ( 2008-03-14 )
ISBN: 9784873113487
おすすめ度:アマゾンおすすめ度

関連記事

MacBook にも Ruby 1.9 をインストール

mini のときと同じく実行結果だけ。

[book:~] mnbi% time sudo port install ruby19
--->  Computing dependencies for ruby19
--->  Fetching ruby19
[...snip...]
--->  Installing ruby19 @1.9.1-p243_0
--->  Activating ruby19 @1.9.1-p243_0
--->  Cleaning ruby19
247.197u 51.410s 4:35.89 108.2% 0+0k 44+5904io 0pf+0w
[book:~] mnbi% rehash
[book:~] mnbi% which ruby1.9 
/opt/local/bin/ruby1.9
[book:~] mnbi% ruby1.9 -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10]

2009-12-03

Ruby 1.9.1 を ports でインストール

実行結果だけを示す。要した時間は約5分。

[mini:~] mnbi% sudo port install ruby19
--->  Computing dependencies for ruby19
--->  Fetching ruby19
[... snip ...]
--->  Building ruby19
--->  Staging ruby19 into destroot
--->  Installing ruby19 @1.9.1-p243_0
--->  Activating ruby19 @1.9.1-p243_0
--->  Cleaning ruby19
[mini:~] mnbi% rehash
[mini:~] mnbi% ruby1.9 -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10]

2009-11-14

Mac mini に Maxima をインストール

ふと思い立って、Maxima をインストールしてみることにした。 まずは Mac mini (Server) でやってみた。

ちなみに、Maxima っていうのは GPL で配布されているフリーな数式処理システムだ。「はじめてのMaxima」によれば、

Maxima は 1960 年代の MIT の MACSYMA プロジェクトで開発された「MACSYMA」(MAC's SYmbolic Manipulation system) の「DOE(エネルギー省)版」を、Texas 大学のシェルター氏 (Schelter) が「Common Lisp: The language 第一版」に対応した「gcl」に移植したものです。

ということだ。手元にあるかなり古い雑誌(「インターフェイス」増刊の「archive」No.12) によれば、Maxima の前身である Macsyma の作成が開始されたのが 1966 年。1972 年に ARPA ネット(!) を通じて全米で使用可能となって、さらに一般で購入可能となったのが 1982 年だとのこと(ちなみに、同誌によれば現在数式処理ソフトとして有名な Mathematica の最初の版ができたのが 1988 年だそうな)。なかなかに歴史のあるソフトだ。

インストールを始める前はつまづくとは思っていなかった。MacPorts でインストールできるだろうと思っていたから。sudo port install maxima で後は待つだけ、そう高をくくっていた。世の中、そうそう甘くない。

2009-11-06

MacPorts で Git をインストール

ブログのテンプレートをいじったりしているので、テンプレート(XML)のバージョン管理をしようと思い立った。Snow Leopard には Subversion (/usr/bin/svn 等)が標準で用意されている(開発ツールをインストールしたからかも)んだけど、せっかくなので Git に挑戦してみたい。まずは Mac mini Server に ports まかせで Git をインストール。手順はこれ(↓)だけ(「入門 git」の p.17 より)。

% sudo port install git-core +svn +doc

依存するパッケージも多数、未インストールの状態だったため、かなり時間がかかった。およそ 30 分。↑の port コマンドが完了した後は、こう(↓)なった:

% git --version
git version 1.6.5.1

これで完了、と思ったら、ports tree を更新していなかったことを思い出す。

% sudo port sync

古くなっているものがないか、確認してみる。

% port outdated
The following installed ports are outdated:
db46                           4.6.21_5 < 4.6.21_6       
git-core                       1.6.5.1_0 < 1.6.5.2_0     
sqlite3                        3.6.19_0 < 3.6.20_0

や、やられた〜 orz。更新しておく。

% sudo port upgrade outdated
--->  Computing dependencies for db46
--->  Fetching db46
...
--->  Extracting git-core
--->  Applying patches to git-core
--->  Configuring git-core
--->  Building git-core
--->  Staging git-core into destroot
--->  Deactivating git-core @1.6.5.1_0+doc+svn
--->  Computing dependencies for git-core
--->  Installing git-core @1.6.5.2_0+doc+svn
--->  Activating git-core @1.6.5.2_0+doc+svn
--->  Cleaning git-core

今度はすぐに終わった。

% git --version
git version 1.6.5.2

ミッション・コンプリート。今日はここまで。