1 # Copyright 2008-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
8 if [[ "${PV}" == "9999" ]]; then
11 EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
15 DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
16 HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
17 if [[ "${PV}" == "9999" ]]; then
20 SRC_URI="https://github.com/protocolbuffers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
25 KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
26 IUSE="emacs examples static-libs test zlib"
27 RESTRICT="!test? ( test )"
29 BDEPEND="emacs? ( app-editors/emacs:* )"
30 DEPEND="test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
31 zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
32 RDEPEND="emacs? ( app-editors/emacs:* )
33 zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
36 "${FILESDIR}/${PN}-3.11.0-disable_no-warning-test.patch"
37 "${FILESDIR}/${PN}-3.11.0-system_libraries.patch"
38 "${FILESDIR}/${PN}-3.11.0-protoc_input_output_files.patch"
41 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
49 append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
51 if tc-ld-is-gold; then
52 # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
56 multilib-minimal_src_configure
59 multilib_src_configure() {
61 $(use_enable static-libs static)
65 if tc-is-cross-compiler; then
66 # Build system uses protoc when building, so protoc copy runnable on host is needed.
67 mkdir -p "${WORKDIR}/build" || die
68 pushd "${WORKDIR}/build" > /dev/null || die
69 ECONF_SOURCE="${S}" econf_build "${options[@]}"
70 options+=(--with-protoc="$(pwd)/src/protoc")
71 popd > /dev/null || die
74 ECONF_SOURCE="${S}" econf "${options[@]}"
78 multilib-minimal_src_compile
81 elisp-compile editors/protobuf-mode.el
85 multilib_src_compile() {
86 if tc-is-cross-compiler; then
87 emake -C "${WORKDIR}/build/src" protoc
97 multilib_src_install_all() {
98 find "${D}" -name "*.la" -type f -delete || die
100 insinto /usr/share/vim/vimfiles/syntax
101 doins editors/proto.vim
102 insinto /usr/share/vim/vimfiles/ftdetect
103 doins "${FILESDIR}/proto.vim"
106 elisp-install ${PN} editors/protobuf-mode.el*
107 elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
110 if use examples; then
112 docompress -x /usr/share/doc/${PF}/examples
119 use emacs && elisp-site-regen
123 use emacs && elisp-site-regen