Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf-c/files/, dev-libs/protobuf-c/
Date: Sat, 30 Sep 2017 22:20:23
Message-Id: 1506810010.48115d81ccd1ae02c2386871cf1a759e0a27eede.whissi@gentoo
1 commit: 48115d81ccd1ae02c2386871cf1a759e0a27eede
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 30 22:19:44 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 30 22:20:10 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48115d81
7
8 dev-libs/protobuf-c: Restore protobuf-2.x compatibility
9
10 Package-Manager: Portage-2.3.10, Repoman-2.3.3
11
12 ...-c-1.3.0-restore-protobuf-2-compatibility.patch | 33 +++++++++++++++++
13 dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild | 42 ++++++++++++++++++++++
14 2 files changed, 75 insertions(+)
15
16 diff --git a/dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch
17 new file mode 100644
18 index 00000000000..962341b6540
19 --- /dev/null
20 +++ b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch
21 @@ -0,0 +1,33 @@
22 +From 4302266b45303094616685c7997a6e6015ddadba Mon Sep 17 00:00:00 2001
23 +From: Robert Edmonds <edmonds@××××××××××××××××××××.com>
24 +Date: Mon, 7 Aug 2017 12:31:55 -0400
25 +Subject: [PATCH] Restore protobuf-2.x compatibility
26 +
27 +The change in commit 712154b912de824741381c0bb26c2fbed54515a3 ("Bump
28 +minimum required header version for proto3 syntax") uses functionality
29 +only exposed by protobuf-3.x, breaking the build when compiling against
30 +protobuf-2.x.
31 +
32 +Since we still want to support building against protobuf-2.x, this
33 +commit makes the proto3 syntax check in the file generator dependent on
34 +building against protobuf-3.x.
35 +---
36 + protoc-c/c_file.cc | 2 ++
37 + 1 file changed, 2 insertions(+)
38 +
39 +diff --git a/protoc-c/c_file.cc b/protoc-c/c_file.cc
40 +index 9851768..0f1d770 100644
41 +--- a/protoc-c/c_file.cc
42 ++++ b/protoc-c/c_file.cc
43 +@@ -120,9 +120,11 @@ void FileGenerator::GenerateHeader(io::Printer* printer) {
44 + string filename_identifier = FilenameIdentifier(file_->name());
45 +
46 + int min_header_version = 1000000;
47 ++#if defined(HAVE_PROTO3)
48 + if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) {
49 + min_header_version = 1003000;
50 + }
51 ++#endif
52 +
53 + // Generate top of header.
54 + printer->Print(
55
56 diff --git a/dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild b/dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild
57 new file mode 100644
58 index 00000000000..52bb0f39311
59 --- /dev/null
60 +++ b/dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild
61 @@ -0,0 +1,42 @@
62 +# Copyright 1999-2017 Gentoo Foundation
63 +# Distributed under the terms of the GNU General Public License v2
64 +
65 +EAPI=6
66 +
67 +inherit autotools multilib-minimal
68 +
69 +MY_PV="${PV/_/-}"
70 +MY_P="${PN}-${MY_PV}"
71 +
72 +DESCRIPTION="Protocol Buffers implementation in C"
73 +HOMEPAGE="https://github.com/protobuf-c/protobuf-c/"
74 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/${MY_P}.tar.gz"
75 +
76 +LICENSE="BSD-2"
77 +# Subslot == SONAME version
78 +SLOT="0/1.0.0"
79 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
80 +IUSE="static-libs test"
81 +
82 +RDEPEND=">=dev-libs/protobuf-2.6.0:0=[${MULTILIB_USEDEP}]"
83 +DEPEND="${RDEPEND}
84 + test? ( ${AUTOTOOLS_DEPEND} )
85 + virtual/pkgconfig[${MULTILIB_USEDEP}]"
86 +
87 +PATCHES=( "${FILESDIR}"/${PN}-1.3.0-restore-protobuf-2-compatibility.patch )
88 +
89 +S="${WORKDIR}/${MY_P}"
90 +
91 +src_prepare() {
92 + default
93 + if ! use test ; then
94 + eapply "${FILESDIR}"/${PN}-1.3.0-no-build-tests.patch
95 + fi
96 +
97 + eautoreconf
98 +}
99 +
100 +multilib_src_configure() {
101 + ECONF_SOURCE="${S}" \
102 + econf "${myeconfargs[@]}"
103 +}