From: Clemens Gruber <clemens.gruber@pqgruber.com>
To: ptxdist@pengutronix.de
Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
Subject: [ptxdist] [PATCH 3/3] grpc: add pkg-config files
Date: Mon, 10 Dec 2018 14:56:51 +0100 [thread overview]
Message-ID: <20181210135651.6254-4-clemens.gruber@pqgruber.com> (raw)
In-Reply-To: <20181210135651.6254-1-clemens.gruber@pqgruber.com>
The grpc cmake build process does not produce .pc files.
To ease reuse of grpc from other packages, patch them in.
The pkg-config files are based on those created by the grpc Makefile
build. (gpr.pc merged into grpc.pc to avoid adding a third .pc file)
The library version numbers are extracted from the Makefile.
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
.../0002-Add-pkg-config-files.patch | 47 +++++++++++++++++++
patches/grpc-1.17.0/series | 3 +-
rules/grpc.make | 18 +++++++
3 files changed, 67 insertions(+), 1 deletion(-)
create mode 100644 patches/grpc-1.17.0/0002-Add-pkg-config-files.patch
diff --git a/patches/grpc-1.17.0/0002-Add-pkg-config-files.patch b/patches/grpc-1.17.0/0002-Add-pkg-config-files.patch
new file mode 100644
index 000000000..713419bd9
--- /dev/null
+++ b/patches/grpc-1.17.0/0002-Add-pkg-config-files.patch
@@ -0,0 +1,47 @@
+From: Clemens Gruber <clemens.gruber@pqgruber.com>
+Date: Mon, 10 Dec 2018 13:44:53 +0100
+Subject: [PATCH] Add pkg-config files
+
+---
+ grpc++.pc.in | 12 ++++++++++++
+ grpc.pc.in | 12 ++++++++++++
+ 2 files changed, 24 insertions(+)
+ create mode 100644 grpc++.pc.in
+ create mode 100644 grpc.pc.in
+
+diff --git a/grpc++.pc.in b/grpc++.pc.in
+new file mode 100644
+index 000000000000..c2677831a9c7
+--- /dev/null
++++ b/grpc++.pc.in
+@@ -0,0 +1,12 @@
++prefix=${pcfiledir}/../..
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: gRPC++
++Description: C++ wrapper for gRPC
++Version: @VERSION@
++Cflags: -I${includedir}
++Requires.private: grpc protobuf
++Libs: -L${libdir} -lgrpc++
++Libs.private:
+diff --git a/grpc.pc.in b/grpc.pc.in
+new file mode 100644
+index 000000000000..917c57a5e074
+--- /dev/null
++++ b/grpc.pc.in
+@@ -0,0 +1,12 @@
++prefix=${pcfiledir}/../..
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: gRPC
++Description: high performance general RPC framework
++Version: @VERSION@
++Cflags: -I${includedir}
++Requires.private: zlib libcares openssl
++Libs: -L{libdir} -lgrpc
++Libs.private: -lgpr
diff --git a/patches/grpc-1.17.0/series b/patches/grpc-1.17.0/series
index 767460cac..9683c0e9d 100644
--- a/patches/grpc-1.17.0/series
+++ b/patches/grpc-1.17.0/series
@@ -1,6 +1,7 @@
# generated by git-ptx-patches
#tag:base --start-number 1
0001-CMakeLists.txt-allow-passing-a-pre-existing-grpc_cpp.patch
+0002-Add-pkg-config-files.patch
#tag:upstream --start-number 100
0100-Cancel-still-active-c-ares-queries-after-10-seconds-.patch
-# c405f5a2e885b4d6ee8e68fb8ef11483 - git-ptx-patches magic
+# 2ec60af54d62c846f3125aae9358fc16 - git-ptx-patches magic
diff --git a/rules/grpc.make b/rules/grpc.make
index b75389a87..55ae4d3e4 100644
--- a/rules/grpc.make
+++ b/rules/grpc.make
@@ -49,6 +49,24 @@ GRPC_CONF_OPT := \
-DgRPC_NATIVE_CPP_PLUGIN=$(PTXDIST_SYSROOT_HOST)/bin/grpc_cpp_plugin \
-DPROTOBUF_PROTOC_EXECUTABLE=$(PTXDIST_SYSROOT_HOST)/bin/protoc
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/grpc.install:
+ @$(call targetinfo)
+ @$(call world/install, GRPC)
+
+ @install -d $(GRPC_PKGDIR)/usr/lib/pkgconfig/
+ VERSION=$$(grep "CORE_VERSION =" $(GRPC_DIR)/Makefile | sed 's/.*=\s*//') \
+ ptxd_replace_magic $(GRPC_DIR)/grpc.pc.in > \
+ $(GRPC_PKGDIR)/usr/lib/pkgconfig/grpc.pc
+ VERSION=$$(grep "CPP_VERSION =" $(GRPC_DIR)/Makefile | sed 's/.*=\s*//') \
+ ptxd_replace_magic $(GRPC_DIR)/grpc++.pc.in > \
+ $(GRPC_PKGDIR)/usr/lib/pkgconfig/grpc++.pc
+
+ @$(call touch)
+
# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------
--
2.19.2
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2018-12-10 13:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 13:56 [ptxdist] [PATCH 0/3] grpc Clemens Gruber
2018-12-10 13:56 ` [ptxdist] [PATCH 1/3] host-c-ares: new package Clemens Gruber
2018-12-10 13:56 ` [ptxdist] [PATCH 2/3] grpc: " Clemens Gruber
2018-12-10 13:56 ` Clemens Gruber [this message]
2018-12-11 16:14 ` [ptxdist] [PATCH 3/3] grpc: add pkg-config files Roland Hieber
2018-12-14 15:20 ` Clemens Gruber
2018-12-14 15:40 ` Michael Olbrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181210135651.6254-4-clemens.gruber@pqgruber.com \
--to=clemens.gruber@pqgruber.com \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox