試験運用中なLinux備忘録・旧記事

はてなダイアリーで公開していた2007年5月-2015年3月の記事を保存しています。

Hotwire 0.710向けにebuildを調整

前回(0.700)からの変更点は

  • hotwire/state.pyのimport文が変わったために前回のパッチが当たらなくなったのに対処
  • hotwire_ui/scripts.pyへの修正が無くなった

のみ。
用意するのは
ファイル名: hotwire-0.710-pysqlite2-with-python25.patch

--- hotwire-0.710/hotwire/state.py.orig
+++ hotwire-0.710/hotwire/state.py
@@ -20,10 +20,7 @@
 # THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 import os,sys,logging,time,datetime,threading
-if sys.version_info[0] < 2 or sys.version_info[1] < 5:
-    from pysqlite2 import dbapi2 as sqlite3
-else:    
-    import sqlite3
+from pysqlite2 import dbapi2 as sqlite3
 
 import gobject
 

と、下のebuildファイルの2つ。
ファイル名: hotwire-0.710.ebuild

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit distutils gnome2-utils

DESCRIPTION="An intelligent hybrid text/graphical shell for developers and system administrators"
HOMEPAGE="http://code.google.com/p/hotwire-shell/"
SRC_URI="http://hotwire-shell.googlecode.com/files/${P}.zip"

LICENSE="GPL-2 MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="pysqlite +sourceview"

RDEPEND="dev-python/pygtk
	dev-python/dbus-python
	x11-libs/vte
	sourceview? ( || (
		dev-python/pygtksourceview
		dev-python/gnome-python-desktop ) )
	pysqlite? ( =dev-python/pysqlite-2* )
	!pysqlite? ( >=dev-lang/python-2.5 )"
DEPEND="dev-util/intltool"

pkg_setup() {
	if use !pysqlite && ! built_with_use dev-lang/python sqlite; then
		eerror
		eerror "Hotwire requires Python 2.5 with sqlite3 support or pysqlite2"
		eerror
		die "Please re-merge >=dev-lang/python-2.5 with USE=sqlite or enable \"pysqlite\" USE flag"
	fi
	if ! built_with_use x11-libs/vte python; then
		eerror
		eerror "Hotwire requires VTE with Python support"
		eerror
		die "Please re-merge x11-libs/vte with USE=python"
	fi
}

src_unpack() {
	distutils_src_unpack
	distutils_python_version
	if use pysqlite && [[ ${PYVER_MINOR} -ge 5 ]]; then
		epatch "${FILESDIR}/${P}-pysqlite2-with-python25.patch" || die "epatch failed"
	fi
}

src_install() {
	DOCS="COPYING COPYING.API COPYING.UI"
	distutils_src_install
}

pkg_postinst() {
	distutils_python_version
	python_mod_optimize \
		"${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/hotwire" \
		"${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/hotwire_ui" \
		"${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/hotapps" \
		"${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/hotvte"
	gnome2_icon_cache_update
}

pkg_postrm() {
	distutils_python_version
	python_mod_cleanup
	gnome2_icon_cache_update
}

(2008/3/25)python_mod_optimize()の引数のディレクトリにhotappshotvteが含まれていなかったため修正、更に、「sourceview」USEフラグを既定で有効にした
今後は記事には貼り付けず、下のURLにアップロードする。
http://cid-3f9be5b1cd4a806c.skydrive.live.com/browse.aspx/%e5%85%ac%e9%96%8b/Gentoo%20Linux%20ebuild/app-shells/hotwire

関連URL: