protobuf-c: Add pkgconfig file for CMake
authorRosen Penev <rosenp@gmail.com>
Mon, 30 Sep 2019 01:49:36 +0000 (18:49 -0700)
committerRosen Penev <rosenp@gmail.com>
Mon, 30 Sep 2019 01:49:36 +0000 (18:49 -0700)
Fixes compilation for a few packages.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/protobuf-c/Makefile
libs/protobuf-c/patches/010-pkgconfig.patch [new file with mode: 0644]

index c94348ceaf0428a2c67f9fa4725f64b7352bd783..31595926aa5ad8fc95ab49d0bb24c70791cb2bcd 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libprotobuf-c
 PKG_VERSION:=1.3.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=protobuf-c-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/protobuf-c/protobuf-c/releases/download/v$(PKG_VERSION)
diff --git a/libs/protobuf-c/patches/010-pkgconfig.patch b/libs/protobuf-c/patches/010-pkgconfig.patch
new file mode 100644 (file)
index 0000000..f0fd749
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/build-cmake/CMakeLists.txt
++++ b/build-cmake/CMakeLists.txt
+@@ -1,7 +1,10 @@
+ SET(PACKAGE protobuf-c)
+ SET(PACKAGE_NAME protobuf-c)
+ SET(PACKAGE_VERSION 1.3.2)
++set(PACKAGE_URL https://github.com/protobuf-c/protobuf-c)
++set(PACKAGE_DESCRIPTION "Protocol Buffers implementation in C")
++include(GNUInstallDirs)
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
+@@ -137,6 +140,9 @@ IF(CMAKE_HOST_UNIX)
+ INSTALL(CODE "EXECUTE_PROCESS (COMMAND ln -sf protoc-gen-c protoc-c WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)")
+ ENDIF()
++CONFIGURE_FILE ("libprotobufc.pc.in" "libprotobufc.pc" @ONLY)
++INSTALL (FILES "../libprotobufc.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
++
+ INCLUDE(Dart)
+ SET(DART_TESTING_TIMEOUT 5)
+--- /dev/null
++++ b/build-cmake/libprotobufc.pc.in
+@@ -0,0 +1,14 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=@CMAKE_INSTALL_PREFIX@
++bindir=${exec_prefix}/@CMAKE_INSTALL_BINDIR@
++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
++includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
++
++Name: @PACKAGE_NAME@
++Version: @PACKAGE_VERSION@
++Description: @PACKAGE_DESCRIPTION@
++URL: @PACKAGE_URL@
++Requires:
++Libs: -L${libdir} -lprotobuf-c
++Libs.private: 
++Cflags: -I${includedir}