Home> 備忘録アーカイブ

備忘録の最近のブログ記事

MT5 移行で 2 度はまった

ようやく MT5 (正確には MTOS 5.04)に移行した。MT4 からの upgrade なので、テンプレートとかプラグインとかも MT5 対応をうたったものに移行した。図らずも、この移行作業で年を越してしまった。

で、移行後の記事を何とは無しに見ていたら、pre 要素内の改行が無視されていることに気づいた。以下、解決に至るまでの様子。

pre 要素って元々そういう物だったっけ ?
→ No. pre 要素内の改行コードは表示にもそのまま反映されるはず。
じゃあ改行を無視するようなスタイル指定がされている ?
→ No. テンプレート(mt.Vicuna Simple)の CSS をざっと見たけどそんな指定はない。
ところで特定要素のスタイル適用状況を調べるのに Safari 便利すなぁ。(単に Firebug とかをまだインストールしてなかっただけ)
そもそも pre 要素内に改行コードはちゃんと入ってる ?
→ No! つーかよく見たら記事本文が全部 1 行に連結されちゃってるし。MT5 が記事を生成するときに改行コードを削除してるということかー

ということでテンプレートを見てみた。

<MTIf tag="EntryBody" strip_linefeeds="1" trim="1">
                <div class="textBody">
<$MTEntryBody$>
                </div>
</MTIf>

なんだ、strip_linefeeds の値を 0 にすれば良いだけか。ついでに trim0 にするか。で再構築、と。

……
解せぬ。何故変わらぬ。

あれ、そもそもこの 2 つのモディファイア自体要らねーんじゃね ? オリジナル(MT4 用)にも無いし。
ということで試しに削除したら、うまくいった。
なんでやねん…
なんでやねん……

MT 既定の CAPTCHA に関して

  • 2009年2月 8日 18:39
  • 備忘録

CAPTCHA の画像の生成に失敗する件についてググってみたら,解決策があっさり見つかった.

[mtdir]/lib/MT/Util/Captcha.pm

186行あたり
---------------------------------------------------------
my $im = $imbase->Montage(geometry => $geometry_str,
tile => $tile_geom);
---------------------------------------------------------



---------------------------------------------------------
my $im = $imbase->Append(stack=>"");
---------------------------------------------------------

に。

これだけで終わらせるのはしゃくなので,この対処でなぜ良いのかを調べた.と言っても ImageMagick の Perl API リファレンスを読んだだけ.

$imbase は,1 字ずつ描かれた画像を字数分保持しているようなオブジェクト.Montage() は,それらを並べた 1 枚の画像を生成して返すようなメソッド.並べ方は引数 tile で指定できる.2 行 3 列に並べたいなら tile => "3x2" とする.
一方 Append()は,$imbase が保持してる複数の画像を縦 (上→下) or 横 (左→右) に並べた 1 枚の画像を生成して返すようなメソッド.並べ方は引数 stack で指定できる.縦に並べたいなら stack => 真値 とする.

で,生成したい画像は字が描かれた画像を横 1 列に (デフォルトでは 6 字分) 並べたようなものだから,わざわざ $imbase->Montage(tile => "6x1"); なんてする必要は無くて $imbase->Append(); で十分,というわけ.

そもそも Montage() がなぜ失敗するのか,という点については未だ不明.より詳しい報告が既に出ているようだけれど.

MDT242WG-SB + DTC10 で “ながら見”

  • 2008年10月12日 20:00
  • 備忘録

DTC10 の購入直後当時,PinP を使ってテレビを見るのは諦めていた.でも今になってよくよく考えてみれば,PinP で表示される領域はどうせ狭い (640 * 480 くらい) んだから,だったらアナログ入力でも十分じゃん,と気付いた.

ということで,MDT242WG-SB と DTC10 を HDMI とコンポジットの両方で接続した.PC を使う時は DVI-D 入力映像を親画面,コンポジット入力映像を子画面で表示.音声は子画面連動.テレビをがっつり見る時は HDMI 入力映像を親画面で表示.

