blob: 3a76b111258249903bb4b786f2b05c8e3e970f5b [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# Copyright (C) 2011 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=libprotobuf-c
11PKG_VERSION:=1.4.1
12PKG_RELEASE:=1
13
14PKG_SOURCE:=protobuf-c-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=https://github.com/protobuf-c/protobuf-c/releases/download/v$(PKG_VERSION)
16PKG_HASH:=4cc4facd508172f3e0a4d3a8736225d472418aee35b4ad053384b137b220339f
17PKG_BUILD_DIR:=$(BUILD_DIR)/protobuf-c-$(PKG_VERSION)
18HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/protobuf-c-$(PKG_VERSION)
19
20PKG_MAINTAINER:=
21PKG_LICENSE:=BSD-2-Clause
22PKG_LICENSE_FILES:=LICENSE
23PKG_CPE_ID:=cpe:/a:protobuf-c_project:protobuf-c
24
25HOST_BUILD_DEPENDS:=protobuf/host
26PKG_BUILD_DEPENDS:=protobuf
27
28CMAKE_INSTALL:=1
29CMAKE_SOURCE_SUBDIR:=build-cmake
30
31include $(INCLUDE_DIR)/package.mk
32include $(INCLUDE_DIR)/host-build.mk
33include $(INCLUDE_DIR)/cmake.mk
34
35define Package/libprotobuf-c
36 TITLE:=Protocol Buffers library
37 SECTION:=libs
38 CATEGORY:=Libraries
39 URL:=https://github.com/protobuf-c/protobuf-c
40endef
41
42define Package/libprotobuf-c/description
43 Runtime library to use Google Protocol Buffers from C applications.
44 Protocol Buffers are a way of encoding structured data in an efficient yet
45 extensible format. Google uses Protocol Buffers for almost all of its
46 internal RPC protocols and file formats.
47endef
48
49CMAKE_HOST_OPTIONS += \
50 -DBUILD_SHARED_LIBS=OFF \
51 -DCMAKE_CXX_STANDARD=11 \
52 -DCMAKE_SKIP_RPATH=OFF \
53 -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib"
54
55CMAKE_OPTIONS += \
56 -DBUILD_SHARED_LIBS=ON \
57 -DBUILD_PROTOC=OFF
58
59define Package/libprotobuf-c/install
60 $(INSTALL_DIR) $(1)/usr/lib
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-c.so* $(1)/usr/lib/
62endef
63
64$(eval $(call BuildPackage,libprotobuf-c))
65$(eval $(call HostBuild))
66