Skip to content

Commit

Permalink
Fix dependency list (SynoCommunity#6411)
Browse files Browse the repository at this point in the history
* fix dependency-list.sh
- script was lacking some dependencies (not recursing into all dependent Makefiles)

* cross/ntopng: avoid variable in DEPENDS
- was not updated in SynoCommunity#6255

* speedup dependency-list.sh
- remove duplicates in cumulated dependencies early

* optimize dependency-list script
- remove obsolete unique filtering
- apply python and ffmpeg dependencies on top level only
  • Loading branch information
hgy59 authored Jan 26, 2025
1 parent 319c888 commit c4ced34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 5 additions & 5 deletions cross/ntopng/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ PKG_DIST_SITE = https://github.com/ntop/ntopng/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

NODEJS = nodejs_16
BUILD_DEPENDS = native/$(NODEJS)
# Remarks: BUILD_DEPENDS is additionally used to add native node and npm to PATH
BUILD_DEPENDS = native/nodejs_16

DEPENDS = cross/libcap cross/ndpi cross/curl
DEPENDS += cross/libmaxminddb cross/sqlite cross/mysql-connector-c
Expand Down Expand Up @@ -69,9 +69,9 @@ CONFIGURE_ARGS += my_cv_rw_locks_supported=$(RW_LOCKS_SUPPORTED)

ENV += DESTDIR=$(INSTALL_DIR)
# add install/bin folder to path to let ./configure find mysql_config (it is a script and works for cross compile)
# add native nodejs and npm to path
NODE_BIN_FOLDER = $(realpath $(WORK_DIR)/../../../native/$(NODEJS)/work-native/node/bin)
NPM_BIN_FOLDER = $(realpath $(WORK_DIR)/../../../native/$(NODEJS)/work-native/node/lib/node_modules/npm/bin)
# add native node and npm commands to path
NODE_BIN_FOLDER = $(realpath $(WORK_DIR)/../../../$(BUILD_DEPENDS)/work-native/node/bin)
NPM_BIN_FOLDER = $(realpath $(WORK_DIR)/../../../$(BUILD_DEPENDS)/work-native/node/lib/node_modules/npm/bin)
ENV += "PATH=$(PATH):$(NODE_BIN_FOLDER):$(NPM_BIN_FOLDER):$(STAGING_INSTALL_PREFIX)/bin"

include ../../mk/spksrc.cross-cc.mk
Expand Down
10 changes: 3 additions & 7 deletions mk/dependency-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ function get_ffmpeg_dependency ()
function get_file_dependencies ()
{
if [ -f ${1}/Makefile ]; then
if [ "$(dirname ${1})" = "spk" ]; then
get_python_dependency ${1}
get_ffmpeg_dependency ${1}
fi
grep "^DEPENDS\|^NATIVE_DEPENDS\|^BUILD_DEPENDS" ${1}/Makefile | cut -d= -f2 | sort -u | tr '\n' ' '
fi
}
Expand All @@ -91,7 +87,7 @@ function contains ()
function get_dependencies ()
{
local dependencies=
for dep in "${1}"; do
for dep in ${1}; do
dependencies+="${dep} "
dependencies+="$(get_file_dependencies ${dep}) "
done
Expand All @@ -108,15 +104,15 @@ function get_spk_dependencies ()
dependencies=${cumulated_dependencies}
cumulated_dependencies=$(get_dependencies "${dependencies}")
done
echo ${cumulated_dependencies} | tr ' ' '\n' | sort -u | tr '\n' ' '
echo ${cumulated_dependencies}
}

# get the dependency list for a package
# param1: spk package folder (like spk/{name})
function get_dependency_list ()
{
local spk_name=$(get_spk_name ${1})
local toplevel_dependencies=$(get_file_dependencies ${1})
local toplevel_dependencies="$(get_file_dependencies ${1}) $(get_python_dependency ${1}) $(get_ffmpeg_dependency ${1})"
local spk_dependencies=$(get_spk_dependencies "${toplevel_dependencies}")
echo "${spk_name}: ${spk_dependencies}"
}
Expand Down

0 comments on commit c4ced34

Please sign in to comment.