Skip to content

Commit

Permalink
package/libs/libjson-c updated to version 0.15
Browse files Browse the repository at this point in the history
Signed-off-by: Isaev Ruslan <[email protected]>
  • Loading branch information
legale committed Sep 2, 2022
1 parent 912b8f5 commit e2de2c6
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 95 deletions.
38 changes: 17 additions & 21 deletions package/libs/libjson-c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,43 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=json-c
PKG_VERSION:=0.12
PKG_RELEASE:=1
PKG_VERSION:=0.15
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz
PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/
PKG_MD5SUM:=3ca4bbb881dfc4017e8021b5e0a8c491
PKG_HASH:=99bca4f944b8ced8ae0bbc6310d6a3528ca715e69541793a1ef51f8c5b4b0878

PKG_MAINTAINER:=Felix Fietkau <[email protected]>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:json-c_project:json-c

PKG_FIXUP:=autoreconf
PKG_INSTALL:=1

PKG_MAINTAINER:=Felix Fietkau <[email protected]>
HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk

TARGET_CFLAGS += $(FPIC)

CONFIGURE_ARGS += \
ac_cv_func_strdup=yes \
ac_cv_func_strncasecmp=yes \
ac_cv_func_snprintf=yes
CMAKE_HOST_OPTIONS += \
-DBUILD_SHARED_LIBS=FALSE

define Package/libjson-c
SECTION:=libs
CATEGORY:=Libraries
TITLE:=javascript object notation
URL:=http://oss.metaparadigm.com/json-c/
URL:=https://json-c.github.io/json-c/
ABI_VERSION:=5
endef

define Package/libjson-c/description
This package contains a library for javascript object notation backends.
endef

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/json-c $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjson-c.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/json-c.pc $(1)/usr/lib/pkgconfig/
$(call Build/InstallDev/cmake,$(1))
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/json-c.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/json-c.pc
endef

define Package/libjson-c/install
Expand All @@ -58,3 +53,4 @@ define Package/libjson-c/install
endef

$(eval $(call BuildPackage,libjson-c))
$(eval $(call HostBuild))
50 changes: 0 additions & 50 deletions package/libs/libjson-c/patches/000-libm.patch

This file was deleted.

23 changes: 0 additions & 23 deletions package/libs/libjson-c/patches/001-backport_compile_fix.patch

This file was deleted.

11 changes: 11 additions & 0 deletions package/libs/libjson-c/patches/001-dont-build-docs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -401,8 +401,6 @@ set(JSON_C_SOURCES
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})

-add_subdirectory(doc)
-
# uninstall
add_custom_target(uninstall
COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm
11 changes: 11 additions & 0 deletions package/libs/libjson-c/patches/010-clang.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -265,7 +265,7 @@ message(STATUS "Wrote ${PROJECT_BINARY_D
configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h)
message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h")

-if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
if ("${DISABLE_WERROR}" STREQUAL "OFF")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
18 changes: 17 additions & 1 deletion target/linux/ipq/image/ipq60xx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ KERNEL_ENTRY := $(KERNEL_LOADADDR)
INFO_IMG_PATH = $(TMP_DIR)/info.tmp
INFO_IMG_SIZE = 152

define Build/gzip
gzip -f -9n -c $@ $(1) > $@.new
@mv $@.new $@
endef

define Build/fit-dummy-info
dd if=/dev/zero of=$(INFO_IMG_PATH) bs=1 count=$(INFO_IMG_SIZE)
$(TOPDIR)/scripts/mkits.sh \
Expand All @@ -34,7 +39,18 @@ define Device/8devices-mango-dvk
BOARDNAME := mango
IMAGE_SIZE := 27776k
BLOCKSIZE = 64k
KERNEL = kernel-bin | lzma | fit-dummy-info lzma $$(DEVICE_DTS_DIR)/$$(DEVICE_DTS).dtb
KERNEL = kernel-bin | gzip | fit-dummy-info gzip $$(DEVICE_DTS_DIR)/$$(DEVICE_DTS).dtb
IMAGE/sysupgrade.bin := insert-info | append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
endef
TARGET_DEVICES += 8devices-mango-dvk


define Device/Yuncore-ax840
DEVICE_TITLE := Yuncore ax840
DEVICE_DTS := qcom-ipq6018-8dev-mango
BOARDNAME := ax840
IMAGE_SIZE := 27776k
BLOCKSIZE = 64k
KERNEL = kernel-bin | gzip | fit-dummy-info gzip $$(DEVICE_DTS_DIR)/$$(DEVICE_DTS).dtb
IMAGE/sysupgrade.bin := insert-info | append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
endef

4 comments on commit e2de2c6

@valinskas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @legale -- i don't know if you have seen this https://github.com/8devices/openwrt-8devices/tree/qsdk-12.0-ipq60xx-5.4 repository (it is qsdk-12.0-ipq60xx-5.4 branch) .

It should be about the same, packages wise, expect linux kernel 4.4.x -> replaced with 5.4.x
which comes out with QSDK 12 kernel and related changes. This is the one 8devices wants to
push forward with.

I can pull in changes as you have made on qsdk-11.3-ipq60xx-4.4..

@valinskas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant probably the same changes might be needed on qsdk-12.0-ipq60xx-5.4 branch.

@legale
Copy link
Author

@legale legale commented on e2de2c6 Sep 4, 2022 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legale
Copy link
Author

@legale legale commented on e2de2c6 Sep 5, 2022 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.