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
:=ddc96d83f3b7417da53bce2510b94ad2796465ef8763f7a4e82089157efe97aa
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
26 CMAKE_SOURCE_SUBDIR
:=cmake
28 include $(INCLUDE_DIR
)/package.mk
29 include $(INCLUDE_DIR
)/host-build.mk
30 include $(INCLUDE_DIR
)/cmake.mk
32 define Package
/protobuf
/Default
35 TITLE
:=A structured data encoding library
36 URL
:=https
://github.com
/google
/protobuf
37 DEPENDS
:=+zlib
+libpthread
+libatomic
+libstdcpp
40 define Package
/protobuf
41 $(call Package
/protobuf
/Default
)
42 DEPENDS
+=+protobuf-lite
45 define Package
/protobuf-lite
46 $(call Package
/protobuf
/Default
)
49 define Package
/protobuf
/description
/Default
50 Protocol Buffers are a way of encoding structured data in an efficient
51 yet extensible format. Google uses Protocol Buffers for almost
all
52 of its internal RPC protocols and file formats.
55 define Package
/protobuf
/description
56 $(call Package
/protobuf
/description
/Default
)
58 This package provides the libprotoc
, libprotobuf
, and libprotobuf-lite
59 libraries. For a much smaller protobuf package
, see
"protobuf-lite".
63 define Package
/protobuf-lite
/description
64 $(call Package
/protobuf
/description
/Default
)
66 This package provides the libprotobuf-lite library.
70 CMAKE_HOST_OPTIONS
+= \
71 -Dprotobuf_BUILD_PROTOC_BINARIES
=ON \
72 -Dprotobuf_BUILD_TESTS
=OFF \
73 -DBUILD_SHARED_LIBS
=ON \
74 -DCMAKE_SKIP_RPATH
=OFF \
75 -DCMAKE_INSTALL_LIBDIR
=lib \
76 -DCMAKE_INSTALL_RPATH
="${STAGING_DIR_HOSTPKG}/lib"
79 -Dprotobuf_BUILD_PROTOC_BINARIES
=ON \
80 -Dprotobuf_BUILD_TESTS
=OFF \
81 -Dprotobuf_WITH_ZLIB
=ON \
82 -DBUILD_SHARED_LIBS
=ON
84 TARGET_LDFLAGS
+= -latomic
86 define Build
/InstallDev
87 $(call Build
/InstallDev
/cmake
,$(1))
88 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/protobuf.
pc
89 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/protobuf.
pc
90 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/protobuf-lite.
pc
91 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/protobuf-lite.
pc
94 define Package
/protobuf-lite
/install
99 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotobuf-lite.so
* \
103 define Package
/protobuf
/install
108 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotoc.so
* \
112 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotobuf.so
* \
116 $(eval
$(call BuildPackage
,protobuf
))
117 $(eval
$(call BuildPackage
,protobuf-lite
))
118 $(eval
$(call HostBuild
))