コンポジット入力映像を子画面に表示した様子

4 年以上前の携帯電話で撮ったからレンズ歪みが半端ねぇw

はっはっは.なかなか良い感じではないか.アスペクト比が正しくないけど,これを合わせようとすると HDMI 表示と切り替える度に DTC10 の設定を変更する必要があるから,放置.どうせ “ながら見” だしね.

mlterm + screen + aptitude での表示の崩れを修正…できていなかった

  • 2008年10月12日 18:38
  • 備忘録

col_size_of_width_a=1 にするのは全っ然お話にならなかった.なので値を 2 に戻して,ここに示されている対処を実施した.結果は下図の通り.

mlterm + screen 上で aptitude を起動した直後のスクリーンショット

この起動直後の時点で既にうまく表示できていない.j などを押して選択行を移動すると更に無残な結果に.

mlterm + screen 上で aptitude を起動し選択行を移動した後のスクリーンショット

これじゃあ全然使い物にならない.

mlterm の代わりに konsole を使うと,以下の通り問題無し.

konsole + screen 上で aptitude を起動した直後のスクリーンショット konsole + screen 上で aptitude を起動し選択行を移動した後のスクリーンショット

一体何が原因なのかねぇ….

% apt-show-versions aptitude konsole mlterm screen
aptitude/lenny uptodate 0.4.11.8-1
konsole/lenny uptodate 4:3.5.9.dfsg.1-5
mlterm/lenny uptodate 2.9.4-4
screen/lenny uptodate 4.0.3-11

因みに Baghira を使ってます (Debian パッケージ名は kwin-baghira).

mlterm + screen + aptitude での表示の崩れを修正

  • 2008年9月21日 23:55
  • 備忘録

結論: col_size_of_width_a=1.

mlterm から直接 aptitude を起動すると表示は崩れない.しかし mlterm から screen を経由して aptitude を起動した場合は罫線の表示が崩れる.mlterm のオプション termtype の値が "xterm" でも "mlterm" でも変化無し.じゃあ他の端末エミュレータではどうだ,と konsole + screen + aptitude を試したら,表示は崩れなかった.

lenny 以降の screen では Ambiguous characters 対応パッチが当たっていますとあるし (実際 apt-get source screen でソースを取得してファイルを見てみたら当該パッチが在った),上の結果からも,これは screen ではなく mlterm の問題だな,と.

しかしなー,.mlterm/main にはそんなに手の込んだ設定は書いてないはずだがなー,と思いつつ,man mlterm を見ながら当該ファイルを見直した.結果,一番疑わしかったのは col_size_of_width_a=2. でもこれはここに書いてある通りなんだけどなー,と思いつつ,ダメモトで 2 から 1 に変更.…あれ,崩れなくなったよ.ええぇぇぇ〜〜なんだそりゃ.

ということで,ようやく screen を常用できるようになった (今頃かよ).ただ,col_size_of_width_a=1 にしたことで,もしかしたら今度は他のアプリケーションに影響が出るのかもしれない.しばらく様子を見よう.

% apt-show-versions aptitude mlterm screen
aptitude/lenny uptodate 0.4.11.8-1
mlterm/lenny uptodate 2.9.4-4
screen/lenny uptodate 4.0.3-11

デュアルディスプレイ on X (2)

  • 2007年11月 6日 06:10
  • 備忘録

研究室でデュアルディスプレイ環境にしてもう 3/4 年くらい経つ

最近 SuperKaramba の代わりに Conky を使い出して,CPU 使用率やメモリ消費率の高いプロセスをそれとなく監視してたら,X がメモリ容量を最大 1/4 も消費していたことが判明.こりゃやってられん,TwinView を使うようにするか,ということで変更した.

