exfatprogs: update to 1.2.5
[feed/packages.git] / libs / protobuf / Makefile
1 #
2 # Copyright (C) 2007-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=protobuf
11 PKG_VERSION:=3.17.3
12 PKG_RELEASE:=2
13
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
17
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
22
23 CMAKE_SOURCE_SUBDIR:=cmake
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/host-build.mk
27 include $(INCLUDE_DIR)/cmake.mk
28
29 define Package/protobuf/Default
30 SECTION:=libs
31 CATEGORY:=Libraries
32 TITLE:=A structured data encoding library
33 URL:=https://github.com/google/protobuf
34 DEPENDS:=+zlib +libpthread +libatomic +libstdcpp
35 endef
36
37 define Package/protobuf
38 $(call Package/protobuf/Default)
39 DEPENDS+=+protobuf-lite
40 endef
41
42 define Package/protobuf-lite
43 $(call Package/protobuf/Default)
44 endef
45
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.
50 endef
51
52 define Package/protobuf/description
53 $(call Package/protobuf/description/Default)
54
55 This package provides the libprotoc, libprotobuf, and libprotobuf-lite
56 libraries. For a much smaller protobuf package, see "protobuf-lite".
57
58 endef
59
60 define Package/protobuf-lite/description
61 $(call Package/protobuf/description/Default)
62
63 This package provides the libprotobuf-lite library.
64
65 endef
66
67 CMAKE_HOST_OPTIONS += \
68 -Dprotobuf_BUILD_PROTOC_BINARIES=ON \
69 -Dprotobuf_BUILD_TESTS=OFF \
70 -DBUILD_SHARED_LIBS=OFF \
71 -DCMAKE_INSTALL_LIBDIR=lib
72
73 CMAKE_OPTIONS += \
74 -Dprotobuf_BUILD_PROTOC_BINARIES=ON \
75 -Dprotobuf_BUILD_TESTS=OFF \
76 -Dprotobuf_WITH_ZLIB=ON \
77 -DBUILD_SHARED_LIBS=ON
78
79 TARGET_LDFLAGS += -latomic
80
81 define Build/InstallDev
82 $(call Build/InstallDev/cmake,$(1))
83 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/protobuf.pc
84 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/protobuf.pc
85 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/protobuf-lite.pc
86 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/protobuf-lite.pc
87 endef
88
89 define Package/protobuf-lite/install
90 $(INSTALL_DIR) \
91 $(1)/usr/lib
92
93 $(CP) \
94 $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* \
95 $(1)/usr/lib/
96 endef
97
98 define Package/protobuf/install
99 $(INSTALL_DIR) \
100 $(1)/usr/lib
101
102 $(CP) \
103 $(PKG_INSTALL_DIR)/usr/lib/libprotoc.so* \
104 $(1)/usr/lib/
105
106 $(CP) \
107 $(PKG_INSTALL_DIR)/usr/lib/libprotobuf.so* \
108 $(1)/usr/lib/
109 endef
110
111 $(eval $(call BuildPackage,protobuf))
112 $(eval $(call BuildPackage,protobuf-lite))
113 $(eval $(call HostBuild))