[1/1] msgpack: new option install libs

Message ID 20170918205604.26827-1-bradford@density.io
State New
Headers show
Series
  • [1/1] msgpack: new option install libs
Related show

Commit Message

Bradford Barr Sept. 18, 2017, 8:56 p.m.
From: bradford barr <bradford@density.io>

New option to install libs. MessagePack is implemented both as a C++ header and
a C runtime library. If all applications linking to msgpack use the C++ header
library there's no need to install the C library. This option allows a user to
prevent installing unused libraries.

Signed-off-by: bradford barr <bradford@density.io>
---
 package/msgpack/Config.in  | 14 ++++++++++++++
 package/msgpack/msgpack.mk |  4 ++++
 2 files changed, 18 insertions(+)

Comments

Bradford Barr Sept. 18, 2017, 9:03 p.m. | #1
This depends on the version bump to msgpack. Probably should have
waited to submit it. Sorry.

B

On Mon, Sep 18, 2017 at 4:56 PM, Bradford Barr <bradford@density.io> wrote:
> From: bradford barr <bradford@density.io>
>
> New option to install libs. MessagePack is implemented both as a C++ header and
> a C runtime library. If all applications linking to msgpack use the C++ header
> library there's no need to install the C library. This option allows a user to
> prevent installing unused libraries.
>
> Signed-off-by: bradford barr <bradford@density.io>
> ---
>  package/msgpack/Config.in  | 14 ++++++++++++++
>  package/msgpack/msgpack.mk |  4 ++++
>  2 files changed, 18 insertions(+)
>
> diff --git a/package/msgpack/Config.in b/package/msgpack/Config.in
> index b8e8213..f32af9e 100644
> --- a/package/msgpack/Config.in
> +++ b/package/msgpack/Config.in
> @@ -13,3 +13,17 @@ config BR2_PACKAGE_MSGPACK
>  comment "msgpack needs a toolchain w/ C++"
>         depends on !BR2_INSTALL_LIBSTDCPP
>         depends on BR2_TOOLCHAIN_HAS_SYNC_4
> +
> +if BR2_PACKAGE_MSGPACK
> +
> +config BR2_PACKAGE_MSGPACK_INSTALL_LIB
> +       bool "install lib"
> +       default y
> +       help
> +         MessagePack ships both a C library and a C++ header library.
> +         Selecting this option will install the C library in the target
> +         directory.
> +
> +         https://github.com/msgpack/msgpack-c#c-header-only-library
> +
> +endif
> diff --git a/package/msgpack/msgpack.mk b/package/msgpack/msgpack.mk
> index 66dbc8d..4133e0b 100644
> --- a/package/msgpack/msgpack.mk
> +++ b/package/msgpack/msgpack.mk
> @@ -10,6 +10,10 @@ MSGPACK_LICENSE = BSL-1.0
>  MSGPACK_LICENSE_FILES = COPYING
>  MSGPACK_INSTALL_STAGING = YES
>
> +ifneq ($(BR2_PACKAGE_MSGPACK_INSTALL_LIB),y)
> +MSGPACK_INSTALL_TARGET = NO
> +endif
> +
>  define MSGPACK_INSTALL_TARGET_CMDS
>         cp -a $(@D)/libmsgpackc.so* $(TARGET_DIR)/usr/lib
>  endef
> --
> 2.9.3
>
Arnout Vandecappelle Sept. 19, 2017, 9:19 p.m. | #2
On 18-09-17 23:03, Bradford Barr wrote:
> This depends on the version bump to msgpack. Probably should have
> waited to submit it. Sorry.

 Better yet, submit both as a series. For now it's OK though.

 Regards,
 Arnout
Bradford Barr Sept. 20, 2017, 12:47 a.m. | #3
Will do next time. Sorry about that.

B

On Tue, Sep 19, 2017 at 5:19 PM Arnout Vandecappelle <arnout@mind.be> wrote:

>
>
> On 18-09-17 23:03, Bradford Barr wrote:
> > This depends on the version bump to msgpack. Probably should have
> > waited to submit it. Sorry.
>
>  Better yet, submit both as a series. For now it's OK though.
>
>  Regards,
>  Arnout
>
> --
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> <+32%2016%2028%2065%2000>
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
>
<div dir="ltr">Will do next time. Sorry about that. <div><br></div><div>B</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 19, 2017 at 5:19 PM Arnout Vandecappelle &lt;<a href="mailto:arnout@mind.be">arnout@mind.be</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 18-09-17 23:03, Bradford Barr wrote:<br>
&gt; This depends on the version bump to msgpack. Probably should have<br>
&gt; waited to submit it. Sorry.<br>
<br>
 Better yet, submit both as a series. For now it&#39;s OK though.<br>
<br>
 Regards,<br>
 Arnout<br>
<br>
--<br>
Arnout Vandecappelle                          arnout at mind be<br>
Senior Embedded Software Architect            <a href="tel:+32%2016%2028%2065%2000" value="+3216286500" target="_blank">+32-16-286500</a><br>
Essensium/Mind                                <a href="http://www.mind.be" rel="noreferrer" target="_blank">http://www.mind.be</a><br>
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven<br>
LinkedIn profile: <a href="http://www.linkedin.com/in/arnoutvandecappelle" rel="noreferrer" target="_blank">http://www.linkedin.com/in/arnoutvandecappelle</a><br>
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF<br>
</blockquote></div>

Patch

diff --git a/package/msgpack/Config.in b/package/msgpack/Config.in
index b8e8213..f32af9e 100644
--- a/package/msgpack/Config.in
+++ b/package/msgpack/Config.in
@@ -13,3 +13,17 @@  config BR2_PACKAGE_MSGPACK
 comment "msgpack needs a toolchain w/ C++"
 	depends on !BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
+
+if BR2_PACKAGE_MSGPACK
+
+config BR2_PACKAGE_MSGPACK_INSTALL_LIB
+	bool "install lib"
+	default y
+	help
+	  MessagePack ships both a C library and a C++ header library.
+	  Selecting this option will install the C library in the target
+	  directory.
+
+	  https://github.com/msgpack/msgpack-c#c-header-only-library
+
+endif
diff --git a/package/msgpack/msgpack.mk b/package/msgpack/msgpack.mk
index 66dbc8d..4133e0b 100644
--- a/package/msgpack/msgpack.mk
+++ b/package/msgpack/msgpack.mk
@@ -10,6 +10,10 @@  MSGPACK_LICENSE = BSL-1.0
 MSGPACK_LICENSE_FILES = COPYING
 MSGPACK_INSTALL_STAGING = YES
 
+ifneq ($(BR2_PACKAGE_MSGPACK_INSTALL_LIB),y)
+MSGPACK_INSTALL_TARGET = NO
+endif
+
 define MSGPACK_INSTALL_TARGET_CMDS
 	cp -a $(@D)/libmsgpackc.so* $(TARGET_DIR)/usr/lib
 endef