2 # Copyright (C) 2007-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-cpp-
$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://github.com
/google
/protobuf
/releases
/download
/v
$(PKG_VERSION
)
16 PKG_HASH
:=50ec5a07c0c55d4ec536dd49021f2e194a26bfdbc531d03d1e9d4d3e27175659
18 PKG_MAINTAINER
:=Ken Keys
<kkeys@caida.org
>
19 PKG_LICENSE
:=BSD-3-Clause
20 PKG_LICENSE_FILES
:=LICENSE
21 PKG_CPE_ID
:=cpe
:/a
:google
:protobuf
23 HOST_BUILD_PARALLEL
:=1
25 CMAKE_SOURCE_SUBDIR
:=cmake
27 include $(INCLUDE_DIR
)/package.mk
28 include $(INCLUDE_DIR
)/host-build.mk
29 include $(INCLUDE_DIR
)/cmake.mk
31 define Package
/protobuf
/Default
34 TITLE
:=A structured data encoding library
35 URL
:=https
://github.com
/google
/protobuf
36 DEPENDS
:=+zlib
+libpthread
+libatomic
+libstdcpp
39 define Package
/protobuf
40 $(call Package
/protobuf
/Default
)
41 DEPENDS
+=+protobuf-lite
44 define Package
/protobuf-lite
45 $(call Package
/protobuf
/Default
)
48 define Package
/protobuf
/description
/Default
49 Protocol Buffers are a way of encoding structured data in an efficient
50 yet extensible format. Google uses Protocol Buffers for almost
all
51 of its internal RPC protocols and file formats.
54 define Package
/protobuf
/description
55 $(call Package
/protobuf
/description
/Default
)
57 This package provides the libprotoc
, libprotobuf
, and libprotobuf-lite
58 libraries. For a much smaller protobuf package
, see
"protobuf-lite".
62 define Package
/protobuf-lite
/description
63 $(call Package
/protobuf
/description
/Default
)
65 This package provides the libprotobuf-lite library.
69 CMAKE_HOST_OPTIONS
+= \
70 -Dprotobuf_BUILD_PROTOC_BINARIES
=ON \
71 -Dprotobuf_BUILD_TESTS
=OFF \
72 -DBUILD_SHARED_LIBS
=ON \
73 -DCMAKE_SKIP_RPATH
=OFF \
74 -DCMAKE_INSTALL_LIBDIR
=lib \
75 -DCMAKE_INSTALL_RPATH
="${STAGING_DIR_HOSTPKG}/lib"
78 -Dprotobuf_BUILD_PROTOC_BINARIES
=ON \
79 -Dprotobuf_BUILD_TESTS
=OFF \
80 -Dprotobuf_WITH_ZLIB
=ON \
81 -DBUILD_SHARED_LIBS
=ON
83 TARGET_LDFLAGS
+= -latomic
$(if
$(CONFIG_USE_GLIBC
),-lm
)
85 define Build
/InstallDev
86 $(call Build
/InstallDev
/cmake
,$(1))
87 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/protobuf.
pc
88 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/protobuf.
pc
89 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/protobuf-lite.
pc
90 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/protobuf-lite.
pc
93 define Package
/protobuf-lite
/install
98 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotobuf-lite.so
* \
102 define Package
/protobuf
/install
107 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotoc.so
* \
111 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotobuf.so
* \
115 $(eval
$(call BuildPackage
,protobuf
))
116 $(eval
$(call BuildPackage
,protobuf-lite
))
117 $(eval
$(call HostBuild
))