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
:=51cec99f108b83422b7af1170afd7aeb2dd77d2bcbb7b6bad1f92509e9ccf8cb
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 CMAKE_SOURCE_SUBDIR
:=cmake
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/host-build.mk
27 include $(INCLUDE_DIR
)/cmake.mk
29 define Package
/protobuf
/Default
32 TITLE
:=A structured data encoding library
33 URL
:=https
://github.com
/google
/protobuf
34 DEPENDS
:=+zlib
+libpthread
+libatomic
+libstdcpp
37 define Package
/protobuf
38 $(call Package
/protobuf
/Default
)
39 DEPENDS
+=+protobuf-lite
42 define Package
/protobuf-lite
43 $(call Package
/protobuf
/Default
)
46 define Package
/protobuf
/description
/Default
47 Protocol Buffers are a way of encoding structured data in an efficient
48 yet extensible format. Google uses Protocol Buffers for almost
all
49 of its internal RPC protocols and file formats.
52 define Package
/protobuf
/description
53 $(call Package
/protobuf
/description
/Default
)
55 This package provides the libprotoc
, libprotobuf
, and libprotobuf-lite
56 libraries. For a much smaller protobuf package
, see
"protobuf-lite".
60 define Package
/protobuf-lite
/description
61 $(call Package
/protobuf
/description
/Default
)
63 This package provides the libprotobuf-lite library.
67 CMAKE_HOST_OPTIONS
+= \
68 -Dprotobuf_BUILD_PROTOC_BINARIES
=ON \
69 -Dprotobuf_BUILD_TESTS
=OFF \
70 -DBUILD_SHARED_LIBS
=ON \
71 -DCMAKE_SKIP_RPATH
=OFF \
72 -DCMAKE_INSTALL_LIBDIR
=lib \
73 -DCMAKE_INSTALL_RPATH
="${STAGING_DIR_HOSTPKG}/lib"
76 -Dprotobuf_BUILD_PROTOC_BINARIES
=ON \
77 -Dprotobuf_BUILD_TESTS
=OFF \
78 -Dprotobuf_WITH_ZLIB
=ON \
79 -DBUILD_SHARED_LIBS
=ON
81 TARGET_LDFLAGS
+= -latomic
$(if
$(CONFIG_USE_GLIBC
),-lm
)
83 define Build
/InstallDev
84 $(call Build
/InstallDev
/cmake
,$(1))
85 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/protobuf.
pc
86 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/protobuf.
pc
87 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/protobuf-lite.
pc
88 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/protobuf-lite.
pc
91 define Package
/protobuf-lite
/install
96 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotobuf-lite.so
* \
100 define Package
/protobuf
/install
105 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotoc.so
* \
109 $(PKG_INSTALL_DIR
)/usr
/lib
/libprotobuf.so
* \
113 $(eval
$(call BuildPackage
,protobuf
))
114 $(eval
$(call BuildPackage
,protobuf-lite
))
115 $(eval
$(call HostBuild
))