Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] bump libubox to upstream version.
@ 2014-10-12  8:20 Alexey Mednyy
  2014-10-12  8:20 ` [Buildroot] [PATCH 2/3] bump-libuci-to-upstream-version Alexey Mednyy
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexey Mednyy @ 2014-10-12  8:20 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Alexey Mednyy <swexru@gmail.com>
---
 package/libubox/libubox.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/libubox/libubox.mk b/package/libubox/libubox.mk
index 770b55d..7ff3c16 100644
--- a/package/libubox/libubox.mk
+++ b/package/libubox/libubox.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-LIBUBOX_VERSION = bbd846ec2d72b2629758b69dc122ac0b0f2c3e4b
+LIBUBOX_VERSION = 5a0bbefc8fa440446253b171d0ac038d839360e3
 LIBUBOX_SITE = git://nbd.name/luci2/libubox.git
 LIBUBOX_LICENSE = LGPLv2.1, GPLv2, BSD-3c, MIT
 LIBUBOX_INSTALL_STAGING = YES
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/3] bump-libuci-to-upstream-version
  2014-10-12  8:20 [Buildroot] [PATCH 1/3] bump libubox to upstream version Alexey Mednyy
@ 2014-10-12  8:20 ` Alexey Mednyy
  2014-10-12 10:38   ` Peter Korsgaard
  2014-10-12  8:20 ` [Buildroot] [PATCH 3/3] adding new package ubus Alexey Mednyy
  2014-10-12 10:38 ` [Buildroot] [PATCH 1/3] bump libubox to upstream version Peter Korsgaard
  2 siblings, 1 reply; 6+ messages in thread
From: Alexey Mednyy @ 2014-10-12  8:20 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Alexey Mednyy <swexru@gmail.com>
---
 package/libuci/libuci.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/libuci/libuci.mk b/package/libuci/libuci.mk
index ce18a38..9d5c172 100644
--- a/package/libuci/libuci.mk
+++ b/package/libuci/libuci.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-LIBUCI_VERSION = ed938cc8e423d4a33b8f31e6e6d1eb0805ae3d10
+LIBUCI_VERSION = e339407372ffc70b1451e4eda218c01aa95a6a7f
 LIBUCI_SITE = git://nbd.name/uci.git
 LIBUCI_LICENSE = LGPLv2.1
 LIBUCI_INSTALL_STAGING = YES
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 3/3] adding new package ubus.
  2014-10-12  8:20 [Buildroot] [PATCH 1/3] bump libubox to upstream version Alexey Mednyy
  2014-10-12  8:20 ` [Buildroot] [PATCH 2/3] bump-libuci-to-upstream-version Alexey Mednyy
