dev-java/protobuf-java: initial version, 3.0.0_beta2

- outsourced java implementation of dev-libs/protobuf
- enabled java nano implementation

Package-Manager: portage-2.2.28
RepoMan-Options: --ignore-arches
Closes: https://github.com/gentoo/gentoo/pull/1295

Signed-off-by: Ian Delaney <idella4@gentoo.org>
This commit is contained in:
Marshall Brewer (Gentoo Key)
2016-04-18 13:55:46 +02:00
committed by Ian Delaney
parent f47f7012a3
commit 6813ebdd2f
3 changed files with 95 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST protobuf-3.0.0_beta2.tar.gz 3333054 SHA256 be224d07ce87f12e362cff3df02851107bf92a4e4604349b1d7a4b1f0c3bfd86 SHA512 3a9329603226dabeaae7c28eb7463fb4403383e7774d53742e9e38a0426f5ef370803c68e4d4bc0d37585618fb340befe4f812731db0984b12032c3d931cdca7 WHIRLPOOL 0e77105c24d71c0269f4375ebfaef38175d762e1a90cdd81f594c13bbece9f390ada9291f722e8e0227952a1f5cd94976037f069b86703c7a3a37a9277cb66f8

View File

@@ -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>

View File

@@ -0,0 +1,67 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
JAVA_PKG_IUSE="doc source"
inherit java-pkg-2 java-pkg-simple
MY_PV=${PV/_beta2/-beta-2}
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="Apache-2.0"
SLOT="0/10"
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~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.5
>=dev-libs/protobuf-3"
RDEPEND=">=virtual/jre-1.5
!<dev-libs/protobuf-3[java(-)]"
S="${WORKDIR}/protobuf-${MY_PV}"
src_prepare() {
eapply_user
java-pkg-2_src_prepare
}
src_compile() {
pushd "${S}/java" >/dev/null || die
einfo "Compiling Java library ..."
/usr/bin/protoc --java_out=src/main/java -I../src ../src/google/protobuf/descriptor.proto || die
JAVA_SRC_DIR="${S}/java/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/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/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
}