3/4 年前に設定した時は,「TwinView だと例えばウィンドウの最大化が 2 つのディスプレイをまたがった (まさに最大の) サイズになるから使いにくい」と思って避けていたんだけど,実は設定がマズかっただけという事が分かった.Option "TwinView" "true" かつ Option "Xinerama" "false" とすれば良かった.

STL と名前空間

  • 2007年9月 5日 21:26
  • 備忘録

#include <iostream>
#include <algorithm>
#include <iterator>
#include <cstdlib>
#include <cassert>
#include "Vec.h"  // 研究室メンバ共用のライブラリのヘッダファイル

double  EPS = 1.0e-10;  // Vec.h 内で使用する定数
double  DET_EPS = EPS;  // 同上

// 比較演算子 (<)
// (数学的な大小を定義しているわけではない.あくまで <algorithm> 用.)
bool  operator < (const Lab::VecC& lhs, const Lab::VecC& rhs)
{
    assert(lhs.size() == rhs.size());

    if (lhs == rhs)
        return false;

    for (int i = 0; i < lhs.size(); i++)
        if (lhs[i] < rhs[i])
            return true;

    return false;
}

int  main(void)
{
    const Lab::VecC  vectors1[] = {
        Lab::VecC(1,2,3), Lab::VecC(4,5,6), Lab::VecC(7,8,9)
    };
    const Lab::VecC  vectors2[] = {
        Lab::VecC(2,1,3), Lab::VecC(5,6,4), Lab::VecC(8,9,7)
    };

    std::set_union(vectors1, vectors1 + 3, vectors2, vectors2 + 3,
        std::ostream_iterator<Lab::VecC>(std::cout, "  ");

    return EXIT_SUCCESS;
}
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_algo.h: In function '_OutputIterator std::set_union(_InputIterator1, _InputIterator1, _InputIterator2, _InputIterator2, _OutputIterator) [with _InputIterator1 = const Lab::VecC*, _InputIterator2 = const Lab::VecC*, _OutputIterator = std::ostream_iterator<Lab::VecC, char, std::char_traits<char> >]':
main.cc:40:   instantiated from here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_algo.h:4248: error: no match for 'operator<' in '* __first1 < * __first2'
main.cc:40:   instantiated from here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_algo.h:4253: error: no match for 'operator<' in '* __first2 < * __first1'

何でやねん ! ちゃんと bool operator < (const Lab::VecC&, const Lab::VecC&) を定義しとるやんけ ! としばらく頭を抱えてた.

試行錯誤する中で,何とはなしに次のように書き換えた.


namespace Lab
{
    bool  operator < (const VecC& lhs, const VecC& rhs)
    {
        // 同上
    }
}

そしたらコンパイルできた.終わってみれば たったこれだけの事で一体何時間費やしてしまったんだ….疲れた….

prefixed_ostream

  • 2007年6月23日 05:37
  • 備忘録
目的

次のような出力を行いたい.


#include <iostream>
#include <fstream>
#include "prefixed_ostream.h"

int main(void)
{
    prefixed_ostream  warning(std::cerr, "WARNING: ");  // 警告出力用フィルタ
    prefixed_ostream  error(std::cerr, "ERROR: ");      // エラー出力用フィルタ

    warning << "This is a warning message." << std::endl;
    error << "This is a long error message from here...\n"
          << "(snip)\n"
          << "to here." << std::endl;

    std::ofstream     ofs("output.txt");    // 例外処理は省略
    prefixed_ostream  comment(ofs, "# ");   // コメント出力用フィルタ

    ofs << "This is a usual line." << std::endl;
    comment << "This is a comment line." << std::endl;
    ofs << "This is a usual line again." << std::endl;

    return 0;
}

$ ./a.out
WARNING: This is a warning message.
ERROR: This is a long error message from here...
ERROR: (snip)
ERROR: to here.
$ cat output.txt
This is a usual line.
# This is a comment line.
This is a usual line again.
$ 

つまり,指定した文字列を各行の先頭に自動的に付記して出力できるようにしたい.

実現方法

このページで提案されている 「フィルタ」 なる概念を利用する.

実装例

バッファが溢れた場合の処理が不適切なためにセグフォが発生し得る事が判明したので,関数 write_with_prefix() の処理を修正 (及びメンバ is_line_head_ を追加).

極力 1 行単位で出力するように修正.


#if !defined PREFIXED_OSTREAM_H_INCLUDED_
#define PREFIXED_OSTREAM_H_INCLUDED_

#include <streambuf>

/// プレフィックスを付記する出力ストリームクラステンプレート
template <typename CharT, typename Traits = std::char_traits<CharT> >
class basic_prefixed_ostream : public std::basic_ostream<CharT, Traits>
{
public:
    /**
     * @brief コンストラクタ
     * @param [in,out] os          対象とする出力ストリーム
     * @param [in]     prefix      プレフィックス
     * @param [in]     buffer_size バッファのサイズ
     */
    basic_prefixed_ostream(
        std::ostream& os,
        const char* prefix = "# ", std::size_t buffer_size = 1024)
        : std::basic_ostream<CharT, Traits>(
            new streambuf<CharT, Traits>(os, prefix, buffer_size)) {}

    /// デストラクタ
    virtual ~basic_prefixed_ostream()
    {
        this->flush();
        delete this->rdbuf();
    }

protected:
    /// basic_prefixed_ostream 専用のストリームバッファクラステンプレート
    template <class CharT2, class Traits2 = std::char_traits<CharT2> >
    class streambuf : public std::basic_streambuf<CharT2, Traits2>
    {
        typedef CharT2                                      char_type;
        typedef Traits2                                     traits_type;
        typedef typename traits_type::int_type              int_type;
        typedef std::basic_ostream<char_type, traits_type>  ostream_type;

        ostream_type*     os_;           ///< 対象とする出力ストリーム
        const char_type*  prefix_;       ///< プレフィックス
        std::size_t       prefix_size_;  ///< prefix_ の文字列長
        char_type*        buffer_;       ///< バッファ
        std::size_t       buffer_size_;  ///< バッファのサイズ
        char_type*        head_;         ///< 書き出すデータの先頭位置
        bool              is_line_head_; ///< 真の時 prefix_ を出力する

        /// バッファをクリアする
        inline void clear_buffer(void)
        {
            traits_type::assign(buffer_, 0, buffer_size_);
            this->setp(buffer_, buffer_ + buffer_size_);
            head_ = buffer_;
        }

        /**
         * @brief プレフィックスを付記して出力する
         * @param [in] force 真の時バッファの中身を強制的に出力する
         */
        void write_with_prefix(bool force)
        {
            // 改行文字が現れる度に 1 行ずつ出力する
            for (char_type* pos = head_; pos < this->pptr(); pos++)
                if (*pos == '\n')
                {
                    if (is_line_head_)
                        os_->write(prefix_, prefix_size_);
                    os_->write(head_, pos + 1 - head_);
                    head_ = pos + 1;
                    is_line_head_ = true;
                }

            // 改行文字が現れないままバッファの先頭から末尾まで使い切った場合
            // または force が真の時 バッファの中身を強制的に全て出力する
            // force が偽であり かつバッファの先頭の方に余裕がある場合は
            // 詰めるだけにする
            if (head_ != this->pptr() && this->pptr() == this->epptr())
            {
                const std::size_t   length = this->pptr() - head_;
                if (head_ == this->pbase() || force)
                {
                    if (is_line_head_)
                        os_->write(prefix_, prefix_size_);
                    os_->write(head_, length);
                    this->clear_buffer();
                    is_line_head_ = false;
                }
                else
                {
                    char_type   temp[length];
                    traits_type::copy(temp, head_, length);
                    this->clear_buffer();
                    traits_type::copy(head_, temp, length);
                    this->pbump(length);
                }
            }
        }

    public:
        /**
         * @brief コンストラクタ
         * @param [in] os          対象とする出力ストリーム
         * @param [in] prefix      プレフィックス
         * @param [in] buffer_size バッファのサイズ
         */
        streambuf(
            ostream_type& os, const char* prefix, std::size_t buffer_size)
            : os_(&os), prefix_(prefix),
              buffer_(new char_type[buffer_size]),
              buffer_size_(buffer_size), is_line_head_(true)
        {
            prefix_size_ = traits_type::length(prefix_);
            this->clear_buffer();
        }

        /// デストラクタ
        virtual ~streambuf()
        {
            delete [] buffer_;
        }

    protected:
        /// バッファが溢れた時に呼ばれるメンバ関数
        virtual int_type overflow(int_type c = traits_type::eof())
        {
            this->write_with_prefix(false);

            if (c != traits_type::eof())
            {
                *(this->pptr()) = traits_type::to_char_type(c);
                this->pbump(1);
                return traits_type::not_eof(c);
            }
            else
                return traits_type::eof();
        }

        /// 書き出し先とバッファを同期する時などに呼ばれるメンバ関数
        virtual int sync(void)
        {
            this->write_with_prefix(true);
            return 0;
        }
    };
};

// 頻繁に利用されるであろうクラスを予め型定義しておく.(<iosfwd> 参照)
typedef basic_prefixed_ostream<char>  prefixed_ostream;

#endif  // !define PREFIXED_OSTREAM_H_INCLUDED_
備考

以下のコンパイラでのみ動作確認済み.

  • g++ (GCC) 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.0)
  • g++ (GCC) 4.1.2 (Gentoo 4.1.2)
