Skip to content

Commit c4ced34

Browse files
authored
Fix dependency list (#6411)
* 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 #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
1 parent 319c888 commit c4ced34

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

cross/ntopng/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ PKG_DIST_SITE = https://github.com/ntop/ntopng/archive
66
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
77
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)
88

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

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

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

7777
include ../../mk/spksrc.cross-cc.mk

mk/dependency-list.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ function get_ffmpeg_dependency ()
6262
function get_file_dependencies ()
6363
{
6464
if [ -f ${1}/Makefile ]; then
65-
if [ "$(dirname ${1})" = "spk" ]; then
66-
get_python_dependency ${1}
67-
get_ffmpeg_dependency ${1}
68-
fi
6965
grep "^DEPENDS\|^NATIVE_DEPENDS\|^BUILD_DEPENDS" ${1}/Makefile | cut -d= -f2 | sort -u | tr '\n' ' '
7066
fi
7167
}
@@ -91,7 +87,7 @@ function contains ()
9187
function get_dependencies ()
9288
{
9389
local dependencies=
94-
for dep in "${1}"; do
90+
for dep in ${1}; do
9591
dependencies+="${dep} "
9692
dependencies+="$(get_file_dependencies ${dep}) "
9793
done
@@ -108,15 +104,15 @@ function get_spk_dependencies ()
108104
dependencies=${cumulated_dependencies}
109105
cumulated_dependencies=$(get_dependencies "${dependencies}")
110106
done
111-
echo ${cumulated_dependencies} | tr ' ' '\n' | sort -u | tr '\n' ' '
107+
echo ${cumulated_dependencies}
112108
}
113109

114110
# get the dependency list for a package
115111
# param1: spk package folder (like spk/{name})
116112
function get_dependency_list ()
117113
{
118114
local spk_name=$(get_spk_name ${1})
119-
local toplevel_dependencies=$(get_file_dependencies ${1})
115+
local toplevel_dependencies="$(get_file_dependencies ${1}) $(get_python_dependency ${1}) $(get_ffmpeg_dependency ${1})"
120116
local spk_dependencies=$(get_spk_dependencies "${toplevel_dependencies}")
121117
echo "${spk_name}: ${spk_dependencies}"
122118
}

0 commit comments

Comments
 (0)