ubus: new package
PATCH v2 1/1 ubus: new package
Signed-off-by Alexey Mednyy <[email protected]>
--- package/Config.in | 1 + package/ubus/Config.in | 13 ++++++++++++ package/ubus/ubus-01-json-definition-fix.patch | 20 ++++++++++++++++++ package/ubus/ubus.mk | 28 ++++++++++++++++++++++++++ 4 files changed, 62 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
package/Config.in +1 -0
@@ -896,6 +896,7 @@ menu "Other" source "package/startup-notification/Config.in" source "package/tz/Config.in" source "package/tzdata/Config.in" + source "package/ubus/Config.in" endmenu menu "Security"
package/ubus/Config.in new file +13 -0
@@ -0,0 +1,13 @@ +config BR2_PACKAGE_UBUS + bool "ubus" + select BR2_PACKAGE_LIBUBOX + select BR2_PACKAGE_JSON_C + depends on !BR2_PREFER_STATIC_LIB + help + OpenWrt micro bus architecture, project + provide communication between various + daemons and applications. + http://wiki.openwrt.org/doc/techref/ubus + +comment "ubus needs toolchain w/ dynamic library" + depends on BR2_PREFER_STATIC_LIB
package/ubus/ubus-01-json-definition-fix.patch new file +20 -0
@@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cb2f420..f905c88 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,7 +25,14 @@ 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_package(PkgConfig) ++PKG_CHECK_MODULES(JSONC json-c) ++IF(JSONC_FOUND) ++ ADD_DEFINITIONS(-DJSONC) ++ INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS}) ++ENDIF() ++ + ADD_EXECUTABLE(cli cli.c) + SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus) + TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json ${json})
package/ubus/ubus.mk new file +28 -0
@@ -0,0 +1,28 @@ +################################################################################ +# +# UBUS +# +################################################################################ + +UBUS_VERSION = 4c4f35cf2230d70b9ddd87638ca911e8a563f2f3 +UBUS_SITE = git://nbd.name/luci2/ubus.git +UBUS_LICENSE = LGPLv2.1 +UBUS_DEPENDENCIES = json-c libubox + +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 \ + -DBUILD_LUA=ON +else +UBUS_CONF_OPTS += -DBUILD_LUA=OFF +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +UBUS_DEPENDENCIES += systemd \ + -DENABLE_SYSTEMD=ON +else +UBUS_CONF_OPTS += -DENABLE_SYSTEMD=OFF +endif + +$(eval $(cmake-package))
Signature · 1 line
1.9.1
PATCH v2 1/1 ubus: new package
Hi Alexey,
Quoted 29 lines · Alexey Mednyy
Signed-off-by Alexey Mednyy <[email protected]>--- package/Config.in | 1 + package/ubus/Config.in | 13 ++++++++++++ package/ubus/ubus-01-json-definition-fix.patch | 20 ++++++++++++++++++ package/ubus/ubus.mk | 28 ++++++++++++++++++++++++++ 4 files changed, 62 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.mkpackage/Config.in +1
-0@@ -896,6 +896,7 @@ menu "Other" source "package/startup-notification/Config.in" source "package/tz/Config.in" source "package/tzdata/Config.in" + source "package/ubus/Config.in" endmenu menu "Security"package/ubus/Config.in new file +0
-0
package/ubus/Config.in line 10
Quoted 10 lines
package/ubus/Config.in new file +10
-0@@ -0,0 +1,13 @@ +config BR2_PACKAGE_UBUS + bool "ubus" + select BR2_PACKAGE_LIBUBOX + select BR2_PACKAGE_JSON_C + depends on !BR2_PREFER_STATIC_LIB + help + OpenWrt micro bus architecture, project + provide communication between various + daemons and applications. + http://wiki.openwrt.org/doc/techref/ubus
Add a blank line between the help description and the url.
Quoted 19 lines
package/ubus/Config.in new file +3
-0+TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json ${json}) +comment "ubus needs toolchain w/ dynamic library" + depends on BR2_PREFER_STATIC_LIBpackage/ubus/ubus-01-json-definition-fix.patch new file +10
-0@@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cb2f420..f905c88 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,7 +25,14 @@ 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) ++
package/ubus/ubus-01-json-definition-fix.patch line 20
Quoted 10 lines
package/ubus/ubus-01-json-definition-fix.patch new file +10
-0++find_package(PkgConfig) ++PKG_CHECK_MODULES(JSONC json-c) ++IF(JSONC_FOUND) ++ ADD_DEFINITIONS(-DJSONC) ++ INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS}) ++ENDIF() ++ + ADD_EXECUTABLE(cli cli.c) + SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus) + TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json ${json})
The target_link_library is not right. You should do:
---TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json) IF(JSONC_FOUND)
TARGET_LINK_LIBRARIES(cli ${JSONC_LIBRARIES})ENDIF()
---
Quoted 19 lines
package/ubus/ubus.mk new file +13
-0@@ -0,0 +1,28 @@ +################################################################################ +# +# UBUS +# +################################################################################ + +UBUS_VERSION = 4c4f35cf2230d70b9ddd87638ca911e8a563f2f3 +UBUS_SITE = git://nbd.name/luci2/ubus.git +UBUS_LICENSE = LGPLv2.1 +UBUS_DEPENDENCIES = json-c libubox + +ifeq ($(BR2_USE_MMU)$(BR2_PACKAGE_LUA_5_1),yy) +UBUS_DEPENDENCIES += lua
package/ubus/ubus.mk line 23
Quoted 10 lines
package/ubus/ubus.mk new file +10
-0+UBUS_CONF_OPTS += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \ + -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include \ + -DBUILD_LUA=ON +else +UBUS_CONF_OPTS += -DBUILD_LUA=OFF +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +UBUS_DEPENDENCIES += systemd \ + -DENABLE_SYSTEMD=ON
The -D... args belong to the *_CONF_OPTS, not the *_DEPENDENCIES.
Quoted 8 lines
package/ubus/ubus.mk new file +5
-1+else +UBUS_CONF_OPTS += -DENABLE_SYSTEMD=OFF +endif + +$(eval $(cmake-package)) --1.9.1
Quoted 4 lines
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Regards,
Signature · 1 line
Samuel