余談

std::basic_streambuf を継承するなんて真似,自力で見出すことは到底不可能だと思うんだけど.

mutt-j と OpenCV の ebuild

  • 2007年6月 3日 20:21
  • 備忘録

勝手に作って勝手に晒しても良いもんなのかねぇ,と思いながら晒してみる.利用は自己責任で.それと 記述ミスなどが見つかったら教えてほしい.


# /usr/local/portage/mypackages/mail-client/mutt-j/mutt-j-1.5.14-r1.ebuild
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

inherit eutils flag-o-matic autotools

MY_PN="mutt"    # PN=mutt-j
MY_P="${MY_PN}-${PV}"
MY_S="${WORKDIR}/${MY_P}"

DESCRIPTION="Mutt Japanese edition"
HOMEPAGE="http://www.emaillab.org/mutt/"
SRC_URI="ftp://ftp.mutt.org/mutt/devel/${MY_P}.tar.gz
    http://www.emaillab.org/mutt/${PV}/patch-${PV}.mutt-j.ja.1.gz"
IUSE="berkdb buffysize cjk crypt debug gdbm gnutls gpgme idn imap mbox nls nntp
pop qdbm sasl smime ssl"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
RDEPEND=">=sys-libs/ncurses-5.2
    qdbm?    ( dev-db/qdbm )
    !qdbm?   (
        gdbm?  ( sys-libs/gdbm )
        !gdbm? ( berkdb? ( >=sys-libs/db-4 ) )
    )
    imap?    (
        gnutls?  ( >=net-libs/gnutls-1.0.17 )
        !gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
        sasl?    ( >=dev-libs/cyrus-sasl-2 )
    )
    pop?     (
        gnutls?  ( >=net-libs/gnutls-1.0.17 )
        !gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
        sasl?    ( >=dev-libs/cyrus-sasl-2 )
    )
    idn?     ( net-dns/libidn )
    gpgme?   ( >=app-crypt/gpgme-0.9.0 )
    smime?   ( >=dev-libs/openssl-0.9.6 )
    app-misc/mime-types"
DEPEND="${RDEPEND}
    net-mail/mailbase"

src_unpack() {
    unpack ${A} && cd ${MY_S} || die "unpack failed"

    epatch "${WORKDIR}"/patch-${PV}.mutt-j.ja.1

    AT_M4DIR="m4" eautoreconf
}

src_compile() {
    declare myconf="
        $(use_enable nls) \
        $(use_enable gpgme) \
        $(use_enable imap) \
        $(use_enable pop) \
        $(use_enable crypt pgp) \
        $(use_enable smime) \
        $(use_enable cjk default-japanese) \
        $(use_enable debug) \
        $(use_with idn) \
        --with-curses \
        --sysconfdir=/etc/${PN} \
        --with-docdir=/usr/share/doc/${PN}-${PVR} \
        --with-regex \
        --disable-fcntl --enable-flock \
        --enable-nfs-fix --enable-external-dotlock \
        --with-mixmaster"

    # See Bug #22787
    unset WANT_AUTOCONF_2_5 WANT_AUTOCONF

    # mutt prioritizes gdbm over bdb, so we will too.
    # hcache feature requires at least one database is in USE.
    if use qdbm; then
        myconf="${myconf} --enable-hcache \
        --with-qdbm --without-gdbm --without-bdb"
    elif use gdbm ; then
        myconf="${myconf} --enable-hcache \
            --without-qdbm --with-gdbm --without-bdb"
    elif use berkdb; then
        myconf="${myconf} --enable-hcache \
            --without-gdbm --without-qdbm --with-bdb"
    else
        myconf="${myconf} --disable-hcache \
            --without-qdbm --without-gdbm --without-bdb"
    fi

    # there's no need for gnutls, ssl or sasl without either pop or imap.
    # in fact mutt's configure will bail if you do:
    #   --without-pop --without-imap --with-ssl
    if use pop || use imap; then
        if use gnutls; then
            myconf="${myconf} --with-gnutls"
        elif use ssl; then
            myconf="${myconf} --with-ssl"
        fi
        # not sure if this should be mutually exclusive with the other two
        myconf="${myconf} $(use_with sasl)"
    else
        myconf="${myconf} --without-gnutls --without-ssl --without-sasl"
    fi

    # See Bug #11170
    case ${ARCH} in
        alpha|ppc) replace-flags "-O[3-9]" "-O2" ;;
    esac

    if use buffysize; then
        ewarn "USE=buffy-size is just a workaround. Disable it if you don't need it."
        myconf="${myconf} --enable-buffy-size"
    fi

    if use mbox; then
        myconf="${myconf} --with-mailpath=/var/spool/mail"
    else
        myconf="${myconf} --with-homespool=Maildir"
    fi

    # rr.compressed patch
    myconf="${myconf} --enable-compressed"

    # nntp patch
    myconf="${myconf} $(use_enable nntp)"

    cd "${MY_S}"
    econf ${myconf} || die "configure failed"
    emake || die "make failed"
}

