This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 76e02c0dd6cf2fa2b536f25c6136c4f277cd3ca5
Author: Arjav Patel <[email protected]>
AuthorDate: Thu Feb 12 17:54:54 2026 +0530

    netutils/cjson: update cJSON download URL format
    
    Modified CMakeLists.txt, Kconfig, and Makefile to change the cJSON download 
URL to include 'refs/tags/' for proper version fetching. This ensures 
compatibility with GitHub's archive download requirements.
    
    Signed-off-by: Arjav Patel <[email protected]>
---
 netutils/cjson/CMakeLists.txt | 6 +++---
 netutils/cjson/Kconfig        | 2 +-
 netutils/cjson/Makefile       | 6 ++----
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/netutils/cjson/CMakeLists.txt b/netutils/cjson/CMakeLists.txt
index b497e4a01..729dbc619 100644
--- a/netutils/cjson/CMakeLists.txt
+++ b/netutils/cjson/CMakeLists.txt
@@ -23,20 +23,20 @@
 if(CONFIG_NETUTILS_CJSON)
 
   if(NOT CONFIG_NETUTILS_CJSON_URL)
-    set(CONFIG_NETUTILS_CJSON_URL 
"https://github.com/DaveGamble/cJSON/archive";)
+    set(CONFIG_NETUTILS_CJSON_URL
+        "https://github.com/DaveGamble/cJSON/archive/refs/tags";)
   endif()
 
   if(NOT CONFIG_NETUTILS_CJSON_VERSION)
     set(CONFIG_NETUTILS_CJSON_VERSION "1.7.10")
   endif()
 
-  # GitHub requires refs/tags/ in the archive URL for tag downloads
   if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/cJSON)
     FetchContent_Declare(
       cJSON
       DOWNLOAD_NAME "v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
       DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
-      URL 
"${CONFIG_NETUTILS_CJSON_URL}/refs/tags/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
+      URL 
"${CONFIG_NETUTILS_CJSON_URL}/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
           SOURCE_DIR
           ${CMAKE_CURRENT_LIST_DIR}/cJSON
           BINARY_DIR
diff --git a/netutils/cjson/Kconfig b/netutils/cjson/Kconfig
index 4a360de6a..05773f157 100644
--- a/netutils/cjson/Kconfig
+++ b/netutils/cjson/Kconfig
@@ -14,7 +14,7 @@ if NETUTILS_CJSON
 
 config NETUTILS_CJSON_URL
        string "URL where cJSON library can be downloaded"
-       default "https://github.com/DaveGamble/cJSON/archive";
+       default "https://github.com/DaveGamble/cJSON/archive/refs/tags";
 
 config NETUTILS_CJSON_VERSION
        string "Version number"
diff --git a/netutils/cjson/Makefile b/netutils/cjson/Makefile
index 683bdb3da..050e5cf86 100644
--- a/netutils/cjson/Makefile
+++ b/netutils/cjson/Makefile
@@ -28,7 +28,7 @@ include $(APPDIR)/Make.defs
 
 WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
 
-CONFIG_NETUTILS_CJSON_URL ?= "https://github.com/DaveGamble/cJSON/archive";
+CONFIG_NETUTILS_CJSON_URL ?= 
"https://github.com/DaveGamble/cJSON/archive/refs/tags";
 CONFIG_NETUTILS_CJSON_VERSION ?= "1.7.10"
 CJSON_VERSION = $(patsubst "%",%,$(strip $(CONFIG_NETUTILS_CJSON_VERSION)))
 
@@ -49,12 +49,10 @@ CSRCS = $(CJSON_SRCDIR)$(DELIM)cJSON.c
 CSRCS += $(CJSON_SRCDIR)$(DELIM)cJSON_Utils.c
 
 # Download and unpack tarball if no git repo found
-# GitHub requires refs/tags/ in the archive URL for tag downloads (see
-# 
https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives)
 ifeq ($(wildcard $(CJSON_UNPACKNAME)/.git),)
 $(CJSON_TARBALL):
        @echo "Downloading: $(CJSON_TARBALL)"
-       $(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/refs/tags/$(CJSON_TARBALL)
+       $(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/$(CJSON_TARBALL)
 
 $(CJSON_UNPACKNAME): $(CJSON_TARBALL)
        @echo "Unpacking: $(CJSON_TARBALL) -> $(CJSON_UNPACKNAME)"

Reply via email to