changeset 154:d53eadaf497f

add protobuf 2.2.0
author holger
date Mon, 17 Aug 2009 13:25:08 +0200
parents c494760eb51c
children 143d9700af31
files dev-libs/protobuf/Manifest dev-libs/protobuf/files/70protobuf-gentoo.el dev-libs/protobuf/files/protobuf-2.0.3-decoder_test_64bit_fix.patch dev-libs/protobuf/files/protobuf-2.1.0-fix-emacs-byte-compile.patch dev-libs/protobuf/protobuf-2.2.0.ebuild
diffstat 5 files changed, 137 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev-libs/protobuf/Manifest	Mon Aug 17 13:25:08 2009 +0200
@@ -0,0 +1,6 @@
+AUX 70protobuf-gentoo.el 170 RMD160 f6208c9a555325c1a6e1b26daee6fbc425cbfd98 SHA1 8f8f8ce9bdab9a8f9a11b16236be383488277cb3 SHA256 b6e5c2f11a63f9eb4a9382227ce8f41bfcf23213166d2fb212e21e237b2f264d
+AUX protobuf-2.0.3-decoder_test_64bit_fix.patch 935 RMD160 71b217978e1ae97e0db49292be3d325483990d03 SHA1 1c7704958ce43e958a59852eb7c71ebec092fd8d SHA256 c836602d5f0c4686122c07312892b42e8dc20c8517d8a89ff41924c0872be4b0
+AUX protobuf-2.1.0-fix-emacs-byte-compile.patch 653 RMD160 64580c8aeb0d7656096367eabb3debd4e1410d98 SHA1 78e12dbde5e8581748dac5953dd398aa7a1b6d2e SHA256 74f0fd6978eda88cfea02f3ab5b451e5400ba154f0e3443fee20a3f338af2eed
+AUX protobuf-2.2.0-fix-emacs-byte-compile.patch 653 RMD160 64580c8aeb0d7656096367eabb3debd4e1410d98 SHA1 78e12dbde5e8581748dac5953dd398aa7a1b6d2e SHA256 74f0fd6978eda88cfea02f3ab5b451e5400ba154f0e3443fee20a3f338af2eed
+DIST protobuf-2.2.0.tar.bz2 1350084 RMD160 724482bceb2dfe45927dc1061fb1b7ee79c4527e SHA1 a0aff9df8dc93c5337553d586bbe726808d342a6 SHA256 731dfb6b19e0bbc4e20fcc4d2cc317d8acb4203bc611e4247684bae8403c724b
+EBUILD protobuf-2.2.0.ebuild 2343 RMD160 9e4315fa1f72ac413cb35e74c93497a7b8ed6d88 SHA1 a1d299408f32cba3652b4118b7c5cb03b77a2ecc SHA256 0cc39313c78b45fb67c54970b22442ed69302ce2f93f993dabbf7fcc74c6c1b0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev-libs/protobuf/files/70protobuf-gentoo.el	Mon Aug 17 13:25:08 2009 +0200
@@ -0,0 +1,3 @@
+(add-to-list 'load-path "@SITELISP@")
+(add-to-list 'auto-mode-alist '("\\.proto\\'" . protobuf-mode))
+(autoload 'protobuf-mode "protobuf-mode" "Google protobuf mode." t)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev-libs/protobuf/files/protobuf-2.0.3-decoder_test_64bit_fix.patch	Mon Aug 17 13:25:08 2009 +0200
@@ -0,0 +1,17 @@
+diff -Naurp protobuf-2.0.3-orig/python/google/protobuf/internal/decoder_test.py protobuf-2.0.3/python/google/protobuf/internal/decoder_test.py
+--- protobuf-2.0.3-orig/python/google/protobuf/internal/decoder_test.py	2008-12-05 19:07:15.000000000 +0100
++++ protobuf-2.0.3/python/google/protobuf/internal/decoder_test.py	2008-12-06 22:11:48.000000000 +0100
+@@ -106,6 +106,13 @@ class DecoderTest(unittest.TestCase):
+     self.mox.ReplayAll()
+     result = decoder_method(d)
+     self.assertEqual(expected_result, result)
++    # HACK: Convert all ints to longs so that different behavior
++    # between 32-bit and 64-bit systems does not impact the result
++    # of the test.
++    if isinstance(result, int):
++      result = long(result)
++    if isinstance(expected_result, int):
++      expected_result = long(expected_result)
+     self.assert_(isinstance(result, type(expected_result)))
+     self.mox.VerifyAll()
+     self.mox.ResetAll()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev-libs/protobuf/files/protobuf-2.1.0-fix-emacs-byte-compile.patch	Mon Aug 17 13:25:08 2009 +0200
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/271007
+Fix error with byte-compilation in Emacs.
+
+--- protobuf-2.1.0-orig/editors/protobuf-mode.el	2009-05-13 22:36:40.000000000 +0200
++++ protobuf-2.1.0/editors/protobuf-mode.el	2009-05-24 13:37:04.000000000 +0200
+@@ -71,7 +71,8 @@
+ 
+ ;; This mode does not inherit properties from other modes. So, we do not use 
+ ;; the usual `c-add-language' function.
+-(put 'protobuf-mode 'c-mode-prefix "protobuf-")
++(eval-and-compile
++  (put 'protobuf-mode 'c-mode-prefix "protobuf-"))
+ 
+ ;; The following code uses of the `c-lang-defconst' macro define syntactic
+ ;; features of protocol buffer language.  Refer to the documentation in the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dev-libs/protobuf/protobuf-2.2.0.ebuild	Mon Aug 17 13:25:08 2009 +0200
@@ -0,0 +1,96 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/protobuf/protobuf-2.1.0.ebuild,v 1.3 2009/05/24 22:32:50 nelchael Exp $
+
+EAPI="2"
+
+JAVA_PKG_IUSE="source"
+
+inherit eutils distutils python java-pkg-opt-2 elisp-common
+
+DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
+HOMEPAGE="http://code.google.com/p/protobuf/"
+SRC_URI="http://protobuf.googlecode.com/files/${PF}.tar.bz2"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="emacs examples java python vim-syntax"
+
+DEPEND="${DEPEND} java? ( >=virtual/jdk-1.5 )
+	python? ( dev-python/setuptools )
+	emacs? ( virtual/emacs )"
+RDEPEND="${RDEPEND} java? ( >=virtual/jre-1.5 )
+	emacs? ( virtual/emacs )"
+
+src_prepare() {
+	epatch "${FILESDIR}/${PN}-2.0.3-decoder_test_64bit_fix.patch"
+	epatch "${FILESDIR}/${PN}-2.1.0-fix-emacs-byte-compile.patch"
+}
+
+src_compile() {
+	emake || die
+
+	if use python; then
+		cd python; distutils_src_compile; cd ..
+	fi
+
+	if use java; then
+		src/protoc --java_out=java/src/main/java --proto_path=src src/google/protobuf/descriptor.proto
+		mkdir java/build
+		pushd java/src/main/java
+		ejavac -d ../../../build $(find . -name '*.java') || die "java compilation failed"
+		popd
+		jar cf "${PN}.jar" -C java/build . || die "jar failed"
+	fi
+
+	if use emacs; then
+		elisp-compile "${S}/editors/protobuf-mode.el" || die "elisp-compile failed!"
+	fi
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+	dodoc CHANGES.txt CONTRIBUTORS.txt README.txt
+
+	if use python; then
+		cd python; distutils_src_install; cd ..
+	fi
+
+	if use vim-syntax; then
+		insinto /usr/share/vim/vimfiles/syntax
+		doins editors/proto.vim
+	fi
+
+	if use emacs; then
+		elisp-install ${PN} editors/protobuf-mode.el* || die "elisp-install failed!"
+		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+	fi
+
+	if use examples; then
+		insinto /usr/share/doc/${PF}/examples
+		doins -r examples/* || die "doins examples failed"
+	fi
+
+	if use java; then
+		java-pkg_dojar ${PN}.jar
+		use source && java-pkg_dosrc java/src/main/java/*
+	fi
+}
+
+src_test() {
+	emake check
+
+	if use python; then
+		 cd python; ${python} setup.py test || die "python test failed"
+		 cd ..
+	fi
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}