diff options
author | Marshall Brewer (Gentoo Key) <tomboy64@sina.cn> | 2016-04-18 13:55:46 +0200 |
---|---|---|
committer | Ian Delaney <idella4@gentoo.org> | 2016-04-21 17:51:59 +0800 |
commit | 6813ebdd2f046d258f3e96339d313517f3d98c1c (patch) | |
tree | 9cd53641e057ae061af6896190f548b43448bb98 /dev-java | |
parent | f47f7012a3efc785a9672d5197ed16f4038a0291 (diff) | |
download | gentoo-6813ebdd2f046d258f3e96339d313517f3d98c1c.tar.gz gentoo-6813ebdd2f046d258f3e96339d313517f3d98c1c.tar.xz |
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>
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/protobuf-java/Manifest | 1 | ||||
-rw-r--r-- | dev-java/protobuf-java/metadata.xml | 27 | ||||
-rw-r--r-- | dev-java/protobuf-java/protobuf-java-3.0.0_beta2.ebuild | 67 |
3 files changed, 95 insertions, 0 deletions
diff --git a/dev-java/protobuf-java/Manifest b/dev-java/protobuf-java/Manifest new file mode 100644 index 00000000000..ba9743b769c --- /dev/null +++ b/dev-java/protobuf-java/Manifest @@ -0,0 +1 @@ +DIST protobuf-3.0.0_beta2.tar.gz 3333054 SHA256 be224d07ce87f12e362cff3df02851107bf92a4e4604349b1d7a4b1f0c3bfd86 SHA512 3a9329603226dabeaae7c28eb7463fb4403383e7774d53742e9e38a0426f5ef370803c68e4d4bc0d37585618fb340befe4f812731db0984b12032c3d931cdca7 WHIRLPOOL 0e77105c24d71c0269f4375ebfaef38175d762e1a90cdd81f594c13bbece9f390ada9291f722e8e0227952a1f5cd94976037f069b86703c7a3a37a9277cb66f8 diff --git a/dev-java/protobuf-java/metadata.xml b/dev-java/protobuf-java/metadata.xml new file mode 100644 index 00000000000..7106f60f89b --- /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_beta2.ebuild b/dev-java/protobuf-java/protobuf-java-3.0.0_beta2.ebuild new file mode 100644 index 00000000000..b747b75a48e --- /dev/null +++ b/dev-java/protobuf-java/protobuf-java-3.0.0_beta2.ebuild @@ -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 +} |