summaryrefslogtreecommitdiff
path: root/dev-java/protobuf-java
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-java/protobuf-java
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-java/protobuf-java')
-rw-r--r--dev-java/protobuf-java/Manifest12
-rw-r--r--dev-java/protobuf-java/metadata.xml27
-rw-r--r--dev-java/protobuf-java/protobuf-java-3.0.0_beta3_p1.ebuild67
-rw-r--r--dev-java/protobuf-java/protobuf-java-3.0.2.ebuild68
-rw-r--r--dev-java/protobuf-java/protobuf-java-3.1.0.ebuild68
-rw-r--r--dev-java/protobuf-java/protobuf-java-3.3.0.ebuild68
-rw-r--r--dev-java/protobuf-java/protobuf-java-3.4.1.ebuild66
7 files changed, 376 insertions, 0 deletions
diff --git a/dev-java/protobuf-java/Manifest b/dev-java/protobuf-java/Manifest
new file mode 100644
index 000000000000..8a1206988c35
--- /dev/null
+++ b/dev-java/protobuf-java/Manifest
@@ -0,0 +1,12 @@
+DIST protobuf-3.0.0_beta3_p1.tar.gz 3673779 SHA256 494726c9a6a45a20cd085795a26e4f05627e9b3b1fa5ab21a8b0edc5db8173dc SHA512 bebe655ffa6f8dd9bfbf4d2fcce160de6d45f50fd802b8907833cde3f232b7b44186d06fe9cc01ed5dc7b4a040fd3069e2ec7d2704da596e8d3af80f8dba7e8b WHIRLPOOL d35dca8e402741e4d30c9c787f5927c7fe7f22619ddb3ca20d302c27fbeb929cecd55cc7e6785b28acb76c89893d2baf7fce3f685a3f186006e1e30a2901ae1b
+DIST protobuf-3.0.2.tar.gz 3917853 SHA256 b700647e11556b643ccddffd1f41d8cb7704ed02090af54cc517d44d912d11c1 SHA512 28eb8814555b0fe2cd57da6caf46802697a9612fccb3bba3ae7a379352437f81a18c1f6ab7242a22abea59c1ff9b06dcb6e2b52a97aa1a15cea6485ffc3c10c2 WHIRLPOOL 5c70def13be5e61d9405a24fdfc1efe9caee0b63c87f74e12f3d121801ecdc410e142eab80d8d4b49ebfe0c4f3cd13b2d77a17ec303978fec317265991a1f5a8
+DIST protobuf-3.1.0.tar.gz 4051503 SHA256 0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7 SHA512 8d3289a16944c255bd1cceab696e515e52467f2bfe1cc10f6b32fabdf082d5acdc248ec9cadc572223a24d04d431f75921076153109cea2f90ee533f502ab47a WHIRLPOOL b8a0bee9ff549c8da45c2b56b12aafbed5807959cdb11b3888a0f30fd0d6df83a72f3c6ef9e266522754b8901792f65235a6e81a8b0f74cee15d59ecbe6dee68
+DIST protobuf-3.3.0.tar.gz 4336596 SHA256 94c414775f275d876e5e0e4a276527d155ab2d0da45eed6b7734301c330be36e SHA512 0734a55ae92f0539dfb507e174539d290fd8e93633c1edd8810e0d51c37e67254337b75fc5ba9450316f6416e1f8f8cfb59415864657b55f2a1696fbcdfe7636 WHIRLPOOL 4c18120ad784234ebb5308c0f3a2f3814d77f2fc906407f48285f3ba8f84af8e15defa4e7edf2d2e77cf22316df338b3f5bc0c6ca11c7a4fb951105c3aa7d7d4
+DIST protobuf-3.4.1.tar.gz 4490100 SHA256 8e0236242106e680b4f9f576cc44b8cd711e948b20a9fc07769b0a20ceab9cc4 SHA512 471e52198fa878a79183dc8fbc39d9c65239be4d9dff799e12281ee9b1af61a427584534b1baae1773bc6e4c86467f89ca2e7911a21effd86bc5f40cc7d94c34 WHIRLPOOL c53dc76155bcfeee11720b08c7d508a35274f2387d6f8a61149565bc72d5539ad598600ad692f01ac7a0ea102d66659f4d516f994c419c56c4420ce69659646b
+EBUILD protobuf-java-3.0.0_beta3_p1.ebuild 2137 SHA256 ff52077a55be635598ffa0244bc6465811047c156cdaa85461946627fd25b030 SHA512 dab6d0ae27b18777a305d0921757acb92727d17fce7d8c17eeff1cc09298f85f3fa6f39bb51bd6a531b462060fecf20d691e417ec33cd181f0bbda665baf8e3b WHIRLPOOL 4d6e2769725050f3227845cd9be9b8b6265719256cad67588310ec8686612c02cc0eaf0300271538a5e89ba56a7877edab0bae94f3305215e466fac420ae4ee8
+EBUILD protobuf-java-3.0.2.ebuild 2150 SHA256 bbdc681d2580ec7e523c17f7e80d265c612dfc379bf098470c657b0e5a7fe356 SHA512 a8b0ad7f72a64e9fe13ff7a8b64f04660f16865c35f6af6c58f81c1b2b13aa5388135685e6a506dc1c0a5edc8c6a8ec6968735d1c8710f3ad6acb8cb2c95286b WHIRLPOOL bd5a27f6a144e2f3e6cbcdc2ad0ba5d5b3fd19e67a71ce2fb9601bfc3c41a369029b185ce5a517d48aa14d07bd030b37aa5e12e4bcbc2f3e3b525cfd4a36dda9
+EBUILD protobuf-java-3.1.0.ebuild 2149 SHA256 814ebdaa7cb1add9a5d4590b2302d52b0961fcd3bea4e38bc8c0ec873b962b71 SHA512 4d01e00433eccc3b3e6dd084775851e54365a1822cac12f3fc324e6112a6b399a42ef057f3d40504a2ac7ea954eaa6e520023c048b36196d46e7073fc98d542b WHIRLPOOL 66596e62f7b2a5bdd8ea14263ac9f89c276a52cb5c2f2b01c4ab09584c7d7d91076e7c7562c605667fde786043d113923583359eab54dae26d7d76b56963d51e
+EBUILD protobuf-java-3.3.0.ebuild 2153 SHA256 1af7de8052fac27212cea0684102933933e62d651b59ac23f0a89a643d9d841e SHA512 1895a3f22215ce2cf3c57fcdc94375f3e18801499ff51ca1374ff2af15b821e8207b3c50267b4f9748aca5ddb85106c087e692120a2bec3e7c315f5ae942ddb2 WHIRLPOOL ad2d936dc040889dc1ef34895e27e9c901cde4f57123647d4dc0e76efa4805abc55dc8b9ec622b741e30570e77e19914828f28bf1e5e81f930b2c07789ea2856
+EBUILD protobuf-java-3.4.1.ebuild 2094 SHA256 2c8617d7f1875595e81982e99a1a73ab16128944a90e05c05d0108e74532a05e SHA512 c2646fff280006c14db9fc3fca89375137723d7fe3001b7a76825963af5e822cadc32e99fe66540f6471f99757800158a04bb0607169f17b970763c33333e38c WHIRLPOOL e349a91906f713c0ab76bfda310bf5d55b8605fbe87d800c90f559d191f364e92283ea281cc57173d054c3effa75de9acdba246bf3fdaec1abe915c9baf52959
+MISC ChangeLog 1584 SHA256 d066f866c7ebdc89f317a03456ad0203af36e258f9f1873f1a955c5ab06d7269 SHA512 01e7f00bc845445595ddd5598b3a8ebb7eb9abc7ee2acdebeb8585312c7bfc8223fc6e1b375d634144f5641cbf6fedb8f6fa60372c4dac081015044ea5e375c2 WHIRLPOOL bc85f5691b76674ca88b3b9c23bfe187a73d61c6278fb23966e10590c0d75ce13fef98cbd90a8dc992e45922953971dc1ac1eae5065966bbe0d56cb5b8aa79fd
+MISC metadata.xml 830 SHA256 175c08bf011a802d7042b94a00f5873d44696f1198dc9790b5402f708a0e7b01 SHA512 c3bb9123a6a8cd46290cfff426b3305970eab0faaccc367526d9f888a590f2cb3e7d628e7bcbbfdf8862761906b037d450a271c8ae5cb2edcd5ab8d572d43cee WHIRLPOOL 12c6481e617017fcec11ba6c79a7da13894d25e0a414f78933aef036e9706d252ebb3504b08fa86c6f4dd9888763de015c9ca4f83cf3edebd93180fd238d7b72
diff --git a/dev-java/protobuf-java/metadata.xml b/dev-java/protobuf-java/metadata.xml
new file mode 100644
index 000000000000..7106f60f89b5
--- /dev/null
+++ b/dev-java/protobuf-java/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+<maintainer type='person'>
+ <email>vapier@gentoo.org</email>
+</maintainer>
+<maintainer type='person'>
+ <email>tomboy64@sina.cn</email>
+</maintainer>
+<maintainer type='project'>
+ <email>java@gentoo.org</email>
+ <name>Gentoo Java Project</name>
+</maintainer>
+<maintainer type='project'>
+ <email>proxy-maint@gentoo.org</email>
+ <name>Gentoo Proxy Maintainers Project</name>
+</maintainer>
+<use>
+ <flag name="nano">Enable code generator and runtime library designed specifically for resource-constrained systems, like Android</flag>
+</use>
+<slots>
+ <subslots>soname major version number of protobuf</subslots>
+</slots>
+<upstream>
+ <remote-id type='github'>google/protobuf</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/dev-java/protobuf-java/protobuf-java-3.0.0_beta3_p1.ebuild b/dev-java/protobuf-java/protobuf-java-3.0.0_beta3_p1.ebuild
new file mode 100644
index 000000000000..605460511993
--- /dev/null
+++ b/dev-java/protobuf-java/protobuf-java-3.0.0_beta3_p1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-pkg-simple
+
+MY_PV=${PV/_beta/-beta-}
+MY_PV=${MY_PV/_p/.}
+
+DESCRIPTION="Google's Protocol Buffers - official Java Bindings"
+HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
+SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> protobuf-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/10b3"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sh ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="nano"
+
+# Protobuf is only a build-time dep, but depend on the exact same version
+# (excluding revision), since we are using the same tarball.
+# But probably same subslot is sufficient.
+DEPEND=">=virtual/jdk-1.7
+ >=dev-libs/protobuf-3"
+RDEPEND=">=virtual/jre-1.7
+ !<dev-libs/protobuf-3[java(-)]"
+S="${WORKDIR}/protobuf-${MY_PV}"
+
+src_prepare() {
+ epatch_user
+ java-pkg-2_src_prepare
+}
+
+src_compile() {
+ pushd "${S}/java" >/dev/null || die
+ einfo "Compiling Java library ..."
+ /usr/bin/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ JAVA_JAR_FILENAME="protobuf.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ if use nano; then
+ einfo "Compiling Java Nano library ..."
+ pushd "${S}/javanano" >/dev/null || die
+ /usr/bin/protoc --java_out=src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/javanano/src/main/java"
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/java/core/src/main/java/"
+ JAVA_JAR_FILENAME="protobuf-nano.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ fi
+}
+
+src_install() {
+ JAVA_JAR_FILENAME="${S}/java/protobuf.jar"
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ if use nano; then
+ JAVA_JAR_FILENAME="${JAVA_JAR_FILENAME} ${S}/javanano/protobuf-nano.jar"
+ JAVA_SRC_DIR="${JAVA_SRC_DIR} ${S}/javanano/src/main/java"
+ fi
+ mv "${S}/java/target" . || die
+ if use nano; then
+ cp -Rvf "${S}/javanano/target" . || die
+ fi
+ java-pkg-simple_src_install
+}
diff --git a/dev-java/protobuf-java/protobuf-java-3.0.2.ebuild b/dev-java/protobuf-java/protobuf-java-3.0.2.ebuild
new file mode 100644
index 000000000000..f774a37f4ff3
--- /dev/null
+++ b/dev-java/protobuf-java/protobuf-java-3.0.2.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-pkg-simple
+
+MY_PV=${PV/_beta/-beta-}
+MY_PV=${MY_PV/_p/.}
+
+DESCRIPTION="Google's Protocol Buffers - official Java Bindings"
+HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
+SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> protobuf-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/10"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sh ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="nano"
+
+# Protobuf is only a build-time dep, but depends on the exact same version
+# (excluding revision), since we are using the same tarball.
+# But probably same subslot is sufficient.
+DEPEND=">=virtual/jdk-1.7
+ >=dev-libs/protobuf-3"
+
+RDEPEND=">=virtual/jre-1.7
+ !<dev-libs/protobuf-3[java(-)]"
+
+S="${WORKDIR}/protobuf-${MY_PV}"
+src_prepare() {
+ default
+ java-pkg-2_src_prepare
+}
+
+src_compile() {
+ pushd "${S}/java" >/dev/null || die
+ einfo "Compiling Java library ..."
+ "${EPREFIX}"/usr/bin/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ JAVA_JAR_FILENAME="protobuf.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ if use nano; then
+ einfo "Compiling Java Nano library ..."
+ pushd "${S}/javanano" >/dev/null || die
+ "${EPREFIX}"/usr/bin/protoc --java_out=src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/javanano/src/main/java"
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/java/core/src/main/java/"
+ JAVA_JAR_FILENAME="protobuf-nano.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ fi
+}
+
+src_install() {
+ JAVA_JAR_FILENAME="${S}/java/protobuf.jar"
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ if use nano; then
+ JAVA_JAR_FILENAME="${JAVA_JAR_FILENAME} ${S}/javanano/protobuf-nano.jar"
+ JAVA_SRC_DIR="${JAVA_SRC_DIR} ${S}/javanano/src/main/java"
+ fi
+ mv "${S}/java/target" . || die
+ if use nano; then
+ cp -Rvf "${S}/javanano/target" . || die
+ fi
+ java-pkg-simple_src_install
+}
diff --git a/dev-java/protobuf-java/protobuf-java-3.1.0.ebuild b/dev-java/protobuf-java/protobuf-java-3.1.0.ebuild
new file mode 100644
index 000000000000..c864a4a94932
--- /dev/null
+++ b/dev-java/protobuf-java/protobuf-java-3.1.0.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-pkg-simple
+
+MY_PV=${PV/_beta/-beta-}
+MY_PV=${MY_PV/_p/.}
+
+DESCRIPTION="Google's Protocol Buffers - official Java Bindings"
+HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
+SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> protobuf-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/11"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sh x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="nano"
+
+# Protobuf is only a build-time dep, but depends on the exact same version
+# (excluding revision), since we are using the same tarball.
+# But probably same subslot is sufficient.
+DEPEND=">=virtual/jdk-1.7
+ >=dev-libs/protobuf-3"
+
+RDEPEND=">=virtual/jre-1.7
+ !<dev-libs/protobuf-3[java(-)]"
+
+S="${WORKDIR}/protobuf-${MY_PV}"
+src_prepare() {
+ default
+ java-pkg-2_src_prepare
+}
+
+src_compile() {
+ pushd "${S}/java" >/dev/null || die
+ einfo "Compiling Java library ..."
+ "${EPREFIX}"/usr/bin/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ JAVA_JAR_FILENAME="protobuf.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ if use nano; then
+ einfo "Compiling Java Nano library ..."
+ pushd "${S}/javanano" >/dev/null || die
+ "${EPREFIX}"/usr/bin/protoc --java_out=src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/javanano/src/main/java"
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/java/core/src/main/java/"
+ JAVA_JAR_FILENAME="protobuf-nano.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ fi
+}
+
+src_install() {
+ JAVA_JAR_FILENAME="${S}/java/protobuf.jar"
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ if use nano; then
+ JAVA_JAR_FILENAME="${JAVA_JAR_FILENAME} ${S}/javanano/protobuf-nano.jar"
+ JAVA_SRC_DIR="${JAVA_SRC_DIR} ${S}/javanano/src/main/java"
+ fi
+ mv "${S}/java/target" . || die
+ if use nano; then
+ cp -Rvf "${S}/javanano/target" . || die
+ fi
+ java-pkg-simple_src_install
+}
diff --git a/dev-java/protobuf-java/protobuf-java-3.3.0.ebuild b/dev-java/protobuf-java/protobuf-java-3.3.0.ebuild
new file mode 100644
index 000000000000..31b8a5d0896a
--- /dev/null
+++ b/dev-java/protobuf-java/protobuf-java-3.3.0.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-pkg-simple
+
+MY_PV=${PV/_beta/-beta-}
+MY_PV=${MY_PV/_p/.}
+
+DESCRIPTION="Google's Protocol Buffers - official Java Bindings"
+HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
+SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> protobuf-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/13"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sh ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="nano"
+
+# Protobuf is only a build-time dep, but depends on the exact same version
+# (excluding revision), since we are using the same tarball.
+# But probably same subslot is sufficient.
+DEPEND=">=virtual/jdk-1.7
+ ~dev-libs/protobuf-${PV}"
+
+RDEPEND=">=virtual/jre-1.7
+ !<dev-libs/protobuf-3[java(-)]"
+
+S="${WORKDIR}/protobuf-${MY_PV}"
+src_prepare() {
+ default
+ java-pkg-2_src_prepare
+}
+
+src_compile() {
+ pushd "${S}/java" >/dev/null || die
+ einfo "Compiling Java library ..."
+ "${EPREFIX}"/usr/bin/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ JAVA_JAR_FILENAME="protobuf.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ if use nano; then
+ einfo "Compiling Java Nano library ..."
+ pushd "${S}/javanano" >/dev/null || die
+ "${EPREFIX}"/usr/bin/protoc --java_out=src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/javanano/src/main/java"
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/java/core/src/main/java/"
+ JAVA_JAR_FILENAME="protobuf-nano.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ fi
+}
+
+src_install() {
+ JAVA_JAR_FILENAME="${S}/java/protobuf.jar"
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ if use nano; then
+ JAVA_JAR_FILENAME="${JAVA_JAR_FILENAME} ${S}/javanano/protobuf-nano.jar"
+ JAVA_SRC_DIR="${JAVA_SRC_DIR} ${S}/javanano/src/main/java"
+ fi
+ mv "${S}/java/target" . || die
+ if use nano; then
+ cp -Rvf "${S}/javanano/target" . || die
+ fi
+ java-pkg-simple_src_install
+}
diff --git a/dev-java/protobuf-java/protobuf-java-3.4.1.ebuild b/dev-java/protobuf-java/protobuf-java-3.4.1.ebuild
new file mode 100644
index 000000000000..1480aad8f919
--- /dev/null
+++ b/dev-java/protobuf-java/protobuf-java-3.4.1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="Google's Protocol Buffers - Java bindings"
+HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/google/protobuf"
+SRC_URI="https://github.com/google/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/14"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sh ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="nano"
+
+# Protobuf is only a build-time dep, but depends on the exact same version
+# (excluding revision), since we are using the same tarball.
+# But probably same subslot is sufficient.
+DEPEND=">=virtual/jdk-1.7
+ ~dev-libs/protobuf-${PV}"
+
+RDEPEND=">=virtual/jre-1.7
+ !<dev-libs/protobuf-3[java(-)]"
+
+S="${WORKDIR}/protobuf-${PV}"
+
+src_prepare() {
+ default
+ java-pkg-2_src_prepare
+}
+
+src_compile() {
+ pushd "${S}/java" >/dev/null || die
+ einfo "Compiling Java library ..."
+ "${EPREFIX}"/usr/bin/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ JAVA_JAR_FILENAME="protobuf.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ if use nano; then
+ einfo "Compiling Java Nano library ..."
+ pushd "${S}/javanano" >/dev/null || die
+ "${EPREFIX}"/usr/bin/protoc --java_out=src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
+ JAVA_SRC_DIR="${S}/javanano/src/main/java"
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/java/core/src/main/java/"
+ JAVA_JAR_FILENAME="protobuf-nano.jar"
+ java-pkg-simple_src_compile
+ popd >/dev/null || die
+ fi
+}
+
+src_install() {
+ JAVA_JAR_FILENAME="${S}/java/protobuf.jar"
+ JAVA_SRC_DIR="${S}/java/core/src/main/java"
+ if use nano; then
+ JAVA_JAR_FILENAME="${JAVA_JAR_FILENAME} ${S}/javanano/protobuf-nano.jar"
+ JAVA_SRC_DIR="${JAVA_SRC_DIR} ${S}/javanano/src/main/java"
+ fi
+ mv "${S}/java/target" . || die
+ if use nano; then
+ cp -Rvf "${S}/javanano/target" . || die
+ fi
+ java-pkg-simple_src_install
+}