Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

# Avoid interactive prompts during package install
ENV DEBIAN_FRONTEND=noninteractive

# Install Node.js 20.x from NodeSource repository (required for selenium-webdriver and other packages)
RUN apt-get update && apt-get install -y curl ca-certificates gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs

# Install required packages
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libsqlite3-dev \
nodejs \
npm \
pkg-config \
libavcodec-dev \
libavformat-dev \
Expand All @@ -20,6 +23,8 @@ RUN apt-get update && apt-get install -y \
libcjson-dev \
libwolfssl-dev \
libssl-dev \
file \
systemd \
&& apt-get clean

# Create a non-root user for VS Code
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
],
"forwardPorts": [],
"postCreateCommand": "npm install",
"remoteUser": "vscode"
"remoteUser": "root"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Makefile
/external

# node modules
node_modules/
web/node_modules/

# Web build artifacts (built during CI/CD, not checked in)
Expand Down
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,26 @@ else()
endif()

# Find cJSON
find_package(cJSON QUIET)
if(NOT cJSON_FOUND)
# If not found via find_package, try pkg-config
pkg_check_modules(CJSON cjson)
if(NOT CJSON_FOUND)
message(STATUS "cJSON not found via find_package or pkg-config, will use bundled version")
set(CJSON_BUNDLED TRUE)
pkg_check_modules(CJSON QUIET libcjson)
if(CJSON_FOUND)
# Use pkg-config result (CJSON_LIBRARIES is automatically set)
message(STATUS "Found cJSON via pkg-config: ${CJSON_LIBRARIES}")
else()
# Try alternative pkg-config name
pkg_check_modules(CJSON QUIET cjson)
if(CJSON_FOUND)
message(STATUS "Found cJSON via pkg-config (alternative): ${CJSON_LIBRARIES}")
else()
# Try find_package as last resort
find_package(cJSON QUIET)
if(cJSON_FOUND)
set(CJSON_LIBRARIES cjson)
set(CJSON_FOUND TRUE) # Set this for consistency
message(STATUS "Found cJSON via find_package")
else()
message(STATUS "cJSON not found via pkg-config or find_package, will use bundled version")
set(CJSON_BUNDLED TRUE)
endif()
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion include/storage/storage_manager_streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef LIGHTNVR_STORAGE_MANAGER_STREAMS_H
#define LIGHTNVR_STORAGE_MANAGER_STREAMS_H

#include "../../external/cjson/cJSON.h"
#include <cjson/cJSON.h>

/**
* Stream storage usage information
Expand Down
2 changes: 1 addition & 1 deletion include/storage/storage_manager_streams_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <stdint.h>
#include "storage/storage_manager_streams.h"
#include "../../external/cjson/cJSON.h"
#include <cjson/cJSON.h>

/**
* Initialize the storage manager streams cache
Expand Down
2 changes: 1 addition & 1 deletion src/core/logger_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "core/logger.h"
#include "core/logger_json.h"
#include "../external/cjson/cJSON.h"
#include <cjson/cJSON.h>

// JSON logger state
static struct {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/storage_manager_streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "storage/storage_manager_streams.h"
#include "core/logger.h"
#include "core/config.h"
#include "../../external/cjson/cJSON.h"
#include <cjson/cJSON.h>

/**
* Get storage usage per stream
Expand Down
2 changes: 1 addition & 1 deletion src/storage/storage_manager_streams_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "storage/storage_manager.h"
#include "core/logger.h"
#include "core/config.h"
#include "../../external/cjson/cJSON.h"
#include <cjson/cJSON.h>

// Forward declarations for functions from storage_manager_streams.c
extern int get_stream_storage_usage(const char *storage_path, stream_storage_info_t *stream_info, int max_streams);
Expand Down
2 changes: 1 addition & 1 deletion src/video/go2rtc/go2rtc_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <errno.h>
#include <curl/curl.h>
#include <ctype.h>
#include "../../external/cjson/cJSON.h"
#include <cjson/cJSON.h>

// API client configuration
static char *g_api_host = NULL;
Expand Down
6 changes: 6 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(ENABLE_SOD)
)
if(CJSON_BUNDLED)
target_link_libraries(test_sod_unified cjson_lib)
elseif(CJSON_FOUND)
target_link_libraries(test_sod_unified ${CJSON_LIBRARIES})
endif()

target_link_libraries(test_sod_voc
Expand All @@ -74,6 +76,8 @@ if(ENABLE_SOD)
)
if(CJSON_BUNDLED)
target_link_libraries(test_sod_voc cjson_lib)
elseif(CJSON_FOUND)
target_link_libraries(test_sod_voc ${CJSON_LIBRARIES})
endif()

# Set output directory for test binaries
Expand Down Expand Up @@ -136,6 +140,8 @@ target_link_libraries(test_stream_detection
)
if(CJSON_BUNDLED)
target_link_libraries(test_stream_detection cjson_lib)
elseif(CJSON_FOUND)
target_link_libraries(test_stream_detection ${CJSON_LIBRARIES})
endif()

if(ENABLE_SOD)
Expand Down
Loading