@ 2014-10-12  8:20 ` Alexey Mednyy
  2014-10-13 20:46   ` Samuel Martin
  2014-10-12 10:38 ` [Buildroot] [PATCH 1/3] bump libubox to upstream version Peter Korsgaard
  2 siblings, 1 reply; 6+ messages in thread
From: Alexey Mednyy @ 2014-10-12  8:20 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Alexey Mednyy <swexru@gmail.com>
---
 package/Config.in                              |  1 +
 package/ubus/Config.in                         | 11 ++++++++++
 package/ubus/ubus-01-json-definition-fix.patch | 28 ++++++++++++++++++++++++++
 package/ubus/ubus.mk                           | 26 ++++++++++++++++++++++++
 4 files changed, 66 insertions(+)
 create mode 100644 package/ubus/Config.in
 create mode 100644 package/ubus/ubus-01-json-definition-fix.patch
 create mode 100644 package/ubus/ubus.mk

diff --git a/package/Config.in b/package/Config.in
index ea89c96..92fc6bb 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -872,6 +872,7 @@ menu "Other"
 	source "package/libtasn1/Config.in"
 	source "package/libtpl/Config.in"
 	source "package/libubox/Config.in"
+	source "package/ubus/Config.in"	
 	source "package/libuci/Config.in"
 	source "package/libunwind/Config.in"
 	source "package/liburcu/Config.in"
diff --git a/package/ubus/Config.in b/package/ubus/Config.in
new file mode 100644
index 0000000..6a9c73d
--- /dev/null
+++ b/package/ubus/Config.in
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_UBUS
+	bool "ubus"
+	select BR2_PACKAGE_LIBUBOX
+	depends on !BR2_PREFER_STATIC_LIB
+	help
+	  OpenWrt micro bus architecture, project
+          provide communication between various 
+          daemons and applications.
+
+comment "ubus needs toolchain w/ dynamic library"
+	depends on BR2_PREFER_STATIC_LIB
diff --git a/package/ubus/ubus-01-json-definition-fix.patch b/package/ubus/ubus-01-json-definition-fix.patch
new file mode 100644
index 0000000..ccef101
--- /dev/null
+++ b/package/ubus/ubus-01-json-definition-fix.patch
@@ -0,0 +1,28 @@
+Fix wrong cmake behavior with json lib search
+
+Signed-off-by: Alexey Mednyy swexru at gmail.com
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cb2f420..679b258 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -25,11 +25,18 @@ TARGET_LINK_LIBRARIES(ubus ubox)
+ ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
+ TARGET_LINK_LIBRARIES(ubusd ubox)
+ 
+-find_library(json NAMES json-c json)
++find_library(json NAMES json-c)
+ ADD_EXECUTABLE(cli cli.c)
+ SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus)
+ TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json ${json})
+ 
++INCLUDE(FindPkgConfig)
++PKG_CHECK_MODULES(JSONC json-c)
++IF(JSONC_FOUND)
++  ADD_DEFINITIONS(-DJSONC)
++  INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})
++ENDIF()
++
+ ADD_SUBDIRECTORY(lua)
+ ADD_SUBDIRECTORY(examples)
+ 
diff --git a/package/ubus/ubus.mk b/package/ubus/ubus.mk
new file mode 100644
index 0000000..9ac45ab
--- /dev/null
+++ b/package/ubus/ubus.mk
@@ -0,0 +1,26 @@
+################################################################################
+#
+# UBUS
+#
+################################################################################
+
+UBUS_VERSION = 4c4f35cf2230d70b9ddd87638ca911e8a563f2f3
+UBUS_SITE = git://nbd.name/luci2/ubus.git
+UBUS_LICENSE = LGPLv2.1
+UBUS_DEPENDENCIES = host-pkgconf $(if $(BR2_PACKAGE_JSON_C),json-c)
+
+ifeq ($(BR2_USE_MMU)$(BR2_PACKAGE_LUA_5_1),yy)
+UBUS_DEPENDENCIES += lua
+UBUS_CONF_OPTS += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \
+	-DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include
+else
+	UBUS_CONF_OPTS += -DBUILD_LUA:BOOL=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+	UBUS_DEPENDENCIES += systemd 
+else
+	UBUS_CONF_OPTS += -DENABLE_SYSTEMD:BOOL=OFF
+endif
+
+$(eval $(cmake-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/3] bump libubox to upstream version.
  2014-10-12  8:20 [Buildroot] [PATCH 1/3] bump libubox to upstream version Alexey Mednyy
  2014-10-12  8:20 ` [Buildroot] [PATCH 2/3] bump-libuci-to-upstream-version Alexey Mednyy
  2014-10-12  8:20 ` [Buildroot] [PATCH 3/3] adding new package ubus Alexey Mednyy
@ 2014-10-12 10:38 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-10-12 10:38 UTC (permalink / raw)
  To: buildroot

>>>>> "Alexey" == Alexey Mednyy <swexru@gmail.com> writes:

 > Signed-off-by: Alexey Mednyy <swexru@gmail.com>

We normally use subjects like: '<foo>: bump version'.

Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/3] bump-libuci-to-upstream-version
  2014-10-12  8:20 ` [Buildroot] [PATCH 2/3] bump-libuci-to-upstream-version Alexey Mednyy
@ 2014-10-12 10:38   ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-10-12 10:38 UTC (permalink / raw)
  To: buildroot

>>>>> "Alexey" == Alexey Mednyy <swexru@gmail.com> writes:

 > Signed-off-by: Alexey Mednyy <swexru@gmail.com>

Same comment about the subject. Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 3/3] adding new package ubus.
  2014-10-12  8:20 ` [Buildroot] [PATCH 3/3] adding new package ubus Alexey Mednyy
@ 2014-10-13 20:46   ` Samuel Martin
  0 siblings, 0 replies; 6+ messages in thread
From: Samuel Martin @ 2014-10-13 20:46 UTC (permalink / raw)
  To: buildroot

Hi Alexey,

On Sun, Oct 12, 2014 at 10:20 AM, Alexey Mednyy <swexru@gmail.com> wrote:
> Signed-off-by: Alexey Mednyy <swexru@gmail.com>
> ---
>  package/Config.in                              |  1 +
>  package/ubus/Config.in                         | 11 ++++++++++
>  package/ubus/ubus-01-json-definition-fix.patch | 28 ++++++++++++++++++++++++++
>  package/ubus/ubus.mk                           | 26 ++++++++++++++++++++++++
>  4 files changed, 66 insertions(+)
>  create mode 100644 package/ubus/Config.in
>  create mode 100644 package/ubus/ubus-01-json-definition-fix.patch
>  create mode 100644 package/ubus/ubus.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index ea89c96..92fc6bb 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -872,6 +872,7 @@ menu "Other"
>         source "package/libtasn1/Config.in"
>         source "package/libtpl/Config.in"
>         source "package/libubox/Config.in"
> +       source "package/ubus/Config.in"

Keep the list alphabetically sorted, please.

>         source "package/libuci/Config.in"
>         source "package/libunwind/Config.in"
>         source "package/liburcu/Config.in"
> diff --git a/package/ubus/Config.in b/package/ubus/Config.in
> new file mode 100644
> index 0000000..6a9c73d
> --- /dev/null
> +++ b/package/ubus/Config.in
> @@ -0,0 +1,11 @@
> +config BR2_PACKAGE_UBUS
> +       bool "ubus"
> +       select BR2_PACKAGE_LIBUBOX
> +       depends on !BR2_PREFER_STATIC_LIB
> +       help
> +         OpenWrt micro bus architecture, project
> +          provide communication between various
> +          daemons and applications.

Indentation for the help text is 1 tab + 2 spaces (the first line is
ok, the 2 following are not).
At the end of the help message, the url of the package's project is missing.

> +
> +comment "ubus needs toolchain w/ dynamic library"
> +       depends on BR2_PREFER_STATIC_LIB
> diff --git a/package/ubus/ubus-01-json-definition-fix.patch b/package/ubus/ubus-01-json-definition-fix.patch
> new file mode 100644
> index 0000000..ccef101
> --- /dev/null
> +++ b/package/ubus/ubus-01-json-definition-fix.patch
> @@ -0,0 +1,28 @@
> +Fix wrong cmake behavior with json lib search
> +
> +Signed-off-by: Alexey Mednyy swexru at gmail.com
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index cb2f420..679b258 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -25,11 +25,18 @@ TARGET_LINK_LIBRARIES(ubus ubox)
> + ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
> + TARGET_LINK_LIBRARIES(ubusd ubox)
> +
> +-find_library(json NAMES json-c json)
> ++find_library(json NAMES json-c)
> + ADD_EXECUTABLE(cli cli.c)
> + SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus)
> + TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json ${json})
> +
> ++INCLUDE(FindPkgConfig)
> ++PKG_CHECK_MODULES(JSONC json-c)
> ++IF(JSONC_FOUND)
> ++  ADD_DEFINITIONS(-DJSONC)
> ++  INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})
> ++ENDIF()
> ++

hmm... something is wrong here.
First, you check for libjson-c using find_library, and you
unconditionally link cli with it, then you check for json-c headers,
and only update the cflags if they have been found.

So,
- pkg_check_modules sets both *_INCLUDE_DIRS and *_LIBRARIES variables
(and others, see cmake doc [1]); so:
  - you don't need the find_library call;
  - you should move the pkg_check_modules call above/before:
"target_link_library(cli ...)"
- Instead of "include(FindPkgConfig)", i prefer using
"find_package(PkgConfig)" which accepts options;
- Is json-c dependency optional?
  - if yes, then the "target_link_library(cli ${JSON_LIBRARIES})"
should be nested in the "if(JSONC_FOUND)"-block;
  - otherwise, the CMake should bail out because of the
missing/unfound dependency.

> + ADD_SUBDIRECTORY(lua)
> + ADD_SUBDIRECTORY(examples)
> +
> diff --git a/package/ubus/ubus.mk b/package/ubus/ubus.mk
> new file mode 100644
> index 0000000..9ac45ab
> --- /dev/null
> +++ b/package/ubus/ubus.mk
> @@ -0,0 +1,26 @@
> +################################################################################
> +#
> +# UBUS
> +#
> +################################################################################
> +
> +UBUS_VERSION = 4c4f35cf2230d70b9ddd87638ca911e8a563f2f3
> +UBUS_SITE = git://nbd.name/luci2/ubus.git
> +UBUS_LICENSE = LGPLv2.1
> +UBUS_DEPENDENCIES = host-pkgconf $(if $(BR2_PACKAGE_JSON_C),json-c)

host-pkgconf is already a CMake's dependency.

> +
> +ifeq ($(BR2_USE_MMU)$(BR2_PACKAGE_LUA_5_1),yy)
> +UBUS_DEPENDENCIES += lua
> +UBUS_CONF_OPTS += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \
> +       -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include

We usually like symetric option, even if it is the default value of
the option; so you should add:
-DBUILD_LUA=ON

> +else
> +       UBUS_CONF_OPTS += -DBUILD_LUA:BOOL=OFF

no indentation here
":BOOL" is not necessary here

> +endif
> +
> +ifeq ($(BR2_PACKAGE_SYSTEMD),y)
> +       UBUS_DEPENDENCIES += systemd
> +else
> +       UBUS_CONF_OPTS += -DENABLE_SYSTEMD:BOOL=OFF

ditto (no indentation, no ":BOOL", symetric option)

> +endif
> +
> +$(eval $(cmake-package))
> --
> 1.9.1
>

[1] http://www.cmake.org/cmake/help/v3.0/module/FindPkgConfig.html

Regards,

-- 
Samuel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-13 20:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-12  8:20 [Buildroot] [PATCH 1/3] bump libubox to upstream version Alexey Mednyy
2014-10-12  8:20 ` [Buildroot] [PATCH 2/3] bump-libuci-to-upstream-version Alexey Mednyy
2014-10-12 10:38   ` Peter Korsgaard
2014-10-12  8:20 ` [Buildroot] [PATCH 3/3] adding new package ubus Alexey Mednyy
2014-10-13 20:46   ` Samuel Martin
2014-10-12 10:38 ` [Buildroot] [PATCH 1/3] bump libubox to upstream version Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox