bcm4908: Deactivate pci feature
[openwrt/openwrt.git] / package / libs / libubox / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=libubox
4 PKG_RELEASE=2
5
6 PKG_SOURCE_PROTO:=git
7 PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
8 PKG_MIRROR_HASH:=1cdb91ac0ee925f133ee9f70eac131a99def312fe7cf0aed44df84eb1762e30b
9 PKG_SOURCE_DATE:=2021-08-19
10 PKG_SOURCE_VERSION:=d716ac4bc4236031d4c3cc1ed362b502e20e3787
11 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
12 CMAKE_INSTALL:=1
13
14 PKG_LICENSE:=ISC
15 PKG_LICENSE_FILES:=
16
17 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
18
19 PKG_BUILD_DEPENDS:=lua
20 HOST_BUILD_DEPENDS:=libjson-c/host
21 HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/host-build.mk
25 include $(INCLUDE_DIR)/cmake.mk
26
27 define Package/libubox
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=Basic utility library
31 ABI_VERSION:=$(PKG_ABI_VERSION)
32 DEPENDS:=
33 endef
34
35 define Package/libblobmsg-json
36 SECTION:=libs
37 CATEGORY:=Libraries
38 TITLE:=blobmsg <-> json conversion library
39 ABI_VERSION:=$(PKG_ABI_VERSION)
40 DEPENDS:=+libjson-c +libubox
41 endef
42
43 define Package/jshn
44 SECTION:=utils
45 CATEGORY:=Utilities
46 DEPENDS:=+libjson-c +libubox +libblobmsg-json
47 TITLE:=JSON SHell Notation
48 endef
49
50 define Package/jshn/description
51 Library for parsing and generating JSON from shell scripts
52 endef
53
54 define Package/libjson-script
55 SECTION:=utils
56 CATEGORY:=Utilities
57 DEPENDS:=+libubox
58 ABI_VERSION:=$(PKG_ABI_VERSION)
59 TITLE:=Minimalistic JSON based scripting engine
60 endef
61
62 define Package/libubox-lua
63 SECTION:=libs
64 CATEGORY:=Libraries
65 DEPENDS:=+libubox +liblua
66 TITLE:=Lua binding for the OpenWrt Basic utility library
67 endef
68
69 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
70 CMAKE_OPTIONS += \
71 -DLUAPATH=/usr/lib/lua \
72 -DABIVERSION="$(PKG_ABI_VERSION)"
73
74 define Package/libubox/install
75 $(INSTALL_DIR) $(1)/lib/
76 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libubox.so.* $(1)/lib/
77 endef
78
79 define Package/libblobmsg-json/install
80 $(INSTALL_DIR) $(1)/lib/
81 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblobmsg_json.so.* $(1)/lib/
82 endef
83
84 define Package/jshn/install
85 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/libubox
86 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jshn $(1)/usr/bin
87 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libubox/jshn.sh $(1)/usr/share/libubox
88 endef
89
90 define Package/libjson-script/install
91 $(INSTALL_DIR) $(1)/lib/
92 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so.* $(1)/lib/
93 endef
94
95 define Package/libubox-lua/install
96 $(INSTALL_DIR) $(1)/usr/lib/lua
97 $(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
98 endef
99
100
101 CMAKE_HOST_OPTIONS += \
102 -DBUILD_LUA=OFF \
103 -DBUILD_EXAMPLES=OFF \
104 -DCMAKE_SKIP_RPATH=FALSE \
105 -DCMAKE_MACOSX_RPATH=1 \
106 -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" \
107
108 $(eval $(call BuildPackage,libubox))
109 $(eval $(call BuildPackage,libblobmsg-json))
110 $(eval $(call BuildPackage,jshn))
111 $(eval $(call BuildPackage,libjson-script))
112 $(eval $(call BuildPackage,libubox-lua))
113 $(eval $(call HostBuild))