Hi,

On Mon, Dec 10, 2018 at 02:56:51PM +0100, Clemens Gruber wrote:
> 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 <[email protected]>
> ---
>  .../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
> 
[...]
> --- 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*//') \

Patch looks okay to me, but just a small FYI: sed understands patterns
too, so you can save yourself a process :-)

    $ (echo irrelevant text; echo 'CORE_VERSION = 2.55.3foobar') | sed -n 
'/CORE_VERSION =/ s/.*=\s*//p'
    2.55.3foobar

-n and s///p make sed only print the matching lines after substitution.

 - Roland

> +             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
> [email protected]

-- 
Roland Hieber                     | [email protected]     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to