src_install() {
    cd "${MY_S}"
    make DESTDIR=${D} install || die "install failed"
    find ${D}/usr/share/doc -type f | grep -v "html\|manual" | xargs gzip
    if use mbox; then
        insinto /etc/mutt
        newins ${FILESDIR}/Muttrc.mbox Muttrc
    else
        insinto /etc/mutt
        doins ${FILESDIR}/Muttrc
    fi

    # A newer file is provided by app-misc/mime-types. So we link it.
    rm ${D}/etc/${PN}/mime.types
    dosym /etc/mime.types /etc/${PN}/mime.types

    dodoc BEWARE COPYRIGHT ChangeLog NEWS OPS* PATCHES README* TODO VERSION
}

pkg_postinst() {
    echo
    elog "If you are new to mutt you may want to take a look at"
    elog "the Gentoo QuickStart Guide to Mutt E-Mail:"
    elog "   http://www.gentoo.org/doc/en/guide-to-mutt.xml"
    echo
}

これは /usr/portage/mail-client/mutt-1.5.14.ebuild をほんの少し書き換えただけで,USE フラグとか依存パッケージとかについての検証はほとんどしていない.


# /usr/local/portage/mypackages/sci-libs/opencv/opencv-1.0.0.ebuild
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

inherit eutils toolchain-funcs

DESCRIPTION="Open Source Computer Vision Library"
HOMEPAGE="http://www.intel.com/technology/computing/opencv/"

SRC_URI="http://downloads.sourceforge.net/opencvlibrary/${P}.tar.gz"

IUSE="debug examples ffmpeg gtk ieee1394 python quicktime swig v4l xine"
LICENSE="Intel"
KEYWORDS="~amd64 ~x86"
SLOT="0"

RDEPEND="dev-util/pkgconfig
    media-libs/libpng
    sys-libs/zlib
    media-libs/jpeg
    media-libs/tiff
    media-libs/jasper
    ffmpeg? ( >=media-video/ffmpeg-0.4.9 )
    gtk? ( >=x11-libs/gtk+-2 )
    ieee1394? ( media-libs/libdc1394
        sys-libs/libraw1394 )
    python? ( >=dev-lang/python-2.3 )
    quicktime? ( media-libs/libquicktime )
    swig? ( dev-lang/swig )
    xine? ( media-libs/xine-lib )"
DEPEND="${RDEPEND}"

src_compile() {
    declare myconf="
        $(use_enable debug) \
        $(use_enable examples apps) \
        $(use_with swig) \
        $(use_with python) \
        $(use_with xine) \
        $(use_with ffmpeg) \
        $(use_with ieee1394 1394libs) \
        $(use_with v4l) \
        $(use_with quicktime) \
        $(use_with gtk)"
    econf ${myconf} || die "econf failed"
    emake || die "emake failed"
}

src_test() {
    if use examples ; then
        emake check || die "emake check failed"
    fi
}

src_install() {
    make DESTDIR=${D} install || die "make install failed"
}

これも,./configure のオプションをほぼそのまま USE フラグに反映させただけで,実際に各 USE フラグを有効にして emerge, とかいう検証は行っていない.

さっき気づいたけど,いつの間にか Gentoo 本家の Portage ツリーに acml-3.6.0.ebuild, acml-3.6.1.ebuild が追加されてた.んじゃ以前作った ebuild は用無しになったなぁ.

Gentoo での最近の覚え書き

  • 2007年5月19日 22:51
  • 備忘録
  • tmpwatch (app-admin/tmpwatch) をインストールしないと,/tmp 以下にファイルが蓄積する一方だった.
  • このページを参考にして,Portage のログを残すようにした.
  • 私用ライブラリを消失したのをきっかけに,既存のライブラリを積極的に活用しようかと画策中.とりあえず IT++ (sci-libs/itpp), ACML, ATLAS (sci-libs/blas-atlas, sci-libs/lapack-atlas) をインストールしてみた.ACML を取得するためには登録が必要 (但し無料).まだ使ってはいない.ATLAS (特に blas-atlas) はコンパイル時間がやたら長い….まぁ名称が示すようにそれが当然なんだけども.
  • ATLAS の安定版である 3.6.0 をインストールするためには,GCC 4.x ではなく 3.x を使う必要があった.FORTRAN のコンパイラが GCC 4.x では gfortran, 3.x では g77 であるのが関係している様子.
  • xdvi(k) 俺は app-text/ptex-3.1.8.1_p20050418 に含まれているのを使っている. が DVI ファイルを表示しきる前に落ちるようになった.いつの間に ? と思って調べてたら,どうやら FreeType のバージョンが上がったのが関係しているらしい.2.3.3 から 2.1.10-r3 に downdate (?) したら回避できた.

Continue reading

Next archives

Home> 備忘録アーカイブ

カテゴリ
アーカイブ
購読
Powerd By

Return to page top