Skip to content

Commit

Permalink
protobuf: Bump version, add depends on abseil-cpp
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Lane <[email protected]>
  • Loading branch information
vidplace7 committed Dec 19, 2024
1 parent bbc02fa commit 231bf6c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
31 changes: 20 additions & 11 deletions libs/protobuf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=protobuf
PKG_VERSION:=3.17.3
PKG_RELEASE:=2
PKG_VERSION:=29.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-cpp-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
PKG_HASH:=51cec99f108b83422b7af1170afd7aeb2dd77d2bcbb7b6bad1f92509e9ccf8cb
PKG_HASH:=3d32940e975c4ad9b8ba69640e78f5527075bae33ca2890275bf26b853c0962c

PKG_MAINTAINER:=Ken Keys <[email protected]>
PKG_MAINTAINER:=Ken Keys <[email protected]>, Austin Lane <[email protected]>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:google:protobuf

CMAKE_SOURCE_SUBDIR:=cmake
HOST_BUILD_DEPENDS:=abseil-cpp/host
PKG_BUILD_DEPENDS:=abseil-cpp

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
Expand All @@ -31,7 +32,7 @@ define Package/protobuf/Default
CATEGORY:=Libraries
TITLE:=A structured data encoding library
URL:=https://github.com/google/protobuf
DEPENDS:=+zlib +libpthread +libatomic +libstdcpp
DEPENDS:=+zlib +libpthread +libatomic +libstdcpp +abseil-cpp
endef

define Package/protobuf
Expand Down Expand Up @@ -65,14 +66,18 @@ This package provides the libprotobuf-lite library.
endef

CMAKE_HOST_OPTIONS += \
-Dprotobuf_ABSL_PROVIDER="package" \
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_LIBDIR=lib

CMAKE_OPTIONS += \
-Dprotobuf_ABSL_PROVIDER="package" \
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_EXAMPLES=OFF \
-Dprotobuf_WITH_ZLIB=ON \
-DBUILD_SHARED_LIBS=ON

Expand All @@ -84,20 +89,24 @@ define Build/InstallDev
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/protobuf.pc
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/protobuf-lite.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/protobuf-lite.pc
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/upb.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/upb.pc
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/utf8_range.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/utf8_range.pc
endef

define Package/protobuf-lite/install
$(INSTALL_DIR) \
$(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib

$(CP) $(PKG_INSTALL_DIR)/usr/lib/libutf8_range.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libutf8_validity.so* $(1)/usr/lib/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* \
$(1)/usr/lib/
endef

define Package/protobuf/install
$(INSTALL_DIR) \
$(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib

$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libprotoc.so* \
Expand Down
30 changes: 15 additions & 15 deletions libs/protobuf/patches/010-rpath.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -16,8 +16,8 @@ foreach(_library ${_protobuf_libraries})
$<BUILD_INTERFACE:${protobuf_source_dir}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
@@ -39,8 +39,8 @@ endif ()

foreach(_library ${_protobuf_libraries})
if (UNIX AND NOT APPLE)
- set_property(TARGET ${_library}
- PROPERTY INSTALL_RPATH "$ORIGIN")
+# set_property(TARGET ${_library}
+# set_property(TARGET ${_library}
+# PROPERTY INSTALL_RPATH "$ORIGIN")
elseif (APPLE)
set_property(TARGET ${_library}
PROPERTY INSTALL_RPATH "@loader_path")
@@ -34,8 +34,8 @@ if (protobuf_BUILD_PROTOC_BINARIES)
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT protoc)
if (UNIX AND NOT APPLE)
- set_property(TARGET protoc
- PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
+# set_property(TARGET protoc
+# PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
elseif (APPLE)
set_property(TARGET protoc
PROPERTY INSTALL_RPATH "@loader_path/../lib")
@@ -66,8 +66,8 @@ if (protobuf_BUILD_PROTOC_BINARIES)
endif ()
foreach (binary IN LISTS _protobuf_binaries)
if (UNIX AND NOT APPLE)
- set_property(TARGET ${binary}
- PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
+# set_property(TARGET ${binary}
+# PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
elseif (APPLE)
set_property(TARGET ${binary}
PROPERTY INSTALL_RPATH "@loader_path/../lib")

0 comments on commit 231bf6c

Please sign in to comment.